Refactor ExperimentalMapGenerator into reusable methods

This change lifts large portions of ExperimentalMapGenerator's logic
into a new "Terraformer" class with highly documented methods that can
theoretically be used by alternative map generator classes. Some
additional refactoring may occur in future, subject to the practical
needs of additional map generators. ClearMapGenerator is also
simplified.

This is not a pure refactor and contains some algorithmic and
behavioral changes, as well as few minor bug fixes. Notably:

- The logic for obstructing unreachable water has been somewhat
  replaced.

- In CnC, where water is already unplayable, EMG no longer obstructs
  water. (RA still does, as water is playable there.)

- Mountain (cliff) generation is now somewhat more effective. This
  increases the number of cliffs seen on many presets. Settings should
  no longer use "Mountains: 1000".

- PlayableSpace logic has been consolidated into Terraformer.

- PlayableSpace.Playability no longer exists as PartiallyPlayable
  became redundant. Its uses have been replaced with a simple
  boolean. Consequently, some defunct code and configuration has been
  removed.

- Adjust MultiBrush replaceability contract painting behavior to be
  more intuitive.

- Fix off-by-one error in map bounds computation.

- Fix some usages of mixed up MersenneTwisters.
This commit is contained in:
Ashley Newson
2025-06-26 22:41:58 +01:00
committed by Gustas Kažukauskas
parent e4f289921c
commit 25571df2b6
12 changed files with 2534 additions and 1480 deletions

View File

@@ -23,7 +23,7 @@
MaximumAltitude: 8
RoughnessRadius: 5
Roughness: 500
MinimumTerrainContourSpacing: 6
MinimumTerrainContourSpacing: 5
MinimumCliffLength: 10
ForestClumpiness: 1
DenyWalledAreas: True
@@ -60,11 +60,8 @@
splitblue: BlueTiberium
ClearTerrain: Clear
PlayableTerrain: Beach,BlueTiberium,Bridge,Clear,Road,Rough,Tiberium,Wall
PartiallyPlayableTerrain: River,Tree,Water
UnplayableTerrain: Rock
DominantTerrain: River,Rock,Tree,Water
ZoneableTerrain: Clear,Road
PartiallyPlayableCategories: Beach,Road
ClearSegmentTypes: Clear
BeachSegmentTypes: Beach
CliffSegmentTypes: Cliff
@@ -158,16 +155,14 @@
Label: label-cnc-map-generator-choice-terrain-type-mountains
Settings:
Water: 0
Mountains: 1000
Mountains: 900
Roughness: 600
MinimumTerrainContourSpacing: 5
Choice@MountainLakes:
Label: label-cnc-map-generator-choice-terrain-type-mountain-lakes
Settings:
Water: 200
Mountains: 1000
Mountains: 900
Roughness: 850
MinimumTerrainContourSpacing: 5
MultiChoiceOption@Shape:
Label: label-cnc-map-generator-option-shape
Default: Square