Opened 6 years ago

Last modified 5 years ago

#4940 new defect

Remove rmgen Iberian Wall hardcoding

Reported by: elexis Owned by:
Priority: Should Have Milestone: Backlog
Component: Maps Keywords:
Cc: Patch:

Description

rmgen currently hardcodes that Iberians and only Iberians have starting walls.

This fact (and if needed some more arguments) should be moved to the civ definition file.

This way mods can reuse the feature and it makes the library agnostic of game content.

Change History (3)

comment:1 by elexis, 6 years ago

Skirmish maps support starting walls too by placing skirmish/structures/iber_wall_short etc. This ought to become agnostic as well, i.e. skirmish/structures/wall_short. However the lengths of walls differ per civ, so it's not cleanly feasible.

The rmgen starting wall function is placeGenericFortress and as of Phab:D900 it looks up the templates in order to position them ideally. So letting rmgen place skirmish walls doesn't work out here.

So it seems like skirmish maps have to live with the civ hardcodings while rmgen has the computational power to become civ-agnostic. So it indeed has to be a new property in the civ json file rather than being able to reuse the iber wall skirmish replacement code in rmgen to detect whether initial city walls should be placed.

comment:2 by elexis, 6 years ago

In 20815:

Implement random map script playerbase function.
Unifies 54 variants of the rmgen playerbase code, fixes #4805.

Add retry loops to prevent collisions of starting resources, fixes #4600 and
resources placed outside of the map area, fixes #4796.

Lays the foundation to test for collisions with Iberian walls, refs #2192 and
allows to rearrange the starting resources on all random maps without being confronted with code.

Delete remains of misc.js, leaving the rmgen files sorted by logic, fixes #4804.
Concludes what was started in rP18816, rP19282, specifically the 82 rmgen commits starting rP20115, rP20301.
Uses vector algebra, refs #4845.
Removes many Math proxy calls, refs #4933.
Removes 35 unused elevation and 24 unused cliffRadius variables, demonstrating the copy&paste antipattern.
Reduce iberian-wall hardcoding to one line, refs #4940.

comment:3 by FeXoR, 5 years ago

While having a "start with walls" attribure in the templates can prevent the hardcoding of the Iberian walls in random maps that likely won't be very suitable for mods as I expect other civilizations to require different shapes. So there also would need to be a "shape" property needed.

If skirmish maps could use the random map code they could place such walls (and if random maps where generated ingame e.g. via trigger or simulations at the first turn skirmish maps could do that).

Note: See TracTickets for help on using tickets.