Commit Graph

30654 Commits

Author SHA1 Message Date
Pavel Penev
70624fa44f Stopped syncing IsTraitPaused/Disabled
A discussion on Discord (https://discord.com/channels/153649279762694144/388282819371204608/1181890238759587881) decided we don't need to sync these.
2025-12-22 09:28:07 +02:00
michaeldgg2
06e3e013be ActorIndex: make constructor protected to allow defining custom actor indexes 2025-12-21 14:21:42 +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
Matthias Mailänder
1539741e71 Don't run the CI build when only Python scripts are edited. 2025-12-15 19:14:12 +02:00
Matthias Mailänder
3ad38ba503 Shorten trait requirement prefix. 2025-12-15 19:14:12 +02:00
dependabot[bot]
7cef83c51c Bump actions/upload-artifact from 5 to 6
Bumps [actions/upload-artifact](https://github.com/actions/upload-artifact) from 5 to 6.
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](https://github.com/actions/upload-artifact/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/upload-artifact
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-12-15 14:40:21 +01:00
Gustas
493cf3f1eb Update TD map pool 2025-12-12 23:05:10 +00:00
Paul Chote
3c7389f582 Implement InstallShieldPackage.OpenPackage. 2025-12-12 12:39:21 +02:00
Paul Chote
374166e9d3 Add a minimal iso9660 package reader. 2025-12-12 12:39:21 +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
Gustas
f4eb5739d6 Fix PauseShellmap not pausing 2025-12-10 21:42:34 +00:00
Paul Chote
637d8689f5 Fix invalid cast. 2025-12-08 21:37:57 +02:00
Gustas
a3ee6645c1 Fix units being picked up when they no longer want it 2025-12-08 18:04:01 +00: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
Gustas
e53f2b6044 Fix templete palette overwrites not working 2025-12-08 17:32:05 +00:00
Gustas
2b2e2d6fe3 Fix itch integration ruining commander's name 2025-12-06 14:05:09 +02:00
Gustas
027e38ee69 Handle race conditions and manage package ownership 2025-12-05 18:17:15 +02:00
Gustas
9e926b0f53 Fix large dropdowns overlapping 2025-12-05 18:17:15 +02:00
Gustas
f9bce6252c Don't generate maps when not needed 2025-12-05 18:17:15 +02:00
Gustas
dd1528bd4a No need for virtualization 2025-12-05 18:17:15 +02:00
Paul Chote
79567f3f8a Move content mod switching to IFileSystemExternalContent interface. 2025-12-04 14:01:46 +02: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
b429ca7879 Don't paste when empty 2025-12-02 22:05:38 +02:00
Gustas
1ad1d18abf Don't copy tiles when empty 2025-12-02 22:05:38 +02:00
Gustas
93602c7c95 Make copy paste message more accurate 2025-12-02 22:05:38 +02:00
dnqbob
62e692063a Add NewProductionChance so bot won't only build production when too much cash 2025-12-01 14:55:22 +02:00
Ashley Newson
9478548bdb Allow empty MultiBrush with Replaceability.Any
Painting a MultiBrush previously required it to be non-empty. When
using Replaceability.Any, this is unlikely to be the desire behavior,
as some utilities (such as the upcoming LatTiler and RampTiler) may
reasonably generate an empty MultiBrush as output.

This changes painting MultiBrushes using Replaceability.Any to be
effectively no-ops. The .Tile and .Actor cases still use checks, as
these still plausibly represent mistakes.
2025-12-01 14:07:28 +02:00
dnqbob
8dc75eec34 Allow bot repairs all buildings. 2025-12-01 14:00:02 +02:00
dnqbob
3e7e4df2ed Bot's GetNearbyIndicesThreat: fix the wrong parameter passing 2025-12-01 11:52:32 +02:00
Gustas
7e8f4a3479 Truncate less of the player name, adda tooltip 2025-11-24 17:43:12 +02:00
Gustas
86a4fb1d6f Fix illegal resources being placed by pasting 2025-11-24 17:41:06 +02:00
Gustas
5ff7c9f269 Fix scaling issues 2025-11-24 12:33:53 +02:00
Gustas
b340c42ab1 We get get sprites earlier 2025-11-24 12:33:53 +02:00
Gustas
ec7461f09f Remove redundant fields 2025-11-24 12:33:53 +02:00
RoosterDragon
ba632fbf8b Revert "In RemoveCellsFromPlayerShroud, don't call RemoveSource unless required."
This reverts commit 86b9227577.

This commit relied on the relationship not changing, but when a player is defeated their relationship can change due to becoming a spectator. This can cause a crash if the shroud is not removed. Revert the commit to resolve this crash.
2025-11-24 12:14:53 +02:00
Gustas
89a4823a83 Add a lint test for running update rules 2025-11-24 11:52:56 +02:00
Gustas
bd53aa734e Handle comments when merging yaml 2025-11-24 11:52:56 +02:00
Ashley Newson
cde5208c54 Add basic Path Tiling for TS
This introduces basic Path Tiler map editor tool functionality to TS
with some segmented MultiBrush definitions. The included MultiBrush
definitions cover both the Temperate and Snow tilesets's Beach, Cliff,
and WaterCliff tiles.

MultiBrush now incorporates Height and Ramp information. Some
associated Terraformer utilities are updated with the API surface
change.

There are some known limitations that are not addressed in this PR:
- The path laying UI doesn't account for the map's current heights.
- The preview does not use a correct height or Z-ordering.
2025-11-23 14:31:31 +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
Ashley Newson
00cd438190 Create coordinate system conversion wrapper around Mirror
The Symmetry.Mirror enum was previously documented as defined in terms
of the WPos system, which happens to align with CPos for Rectangular
grid types. However, the existing code gets confused when attempting
to support RectangularIsometric, due to a lack of appropriate
conversion logic.

This change makes Mirror agnostic to specific coordinate systems and
introduces a WMirror wrapper that provides getters for the correct
Mirror configuration given the coordinate system being used.
2025-11-23 13:25:49 +02:00
Ashley Newson
91ddfd6fc1 Fix various map generator bounds and size related issues
- If generating a RectangularIsometric map via lobby, make the height
  twice the width so that the map is approximately world-square.
- Use equal top and bottom cordons for RectangularIsometric maps.
- Change some map bounds checking.
- Check that actors are at least partially inside map.Contains before
  placing. (To avoid frozen actor crashes.)
- Fix editor generated map blitting for RectangularIsometric.
2025-11-23 13:16:29 +02:00
dependabot[bot]
915ad36ddc Bump actions/checkout from 5 to 6
Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v5...v6)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '6'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-11-21 15:03:29 +01:00