The code in this revision has the primary purpose of stripping out the civ-specific hardcoding inside the Random Map Generation wall placement script.
At present, this hardcoding contains:
- For each civ:
- A wall scale multiplier (used to calculate wall piece length)
- For each wall element of each civ:
- The name is derived from a pattern, feeding in a civ code,
- The length is derived from a constant number multiplied by the above mentioned civ's "wall scale" multiplier.
- And for some "special" pieces, a hardcoded indent, orientation and length is set.
This hardcoding has been removed, with any specific indent or orientation being moved to the respective template files; and a list of wallsets that a civ can build is now read from that civ's {civ}.json file.
This change has the dual advantage of:
- Being easier for modders to add new civs/wallsets to the game, or edit existing ones, and getting them to work with the rms-wall-placement; and
- The rms-wall-placement code now reads the same wall-length values as the wall-placement code used by players placing walls in game. (There is the caveat that they do handle them slightly differently.)
This is a fairly large patch, so I'm suggesting it be committed across three commits:
Editing the templates to add the new indent and orientation values,(Done in rP20589)- Committing of the wall-placement code,
- Committing of changes to all random maps that currently use the rms-wall-placement script.
Whilst not all of @FeXoR's concerns about standardising how the two different wall-placement codebases handle and calculate wall lengths, end points, and overlapping are addressed; the hope is that these concerns can be addressed in a later patch that can focus entirely on that problem. (And be much smaller and concise than this one.)
(Patch originally started by FeXoR, edited by me (s0600204), passed back and forth, before sitting in limbo until rebase'd and uploaded here, with FeXoR's permission.)