Target.Invalid acts like a NaN, and will not compare equal with itself. Compare against the TargetType instead, which performs the intended comparison.
Allows the random map generator to optionally place civilian buildings
around the map for extra decoration. Buildings are placed last with
lowest priority to avoid competing for play area and resources.
Depends on #21738
This is similar to #21727, but in CellLayerUtils instead of MatrixUtils.
Note that the lack of long does not result in any overflows/crashes in
existing code, but can cause crashes for new features requiring larger
calculations.
Adds a fuzzer that iterates through map generation settings combinations
to either discover crashes or measure the frequency of rejected maps.
All generated maps are in-memory only and discarded immediately after
generation.
Running the fuzzer on anything other than a small combination of
settings is time expensive. It is added only as a utility for manual
invocation and is not integrated into the regular set of tests.
Spawn generation generally tries to place spawns:
- In spacious areas
- Away from the center (true center or mirror lines)
- Away from a symmetry-projected spawn
- Away from previously placed spawns
This commit introduces the following adjustments:
- The spacing between sequentially placed spawns is relaxed.
- Fix spawn mines contributing too much to the space reservation.
- Factor rotations into anti-center biasing calculation.
- Preserve spacing information in center space fallback decisions.
- Use a linear (instead of binary) falloff for anti-center biasing.
- Enforce that spawns have a minimum buildable area around them.
- Enforce that symmetry-projected spawns have as much separation as
sequentially placed spawns would.
- Allow spawns on or near roads.
Reorders and groups selective clearing of the resource placement plan to
-int.MaxValue to avoid subsequent code from inappropriately trying to
use it in arithmetic, which may just underflow to some completely wrong
value and lead to resources in illegal places.
Fixes a crash which happens when trying to generate very large maps,
such as 256x256.
```
Exception of type `System.IndexOutOfRangeException`: Index was outside the bounds of the array.
at OpenRA.Mods.Common.MapGenerator.MatrixUtils.CalibrateQuantileInPlace(Matrix`1 matrix, Int32 target, Int32 count, Int32 outOf) in /home/ashley/devel/OpenRA/OpenRA.Mods.Common/MapGenerator/MatrixUtils.cs:line 719
at OpenRA.Mods.Common.Traits.RaMapGenerator.Generate(Map map, MiniYaml settings) in /home/ashley/devel/OpenRA/OpenRA.Mods.Common/Traits/World/RaMapGenerator.cs:line 755
...
```
Removes all use of floating point from the RaMapGenerator map generator
and its dependencies.
Floating point behavior is potentially non-portable across client
hardware. Removing them should make the map generation logic
consistent even across clients with different floating point hardware
or compiler behavior. This may be useful for sync-safe multiplayer map
generation where clients independently generate the map from settings.
Most previously fractional public-facing settings are now represented
as numbers out of 1000, with some exceptions using 1000000. Most
internal logic which relies on fixed-point concepts now uses 1024ths,
though some floating point mechanisms have been replaced with
alternative discrete approximations (e.g. gaussian to binomial).
Previously, only the RectangularIsometric case was handled, despite
this currently only being used in Rectangular mode. Additionally,
the calculation was slightly off.
Adds map generator support for CnC (all tilesets), largely on par with
RA.
Most tilesets do not have a complete set of beach templates and
therefore do not support terrain settings involving water. DESERT is the
only tileset supporting water. Unlike in RA, water is not playable space
in CnC (no naval units), so only terrain settings with small bodies of
water are available.
Most changes are configuration (tileset and map generator config), with
just a small number of code changes.
Updates the random map generator to produce more elaborate roads:
- Roads extend beyond map bounds.
- Shorter, unviable roads are pruned and merged to create longer roads.
- Roads can loop.