Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#2258 closed defect (fixed)

Atlas default player settings suboptimal for RMS

Reported by: FeXoR Owned by: O.Davoodi
Priority: Should Have Milestone: Alpha 15
Component: Atlas editor Keywords: Atlas, player-settings, civ-settings, RMS, bug, error, warning
Cc: Patch:

Description (last modified by elexis)

Error description: Random maps don't generate properly (in some circumstances)

Reason: Not all players civilizations are set

To reproduce:

  • Open Atlas
  • Reduce the number of players to 2
  • Generate "Fortress" random map (working, all players beyond 2 will now have no civ set)
  • Increase the number of player to 3 (player 3 will still have no civ)
  • Generate "Fortress" random map (crashing)

This is due to player 3 will have no civ defined. On other maps that "only" leads to warnings about that and player 3 will get Athenian starting entities despite it's civ (which is undefined ofc.).

How to fix: I recommend to check all buttons for "civilization" in Atlas player settings by default (even if the number of player are reduced, a random map is generated and then the number of players is increased again). That is the initial state (if the number of players are NOT changed) anyway. Additionally I'd suggest to force all players civilizations to be set if the "Generate map" button is pressed (because RMS needs set civs - as is and in some cases anyway, see below).

(OPTIONAL: If it's wanted to generate maps with starting entities without a preset civ to enable the use of RMS as a basis of Skirmish Maps starting entities for the case civ = "random" (I guess) needs to be added (I don't know where). However, due to walls not having the same length for all civs and civs have different NUMBER of starting entities (e.g. Iberian civ bonus walls) RMS with walls will never be possible that way.)

Attachments (5)

undefined_civ.diff (4.4 KB ) - added by sanderd17 11 years ago.
undefined_civ_fex.diff (31.4 KB ) - added by FeXoR 11 years ago.
SVN .diff including the modified wall_builder.js allongside with the (needed) previous modifications to library.js by sanderd17
library.js (12.5 KB ) - added by FeXoR 11 years ago.
wall_builder.js (58.5 KB ) - added by FeXoR 11 years ago.
Modified wall_builder.js (handle arguments more gratiously and sane, fixed many spelling errors (sorry for that))
wall_demo.js (11.7 KB ) - added by FeXoR 11 years ago.

Download all attachments as: .zip

Change History (20)

comment:1 by FeXoR, 11 years ago

Description: modified (diff)

comment:2 by FeXoR, 11 years ago

Description: modified (diff)

comment:3 by FeXoR, 11 years ago

Description: modified (diff)

comment:4 by FeXoR, 11 years ago

Description: modified (diff)

comment:5 by FeXoR, 11 years ago

Description: modified (diff)

comment:6 by FeXoR, 11 years ago

Description: modified (diff)

comment:7 by FeXoR, 11 years ago

May be related to #1872

A fallback to Athens and a warning (handle the problem more graciously) could still be good for RMS.

For adding a "scirm" civ (like in 0ad/binaries/data/mods/public/simulation/templates/skirmish/units/special_starting_unit.xml) a skirm.json would need to be added in 0ad/binaries/data/mods/public/civs (if RMS are wanted as basis of generating Skirmish maps in Atlas).

Last edited 11 years ago by FeXoR (previous) (diff)

comment:8 by FeXoR, 11 years ago

Description: modified (diff)

comment:9 by FeXoR, 11 years ago

Description: modified (diff)

by sanderd17, 11 years ago

Attachment: undefined_civ.diff added

comment:10 by sanderd17, 11 years ago

IMO, having a fallback to athen is enough. The random maps in Atlas are mostly used to generate nice terrains or forests as a base to work on. The entities owned by the players don't matter too much.

I've included a patch with a fallback to athens.

comment:11 by FeXoR, 11 years ago

This patch fixes:

  • getCivCode always returns a valid civ by adding a FALLBACK_CIV (done by sanderd17)
  • Stop overriding valid wall styles and using getCivCode
  • Newly added civs (like "ptol" ATM) will not cause errors any more (but warn and fallback to "athen")
  • A bug in "palisades" fortress type generation code
  • Placement angle of gates (for http://trac.wildfiregames.com/ticket/1217#comment:6)
  • Default fortress sizes
  • Many spelling errors (sorry for that)

This patch does not (yet) include (ToDO):

  • Adding wall style "ptol"

This will fix the errors but it does NOT fix the inconsistent default player settings in Atlas.

Pls fix that too.

EDIT: There is a bracket missing in wall_builder.js line 449... fixing and adding ptol...

Last edited 11 years ago by FeXoR (previous) (diff)

by FeXoR, 11 years ago

Attachment: undefined_civ_fex.diff added

SVN .diff including the modified wall_builder.js allongside with the (needed) previous modifications to library.js by sanderd17

by FeXoR, 11 years ago

Attachment: library.js added

by FeXoR, 11 years ago

Attachment: wall_builder.js added

Modified wall_builder.js (handle arguments more gratiously and sane, fixed many spelling errors (sorry for that))

by FeXoR, 11 years ago

Attachment: wall_demo.js added

comment:12 by FeXoR, 11 years ago

Additionally added Ptolemaic Egypts to wall styles and wall_demo. Latest files:

  • undefined_civ_fex.diff (containing all changes)
  • library.js (only changed by patch from sanderd17)
  • wall_builder.js (Fixed the missing bracket and added wall style "ptol")
  • (wall_builder.2.js is a duplication, sorry)
  • wall_demo.js (Added wall style "ptol")

From my side everything seams fine now.

Still I really think player settings should be made consistent!

SIDENOTE: Things not working due to unfinished civs (not part of this problem/ticket):

  • ptol_cavalry_swordsman_b seams to have bugs
  • Civilization "theb" in general is incomplete
Last edited 11 years ago by FeXoR (previous) (diff)

comment:13 by O.Davoodi, 11 years ago

Owner: set to O.Davoodi
Resolution: fixed
Status: newclosed

In 14169:

Committing the fix for undefined civs in atlas, and the problem with ptolemics in Fortress map by FeXoR. Fixes #2258.

comment:14 by Yves, 11 years ago

Milestone: BacklogAlpha 15

comment:15 by elexis, 7 years ago

Description: modified (diff)

In r20512:
Delete FALLBACK_CIV "athen" and related code in rmgen/, refs #4034.

It was only triggered if a civ wasn't set in Atlas.
Because civs are expected to be well-defined everywhere, alwas set the property in Atlas too, fixing the non-GUI part of #4869.
Use the existing player defaults value then instead of hardcoding a fallback civ string.

Note: See TracTickets for help on using tickets.