Commit Graph

30276 Commits

Author SHA1 Message Date
JovialFeline
052c74e2d7 Add Lua documentation details 2025-02-08 14:02:12 +02:00
Ashley Newson
611ac8ce54 Add fuzzer for map generator testing
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.
2025-02-06 14:23:01 +02:00
Ashley Newson
c6d5a1a182 Yield focus for map generator text settings
Makes any selected text-based map generator settings (currently just the
seed input) yield keyboard focus when the user presses escape or enter.
2025-02-06 14:06:04 +02:00
Gustas
09259be796 Match the check inside .CenterPosition 2025-02-01 20:31:07 +00:00
Gustas
409efe7f4a Allow tileset to be entered in lower case 2025-02-01 20:22:43 +00:00
Gustas
0ea4bb10a1 Fix utility commands losing data 2025-02-01 20:22:43 +00:00
Gustas
56109b0ca1 Fix bot harvesters crashing 2025-02-01 17:39:40 +02:00
Ashley Newson
1fda679b9f Refine map generator spawn placement rules
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.
2025-01-31 13:58:20 +02:00
JovialFeline
440987c0a4 Fix unrepairable desert bridge 2025-01-30 14:10:09 +02:00
Ashley Newson
cdbcfb9e20 Fix illegal ore rings popping up around spawns in generated maps
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.
2025-01-29 13:34:49 +02:00
Ashley Newson
19585ec7ac Fix overflow when calculating array quantile index
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
...
```
2025-01-28 22:10:52 +02:00
JovialFeline
ddfdfcfee3 D2k shellmap: Hide pickup indicators 2025-01-28 19:04:04 +02:00
JovialFeline
49fd39b4b6 Fix some campaign Fluent keys 2025-01-28 18:57:39 +02:00
JovialFeline
55787fb7b7 Restore StartGameNotification in missions 2025-01-28 16:23:23 +02:00
JovialFeline
6a8e5c7c83 Hide owner row for D2k special mission Outposts 2025-01-28 16:11:35 +02:00
Ashley Newson
037326024b Remove floating points from map generation
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).
2025-01-27 20:42:38 +02:00
Ashley Newson
04e9cef38e Fix bounding of circle drawing in CellLayerUtils
Previously, only the RectangularIsometric case was handled, despite
this currently only being used in Rectangular mode. Additionally,
the calculation was slightly off.
2025-01-27 14:17:47 +02:00
Ashley Newson
2126f3c5a2 Add CnC map generator support
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.
2025-01-20 12:55:36 +02:00
Gustas
bdc50899de Fix bleed documentation
GitHub runner as it runs an older version of Python
2025-01-18 12:24:16 +00:00
Dan Stoian
75d4fa2509 update AUTHORS 2025-01-18 13:34:26 +02:00
Ashley Newson
9d77ca2bf8 Generate more elaborate roads
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.
2025-01-18 13:32:56 +02:00
Pavel Penev
5f9e0ffd43 Update Python documentation script 2025-01-17 18:09:02 +02:00
Pavel Penev
dfa922de91 Pulled out shared code from documentation commands 2025-01-17 18:09:02 +02:00
Pavel Penev
c66f63805a Added types for Utility documentation output 2025-01-17 18:09:02 +02:00
Pavel Penev
f2e582ce83 Moved documentation utility commands to a folder 2025-01-17 18:09:02 +02:00
Dan Stoian
e903baf680 Implement auto-save 2025-01-17 18:01:20 +02:00
JovialFeline
94f2ce4f56 Fix ordos-04 to use internal bot names 2025-01-16 13:09:21 +02:00
Ashley Newson
dc4c596fa0 Fix an out-of-bounds CellLayer access in RaMapGenerator
Adds a bounds check for the water obstruction code, where a rotation
projection can be outside of the map area (on rotations other than
1, 2, or 4.)
2025-01-16 12:56:44 +02:00
Paul Chote
b9adbf8089 Only expose Facing for actors that define a facing. 2025-01-15 18:07:10 +02:00
Paul Chote
427e56d718 Only expose Location and CenterPosition for actors that occupy space. 2025-01-15 18:07:10 +02:00
JovialFeline
01819714a2 Correct nod-06c capture objective 2025-01-15 17:39:41 +02:00
RoosterDragon
aa121dcb2f Use covariant return types.
Use the covariant return type feature of C# 9 to allow method overrides to be more specific about their return type. By exposing this information, e.g. for Widget.Clone(), callers will have more information. This allows various casts to be removed as the information is now available within the type system.
2025-01-15 17:29:02 +02:00
Ashley Newson
9c568aba33 Fix map generator failures due to broken TilingPath edge extension
Coastlines and cliffs at the edge of a map should have been getting
extended beyond the map edge help them tile reliably. This was not
happening due to a conditional that accidentally got inverted during a
refactor.

Fixing the conditional makes beach and cliff tiling significantly more
reliable. (Note that there is no effect on road tiling.)
2025-01-15 17:23:41 +02:00
Pavel Penev
22d3b5e5a1 Added link to GH source code to documentation 2025-01-11 15:50:10 +02:00
Ashley Newson
04b61a20ea Fix tileset MiniYaml keys to be consistent with Ids
Makes the `Template@...` number consistent with the `Id: ...` (if any).

The keys are ignored by the engine, so this has no behavioral change.
2025-01-11 15:07:41 +02:00
Ashley Newson
417f787294 Add experimental RA procedural map generator
Add an experimental procedural map generator for the Red Alert mod,
along with supporting code that may assist in the development of map
generators for other mods.

Map generation may be accessed as a tool in the Map Editor. This change
does not presently introduce direct lobby options for generated maps.

Features:

- Terrain with land, water, beaches, cliffs, roads, debris, and trees.
- Placement of mpspawns, neutral buildings, and resources.
- Rotational and mirror symmetry options.
- Various configurable parameters with presets.
- Deterministic with configurable seed.
- Performant.
2025-01-09 16:47:10 +02:00
louxia
0536c58b78 Avoid units continuing to follow the unattackable targets 2025-01-08 21:45:44 +02:00
Paul Chote
711055a3bc Add filenames to Trait/Weapon/SpriteSequence docs metadata. 2025-01-07 19:21:29 +02:00
Gustas
0efbefc62a OpenRA FreeBSD release is no longer maintained 2025-01-07 18:07:13 +02:00
michaeldgg2
c7cc9a68fd Eradicate ☠ Mono ☠
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
2025-01-07 18:07:13 +02:00
Paul Chote
5450572e0a Allow maps to override the player viewport size. 2025-01-06 23:57:08 +02:00
Gustas
8b4478260e Raname GrantConditionOnDeployWithCharge to GrantChargedConditionOnToggle
Also allow deploying without cancelling current activity, and make saboteurs use it
2024-12-27 16:37:49 +02:00
Gustas
d9cfb2c278 Cancel movement in invalid states 2024-12-27 16:30:38 +02:00
Gustas
1904012604 Fix harvesters refusing to queue dock orders whenn empty 2024-12-27 16:30:38 +02:00
test1232156
2c221fdc68 Fix translation key
Co-Authored-By: Gustas <37534529+punkpun@users.noreply.github.com>
2024-12-21 19:30:22 +02:00
Pavel Penev
955bf96a84 Added descriptions to ContentInstallerFileSystemLoader 2024-12-21 16:01:21 +02:00
Pavel Penev
f210b39bbc Just some package definition reordering
Mostly superficial, but in case of file name collisions we want the mod-specific files to override the common ones.
2024-12-21 16:01:21 +02:00
Pavel Penev
59c0c908cc Added missing D2k packages 2024-12-21 16:01:21 +02:00
Pavel Penev
640aa6545b Fixed whitespace issues in mod.yaml files
An oversight from PR 21598.
2024-12-21 16:01:21 +02:00
Gustas
269542c4b0 Add delete hotkey 2024-12-20 23:56:56 +02:00