Inner types in MultiBrush segment definitions can usually be derived
automatically from the start and end types. This is especially
important for segments with different starts and ends, where the Inner
type could be either one (e.g. beach to watercliff changers). Inner
types are now only needed in two cases:
- The Inner type doesn't match either the start or end. For example,
road diagonals.
- The Inner type should only match one of the start or the end. For
example, cliffs which end into clear tiles.
This commit cleans up the unneeded or unwanted Inner type definitions
in the base mods.
This fixes incorrect check in AllowResourceAt(), which previously looked at terrain type of the given cell *before* resource was created. Hence the check did not work as expected.
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);