Commit Graph

6996 Commits

Author SHA1 Message Date
hacker
7c44f94755 Log chat messages on the server 2026-07-20 20:22:41 +01:00
Gustas
5c51f458f2 Silence autosave audio notification 2026-02-22 17:17:59 +00:00
Gustas
413aa00ce6 Don't play chat sounds when loading games 2026-02-22 17:17:59 +00:00
Gustas
0a9b493c14 Moved game save notification to StartGameNotification 2026-02-22 17:17:59 +00:00
Vapre
0a933ba09c CellLayer, use span. 2026-02-17 18:16:49 +02:00
atlimit8
2516c5a798 Collect and show perf sample totals in widget
Both the rolling and cumulative active (not paused) means are shown.
2026-02-15 22:20:04 +02:00
Paul Chote
6743904372 Fix custom map loading from relative Engine.SupportDir paths. 2026-01-19 17:38:56 +02:00
Paul Chote
85e16032c2 Add Server.EnableMapGeneration setting. 2026-01-19 15:56:08 +02:00
Paul Chote
924c79b0ad Persist generated map across skirmish settings. 2026-01-19 15:56:08 +02:00
Paul Chote
ed1ebd536b Remove requirement for server to explicitly generate maps. 2026-01-19 15:56:08 +02:00
Gustas
ea07cb2cb1 Rewrite PNG parsing for minimal allocations 2026-01-19 15:26:21 +02:00
Gustas
bea698b2f1 Don't parse UTF 2026-01-19 15:26:21 +02:00
Gustas
9528f19845 Move to faster ZLibStream 2026-01-19 15:26:21 +02:00
Gustas
d0ca1af555 Use OpenRA CRC32 2026-01-19 15:26:21 +02:00
Dominic Renaud
f8eefe310c Add input style to match other, non-C&C, RTS games
Uses left-click for targeted orders (attack move, guard, selecting movement types from the command bar, etc.) and right-click for contextual ones. Works like basically all non-C&C games

Removed GameSettings.UseClassicMouseStyle, as it is replaced by MouseControlStyle


Changed Minelayer and Chronotank teleport to UnitOrderGenerator

Fixes bug with Modern controls issuing a move order cancelling a mine field order

Better organizes all unit orders into a single order generator base class, rather than having their logic spread across multiple base classes, which required some hacks to get the control logic to match
2026-01-04 12:35:35 +00:00
Gustas
638c0d7db1 Fix menu effects ignoring annotations 2025-12-30 22:57:55 +00:00
Paul Chote
f173b6f604 Account for fractional offsets in world-px to view-px conversion. 2025-12-29 20:57:16 +02:00
Gustas
c07af73eae Fix viewport zoom repositioning ignoring map bounds 2025-12-29 17:57:39 +00:00
Paul Chote
c7e67529b5 Expose SDL_OpenURL to mod code. 2025-12-29 15:13:56 +02:00
Paul Chote
de952e6caf Provide the manifest to IFileSystemLoader.Mount. 2025-12-29 15:13:56 +02:00
Paul Chote
fdb4ce4e0f Save map generation args in replays/saves instead of full map. 2025-12-28 16:19:14 +02:00
RoosterDragon
827f4682a5 ActorReference takes MiniYaml as input instead of a Dict.
As the InitDict is lazy, this removes the possibility for a mutable collection to be used but the values not to be consumed until later, which would be confusing. As all existing callers actually create a throw-away dictionary from MiniYaml, this is an easy switch.
2025-12-28 14:12:02 +02:00
RoosterDragon
a546ca2f92 Tweaks for map generator performance.
The map generator is already performant, but we can remove a few rough edges from infrastructure it interacts with.

- Add TypeDictionary constructor to clone from an existing copy. The map editor infrastructure relies heavily on cloning ActorReferences and the underlying dictionaries. A dedicated clone method avoids reflection overhead for CreateTypeContainer on a fresh instance.
- Use ThrowIndexOutOfRangeException helper. This allows the Index method to be inlined.
- Reuse lists in FloodFill. This avoids allocating and resizing new lists on each loop when we can reuse the existing capacity.
- Manage CellEntryChanged at the layer rather than individual previews. We only need to attach/detach from the delegate once at the layer, rather than many times as previews are added and removed.
2025-12-28 14:12:02 +02:00
Paul Chote
bca1dd599d Remove remaining non-fluent server->client messages. 2025-12-22 23:05:07 +00:00
Pavel Penev
d4fd66adf9 Renamed SyncAttribute to VerifySyncAttribute 2025-12-22 19:09:53 +02:00
Paul Chote
ec75dcd9e9 Standardize and simplify settings menu settings access. 2025-12-22 15:28:09 +02:00
Paul Chote
7e9d87a808 Move auto-saving settings to mod code. 2025-12-22 15:28:09 +02:00
Paul Chote
98f7fe0db7 Remove special-case hotkey parsing. 2025-12-22 15:28:09 +02:00
Paul Chote
575f6624a2 Implement modular settings backend. 2025-12-22 15:28:09 +02:00
Paul Chote
962e7e911d Replace MouseButtonPreference with MouseActionType. 2025-12-22 10:34:40 +02:00
RoosterDragon
06e4a2e010 Reduce allocations in main game loop.
Target a couple of hot paths:
- In Actor, cache the renderables enumerable by tracking the last used WorldRenderer. It's slightly uncouth but in practise the WorldRenderer will be the same for the lifetime of the Actor and outlive it anyway.
- In RenderSprites, cache the renderables enumerable. If we refresh the palettes directly, we don't need the WorldRenderer for anything else so can return a cached enumerable. This could result in iterating the animation list twice, so use a flag to only do it when required, which is rare.
- In AutoTarget, the compiler has an unfortunate behaviour where it allocates the helper class for a capturing lambda at the top of the loop, but it's on a rare path and so this allocation is usually unused. We can discourage the compiler from allocating until it's actually needed by wrapping the call in a local function.
2025-12-20 15:13:15 +02:00
RoosterDragon
bcfaa44d66 Amortize allocations when sorting renderables.
Using OrderBy provides a stable sort, but internally allocates a buffer every time for storing the sort keys. We'd like to avoid this allocation, but we also can't directly use Array.Sort/Span.Sort as these are unstable sorts.

By calculating sort keys with the item index embedded, we can ensure a stable sorting result whilst being able to reuse the buffer for the sort keys across future calls.
2025-12-15 19:33:19 +02:00
Paul Chote
31607bd0cf Stop passing around partially constructed ModData instances. 2025-12-12 12:32:10 +02:00
Paul Chote
2b6977d53f Remove legacy SpriteSequenceLoader metadata plumbing. 2025-12-12 12:32:10 +02:00
Paul Chote
a04cfaec78 Move GlobalModData state to ModData. 2025-12-12 12:32:10 +02:00
Paul Chote
13313b4270 Finish removing GraphicSettings.SheetSize/BatchSize. 2025-12-12 12:32:10 +02:00
Paul Chote
7175e9062d Initialize mod using its manifest. 2025-12-12 12:32:10 +02:00
Paul Chote
94177848a8 Remove CursorProvider. 2025-12-12 12:32:10 +02:00
RoosterDragon
9e548fd0f0 Freeze non-mutable readonly static dictionaries.
Since these will live for the lifetime of the process, it is worth freezing them on creation to improve lookup performance. If the dictionaries were iterated, change to an immutable array instead to preserve the order.
2025-12-12 09:51:27 +02:00
RoosterDragon
649e7e8c28 Change classes that use FieldLoader to use read-only collections. 2025-12-08 17:39:28 +00:00
RoosterDragon
797c71e500 Add FieldLoader/Saver support for ImmutableArray, FrozenSet, FrozenDictionary.
As config is often meant to be loaded and then never modified, it is helpful to support collections that are read-only after creation. This allows various classes that load config from YAML and elsewhere to deserialize straight into read-only collections and enforce invariants around data mutation.
2025-12-08 17:39:28 +00:00
RoosterDragon
8b8651dcf7 Improve audio parsing performance.
- Improve the AudReader and WavReader by performing fewer, larger stream reads to consume bytes more efficiently.
- Improve ImaAdpcmReader.LoadImaAdpcmSound by accepting an output buffer rather than allocating a new array.
- Improve StreamExts.ReadAllBytes by using MemoryStream.CopyTo. This internally rents a much larger buffer from the array pool, allowing for fewer, larger stream reads.
2025-12-03 12:35:42 +02:00
Gustas
bd53aa734e Handle comments when merging yaml 2025-11-24 11:52:56 +02:00
RoosterDragon
e652f95be9 Remove Exts.Enum<T>
This functionality is now built in. We can rely on the built in functions rather than a custom class.
2025-11-23 13:34:31 +02:00
RoosterDragon
bc1a901f54 Add tests for FieldLoader and FieldSaver
Test coverage for these classes will help prevent regressions. Major breaking changes are avoided since config files may already rely on various aspects of the behaviour, but some small breaking changes are made:

- Use `value.Split(Comma, StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries)` consistently for all comma-separated parsing.
- Rename LoadField to LoadFieldOrProperty for clarity - since this is the one method that cares about properties in a class otherwise focused only on fields.
- Use TryParse instead of Parse and ensure to call InvalidValueAction from all parsers so we throw the intended exception when badly formatted data is encountered.
- BooleanExpression/IntegerExpression exception message updated to align with the generic one.
- Remove FromYamlKey, and update the only user SkirmishLogic to perform this logic manually instead.
- Remove unused includePrivateByDefault parameter on GetTypeLoadInfo.
- Remove unused AllowEmptyEntriesAttribute.
2025-11-16 20:52:54 +02:00
RoosterDragon
af326bfeb8 Fix IDE0031 2025-11-16 20:29:21 +02:00
RoosterDragon
3745377387 Fix IDE00007 2025-11-16 20:29:21 +02:00
Gustas
a62b085f1d Add a name to the server thread 2025-11-04 21:43:18 +02:00
Gustas
a514f3a388 Make map grid immutable 2025-11-04 21:41:31 +02:00
Vapre
d08d03274b Avoid occasional 'busy wait' for next render time in main loop. #18491 2025-10-15 16:49:00 +03:00