Opened 6 years ago

Last modified 5 years ago

#4947 new defect

Converge rmgen1 and rmgen2

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


Follow up to comment:3:ticket:4804.

rmgen2 should probably have the globals removed, especially g_TileClasses and each map should specify the used tileclasses, even if there are some very common definitions IMO. This way the library functions don't have any state but their output solely depends on the passed arguments, making it easier to understand their results (for instance which properties of g_TileClasses are unused by a map). This means rmgen2 becomes a bit more similar to rmgen1.

Equally rmgen2 functions, especiallyaddElements could be used by rmgen1 maps.

After that rmgen2, rmgen/gaia_entities.js, rmgen/gaia_terrain.js, rmgen/player.js and rmgen/wall_builder.js might form a new library (Layer 3 in the ticket comment), whereas the remaining rmgen prototypes (Painters, Placers, Constraint, Map, ...) would become the Layer 2 of the rmgen stack.

This way mods can create random map scripts that reuse reuse the basic map creation tools without importing a dictionary of ancient history rts terms.

Change History (3)

comment:1 by elexis, 6 years ago

In 21206:

Move the randomPlayerLocations rmgen2/ function to rmgen/, so that one can use it without importing rmgen2, refs #4947, Belgian Uplands rP21171, Islets D1277.

Delete rmgen2 placeRadial which is equal to playerPlacementCircle from rP20149, refs #4805.
Remove createBase calls from rmgen2 player playerbase location functions, so that they can be called without placing the bases.
Let them return the same data that rmgen/ functions return, refs #4947.
Delete placeRandom as it remains empty.
Rename sortPlayersByLocation to groupPlayersCycle, groupPlayersByLocations to groupPlayersByArea,
randomPlayerLocations to playerPlacementRandom and addBases to createBasesByPattern.

comment:2 by elexis, 6 years ago

In 21300:

Ambush bluffs rework.
Remove ugly large circle patterns around the playerbase on Ambush, fixes #4993.
To ensure passability, create ramps from the playerbase to the bluffs.

Change the circular player avoidance to a ChainPlacer generating more heterogenous pattern.
Use vectors in rmgen2 bluffs creation and simplify equations, refs #4992.
Don't turn inaccessible bluffs to plateaus but don't place them until it is certain they are passable.

Increase minimum distance from the playerbase to the mapcenter by picking different distance values per playerbase pattern in g_PlayerbaseTypes.
Attempt to improve bluffs performance by avoiding bluffIgnore by 0 instead of bluff by 12, refs #5011.
Implement AdjacentToAreaConstraint and deleteTerrainEntity.
Delete createBoundingBox and use getBoundingBox, refs #4947, #4805.
Delete fadeToGround and nextToFeature and use conventional createArea calls with the SmoothingPainter of rP21175, refs #5027.
Paint bluff cliffs slightly more accurately using the SlopeConstraint from rP21085, refs #5004.

comment:3 by FeXoR, 5 years ago

Converging functionality and hopefully getting rid of some functions that do very similar things sounds great.

However, where's the defect?

Also organizing everything in layers makes everything less modular in the sense that you can import a set of libs because layers depend on each other. Maybe I misunderstand that "layer" thingy?

Note: See TracTickets for help on using tickets.