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.
Resource placement is usually biased by mpspawns or resources spawns
(mines or blossom trees), which feed into a mutilplier for the
resource noise. Previously, all cells outside of the circle of
influence of a bias source got a multiplier of zero, essentially
giving them no noise pattern. This could lead to ugly horizontal
streaks of resources for which the layout was determined only by the
internals of PriorityArray.
This change fixes this by ensuring the noise multiplier has a
baseline value of 1.
TilingPath's algorithms are designed on the assumption that MultiBrush
segments use unit steps in their point sequences. Non-unit
sequences can result in incorrect or suboptimal tilings.
This change ensures point sequences are validated for unit steps, and
fixes a non-compliant cliff tile across all tilesets.
- Converts OpenRA.Mods.Common/MapGenerator/Direction.cs over to using
Direction and DirectionMask enums
- Moves direction-related utilities into Exts classes.
- Simplifies some direction utility logic.
Only very small numerical precision behavioral changes.
Allows PickAny templates to be used in MultiBrushes, which can be
painted with random selection. This avoids the need to define various
separate MultiBrushes for each tile combination.
Note that all combinations count as part of a single MultiBrush, which
may influence selection weighting.
This MultiBrush feature is not presently used in OpenRA's official
mods, but is useful for unofficial mods using more general PickAny
templates.
Adds MultiBrush definitions for River (RA and CnC) and WaterCliff (RA
only), allowing them to be tiled with the Path Tiling tool.
A small enhancement to the MultiBrush and TilingPathTool code is added
to allow the inner type to be derived from start and end types. This
allows segments that interface between types (such as WaterCliff to
Beach) to be usable when tiling either WaterCliffs or Beach. Whilst
this makes the inner types of many of the existing MultiBrushes
redundant, no simplification is performed as part of this change.
Generated maps are created at runtime using a
mod-defined trait. They are embedded directly
into replays and save games as they exist in
memory only, and disappear after the game exits.
Exposes the TilingPath code used by the map generator as a map editor
tool to help automate the process of tiling sequences of templates
together.
No additional template stitching definitions are added as part of this
commit. As such, the tool currently only supports the same auto tiling
as the map generator does. This includes:
- RA and CnC support.
- Beaches, land cliffs, and roads.
Support for additional mods and templates can be added in follow-ups
by adding the necessary MultiBrush definitions.
Related changes included in this commit to support this work include:
- Add support for sparse EditorBlits.
- Add support for MultiBrush to EditorBlitSource conversion.
- Add support for EditorBlitSource previewing.
- Adjust the "Road" types used in segmented MultiBrush definitions.
The default path weight of 125% allows paths up to 25% longer than the optimal path to be returned, which improves the performance of path searches.
Over short distances, players are likely to be sensitive to suboptimal paths this can produce, so instead use a weight of 100% over short distances to ensure these paths are optimal. As the search area is limited, the additional performance impact is also capped. The hierarchical path finder already has a speculative check for short paths within a 20 cell area (twice the grid size of 10 cells), which allows it to skip a hierarchical search if a path within that area can be found. We can piggy back on this short path logic and use a weight of 100%.
Over longer distances, players are less likely to notice the suboptimal paths, and the performance benefit is more noticeable, so continue to use the 125% weight in these scenarios.
The editor's resource value calculation logic was fixed in #21820 to
match actual gameplay. The map generator logic originally copied the
editor logic from EditorResourceLayer rather than ResourceLayer and
associated game logic. As such, it inherited incorrect calculations.
This change updates the map generator logic to match the now
consistent logic in both ResourceLayer classes. Map generator resource
settings are also adjusted -25% to continue roughly matching the
previous resource output.