Adds a random map generator tailored for the Dune 2000 mod,
D2kMapGenerator.
This map generator has some limitations compared to the RA/CnC
map generator (ExperimentalMapGenerator):
- Symmetry is far less accurate for non-trivial rotations.
- No circular map shapes.
- Unplayable regions are not obstructed and no symmetry corrections
are applied. This is partly due to mod limitations (e.g., no
decorative actors), but I've also considered it less important.
- Somewhat higher map generation failure rates, due to more extreme
play-space requirements.
In order to support the map generator, some additional features are
added to common map generation utilties:
- A "FromTemplates" MultiBrush collection shorthand.
- Path partitioning logic in Terraformer, use to split paths into
multiple TilingPaths with different segment types.
In early iterations of the lobby map generation logic, a for loop was
used to retry map generation with alternative seeds in case it
failed. This seed randomization logic didn't exist in the final merged
version, but the for loop wasn't cleanup up, and ends up repeating any
map generation failures 5 times deterministically.
Additionally, the logic caught Exception instead of the more specific
MapGenerationException, which is the only exception that is expected
to arise in healthy builds/configurations (due to bad luck rather than
bugs).
This change:
- removes the for loop;
- only catches MapGenerationException;
- adjusts the user-visible failure message to reflect that trying
again (without adjusting settings) is a valid course of action (now
that it's not done internally);
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.
Updated the Chinook Transport helicopter's description to correct the spelling of "detachment".
Corrected the description of the mutated lifeform by changing "expose" to "exposed" for grammatical accuracy.
- OG fly path and Frigate behaviour
- BulkProductionQueue
- ProductionStarport trait
- OG palette widget behavior for Bulk queue
- Purchase button for each BulkProduction
- Delivery timer for each BulkProduction
TilingPath had some bugs when working with single-point segments,
which exist outside of the official mods. This change fixes a few
problems:
- Avoid unbounded length zero-cost, zero-progression loops that could
be formed by an arbitrary number of single-point corners. These
could pop up arbitrarily in the middle of paths.
- Avoid zero-progression loops short-circuiting looped paths.
- Fix missing end type matching during back-tracing stage.
- Enhance lint check to ensure starts/ends have a valid directions.
- Remove some dead code.
Allows biasing path tiling towards or away from using certain
MultiBrushes using their existing weight property. Note that the
probability of brush selection depends on multiple factors, not just
their direct weight.
If the path being planned by the Path Tiling tool overlaps itself such
that a later rally intersects an earlier line, attempting to interact
with this later rally caused the UI to instead select the rally
associated with the earlier line. This at best leads to user confusion
and at worst leads to a crash if they then drag the rally over another
rally.
This commit fixes the UI logic to correctly identify the rally being
clicked on.
I'd accidentally copy-pasted the wrong item template in the original
TilingPathToolLogic implementation. This change uses the normal
tooltipless LABEL_DROPDOWN_TEMPLATE.
AI likes to make a naval building in the top right tiny water area.
This PR adds 2 rocks to that area blocking any building so the AI
is not going to waste time on it.
EditorBlit was incorrectly using CellRegion.Contains instead of
CellRegion.CellCoords.Contains (i.e. CellCoordsRegion.Contains). This
resulted in a crash upon attempting to paste within the editor for
RectangularIsometric maps (such as in TS).
This change updates the code to use the correct region type and fixes
the crash.