Commit Graph

7541 Commits

Author SHA1 Message Date
RoosterDragon
dc0f26a1cd Improve BotModule performance.
Several parts of bot module logic, often through the AIUtils helper class, will query or count over all actors in the world. This is not a fast operation and the AI tends to repeat it often.

Introduce some ActorIndex classes that can maintain an index of actors in the world that match a query based on a mix of actor name, owner or trait. These indexes introduce some overhead to maintain, but allow the queries or counts that bot modules needs to perform to be greatly sped up, as the index means there is a much smaller starting set of actors to consider. This is beneficial to the bot logic as the TraitDictionary index maintained by the world works only in terms of traits and doesn't allow the bot logic to perform a sufficiently selective lookup. This is because the bot logic is usually defined in terms of actor names rather than traits.
2024-03-12 16:14:29 +02:00
RoosterDragon
5f97e2de5a Make Color use uint for ARGB.
This is a more natural representation than int that allows removal of casts in many places that require uint. Additionally, we can change the internal representation from long to uint, making the Color struct smaller. Since arrays of colors are common, this can save on memory.
2024-03-09 21:10:02 +02:00
Wojciech Walaszek
7b82d85b27 Editor actor move 2024-03-03 14:27:35 +02:00
michaeldgg2
63247d2d11 ParallelProductionQueue: pause production, when all Production traits are paused 2024-02-25 11:52:25 +01:00
Gustas
d3c44de5d2 Fix force rally point not setting building as primary 2024-02-23 19:10:35 +01:00
michaeldgg2
3760b14235 Land activity: fix bug which causes crash in Aircraft.AddInflunce()
Fixes #21302
2024-02-19 10:56:31 +02:00
atlimit8
a054d2115d remove unused RenderSprite trait fields 2024-02-16 09:36:44 +02:00
michaeldgg2
9d29303142 Hovers: remove dependency on IMove trait 2024-02-13 11:30:35 -06:00
atlimit8
8fda46e241 Prevent reading not yet cached Actor.Crushable() in Crate ctor using HierarchicalPathFinder.ActorIsBlocking(Actor actor).
Only occurs if the crate might be blocked.
Test Mod: td
Test Map: Island Duel
Line:
			foreach (var crushable in actor.Crushables)

Stack trace:
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Pathfinder.HierarchicalPathFinder.ActorIsBlocking(OpenRA.Actor actor) Line 660 (OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs:660)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Pathfinder.HierarchicalPathFinder.RequireBlockingRefreshInCell(OpenRA.CPos cell) Line 607 (OpenRA.Mods.Common/Pathfinder/HierarchicalPathFinder.cs:607)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.ActorMap.AddInfluence(OpenRA.Actor self, OpenRA.Traits.IOccupySpace ios) Line 428 (OpenRA.Mods.Common/Traits/World/ActorMap.cs:428)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.Crate.SetLocation(OpenRA.Actor self, OpenRA.CPos cell) Line 224 (OpenRA.Mods.Common/Traits/Crates/Crate.cs:224)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.Crate.SetPosition(OpenRA.Actor self, OpenRA.CPos cell, OpenRA.Traits.SubCell subCell) Line 203 (OpenRA.Mods.Common/Traits/Crates/Crate.cs:203)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.Crate.Crate(OpenRA.ActorInitializer init, OpenRA.Mods.Common.Traits.CrateInfo info) Line 94 (OpenRA.Mods.Common/Traits/Crates/Crate.cs:94)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.CrateInfo.Create(OpenRA.ActorInitializer init) Line 33 (OpenRA.Mods.Common/Traits/Crates/Crate.cs:33)
OpenRA.Game.dll!OpenRA.Actor.Actor(OpenRA.World world, string name, OpenRA.Primitives.TypeDictionary initDict) Line 163 (OpenRA.Game/Actor.cs:163)
OpenRA.Game.dll!OpenRA.World.CreateActor(bool addToWorld, string name, OpenRA.Primitives.TypeDictionary initDict) Line 339 (OpenRA.Game/World.cs:339)
OpenRA.Game.dll!OpenRA.World.CreateActor(string name, OpenRA.Primitives.TypeDictionary initDict) Line 329 (OpenRA.Game/World.cs:329)
OpenRA.Mods.Common.dll!OpenRA.Mods.Common.Traits.CrateSpawner.SpawnCrate.AnonymousMethod__0(OpenRA.World w) Line 168 (OpenRA.Mods.Common/Traits/World/CrateSpawner.cs:168)
OpenRA.Game.dll!OpenRA.World.Tick() Line 464 (OpenRA.Game/World.cs:464)
OpenRA.Game.dll!OpenRA.Game.InnerLogicTick(OpenRA.Network.OrderManager orderManager) Line 634 (OpenRA.Game/Game.cs:634)
OpenRA.Game.dll!OpenRA.Game.LogicTick() Line 658 (OpenRA.Game/Game.cs:658)
OpenRA.Game.dll!OpenRA.Game.Loop() Line 830 (OpenRA.Game/Game.cs:830)
OpenRA.Game.dll!OpenRA.Game.Run() Line 883 (OpenRA.Game/Game.cs:883)
OpenRA.Game.dll!OpenRA.Game.InitializeAndRun(string[] args) Line 313 (OpenRA.Game/Game.cs:313)
OpenRA.dll!OpenRA.Launcher.Program.Main(string[] args) Line 26 (OpenRA.Launcher/Program.cs:26)
[External Code] (Unknown Source:0)
2024-02-09 16:30:05 +02:00
Gustas
1a4f366e4b Make notifyAttacks more consistent 2024-02-07 15:30:41 +01:00
Gustas
2d332d0a13 Fix pillbox not uncloaking upon firing 2024-02-07 15:30:41 +01:00
David Wilson
d630a6ef7d Fix editor area/actor deselection bugs 2024-02-07 15:30:23 +02:00
RoosterDragon
0c22499534 Fix NREs in DiscordService.
Handle the client being null. Previously, a service could be created with a null client. This would leads to NREs when invoking the static Update methods. Now we guard against a null client.
2024-02-07 15:18:55 +02:00
N.N
4e031a6ea5 Selection info into Area selection tab
Selection info into Area selection tab

add Resource counter and measure info into Area selection tab
2024-02-03 12:26:21 +02:00
LipkeGu
311d55ff45 Add [FieldLoader.Require] to TooltipInfoBase.Name 2024-02-03 12:17:58 +02:00
Vapre
64cdfcbeab Cache ICrushable traits in actor. 2024-01-31 13:29:58 +02:00
Gustas
6026d088c8 Use HashSets instead of .Distinct
And don't cast to array / list where unnecessary
2024-01-30 22:06:58 -06:00
David Wilson
2ced4abc24 Editor selection refactor pt1 2024-01-24 10:11:39 +02:00
RoosterDragon
b58c1ea5bc Provide names and pools when creating MiniYaml.
- Rename the filename parameter to name and make it mandatory. Review all callers and ensure a useful string is provided as input, to ensure sufficient context is included for logging and debugging. This can be a filename, url, or any arbitrary text so include whatever context seems reasonable.
- When several MiniYamls are created that have similar content, provide a shared string pool. This allows strings that are common between all the yaml to be shared, reducing long term memory usage. We also change the pool from a dictionary to a set. Originally a Dictionary had to be used so we could call TryGetValue to get a reference to the pooled string. Now that more recent versions of dotnet provide a TryGetValue on HashSet, we can use a set directly without the memory wasted by having to store both keys and values in a dictionary.
2024-01-21 12:39:10 +02:00
dnqbob
32121a38f4 Fix Hovers desync caused by changing 'WorldVisualOffset' in renderer. 2024-01-15 15:21:45 +02:00
RoosterDragon
2fde98a0d1 Fix uses of LabelWidget.Text and ButtonWidget.Text to use GetText instead.
The Text element of these widgets was changed from display text to a translation key as part of adding translation support. Functions interested in the display text need to invoke GetText instead. Lots of functions have not been updated, resulting in symptoms such as measuring the font size of the translation key rather than the display text and resizing a widget to the wrong size.

Update all callers to use GetText when getting or setting display text. This ensure their existing functionality that was intended to work in terms of the display text and not the translation key works as expected.
2024-01-15 15:16:58 +02:00
Wojciech Walaszek
00857df990 adds tilting on slopes to suitable actor previews 2024-01-09 14:56:30 +02:00
Gustas
1a037c06bf Fix smudges incorrectly generating on slopes 2024-01-08 18:22:41 +01:00
Wojciech Walaszek
680144b24f adds Hovers WorldVisualOffset to muzzle calculations 2024-01-06 13:06:08 +02:00
michaeldgg2
9a1823d805 Make UnitOrderGenerator more extensible by giving inherited classes access to some methods 2024-01-06 12:39:29 +02:00
reaperrr
1f10dafbea Add MaxSmokeOffsetDistance to SmudgeLayer 2024-01-06 12:31:17 +02:00
Wojciech Walaszek
da638a495c implements flashing on healing units 2023-12-31 14:06:40 +02:00
N.N
d83a871520 Add RemoveOrders into RejectOrders trait 2023-12-27 17:28:10 +02:00
dnqbob
ba951b6470 Add Translation to TooltipDescription 2023-12-15 18:20:00 +02:00
Paul Chote
6c56ea4c55 Introduce Renderer.WorldBufferSnapshot(). 2023-12-15 13:37:05 +02:00
N.N
aa5b193746 Exlude DamageTypes from HarvesterNotifier 2023-12-15 13:04:36 +02:00
abcdefg30
da507b2eed Add a lint check to ensure no actor names are conflicting with script names
Only scripted maps will have the need to use named actors, so we can
assume that there will be a Lua script used in maps with such actors.
2023-12-15 11:58:42 +02:00
dnqbob
264564d006 Allow WeatherOverlay fade in/out when enabled/disabled 2023-12-15 11:48:54 +02:00
Gustas
dd7441e0b4 Automate update rule. 2023-12-04 10:10:28 +02:00
Paul Chote
ad833a6fbb Add support for additional cloak styles and use native alpha in RA,D2k,TS. 2023-12-04 10:10:28 +02:00
Paul Chote
9f196f2693 Fix Cloak.UncloakSound not being used. 2023-12-04 10:10:28 +02:00
Gustas
d8100cb9f2 Simplify harvester's creation activity 2023-12-03 19:27:02 +00:00
Gustas
2733ed4b1c Fix war factory not opening its door properly 2023-12-03 19:27:02 +00:00
Gustas
018777472a Fix harvesters teleporting when produced
And allow to interrupt actor creation child activities
2023-12-03 19:27:02 +00:00
Gustas
20f6e01afe Fix crashing when transports are loaded via lua 2023-12-03 19:27:02 +00:00
Oliver Brakmann
3904576574 Draw border around capture area in ProximityCapturable 2023-12-03 17:14:47 +00:00
Oliver Brakmann
c4acd8b361 Add ability to draw a border around a set of adjacent cells. 2023-12-03 17:14:47 +00:00
Oliver Brakmann
8529512edb Add CellTrigger support to ProximityCapturable 2023-12-03 17:14:47 +00:00
Paul Chote
07ed6a889e Move ColorShift traits into the main repo. 2023-12-02 21:44:58 +02:00
Gustas
d67e0a4eef Allow harvester definitions to exist on non-mobile actors 2023-12-02 13:50:46 +01:00
Gustas
8e7fa26709 Add TransformsIntoDockClient 2023-12-02 13:50:46 +01:00
dnqbob
deacc7ad65 Fix InitialActor in Carryall not initialized correctly 2023-12-02 13:56:36 +02:00
N.N
bb1e830264 Add initial delay for ActorSpawnManager 2023-12-02 11:36:42 +02:00
abcdefg30
855568cab7 Fix a compiler warning in MapCommand.cs 2023-11-27 18:39:51 +02:00
RoosterDragon
6b0db6699d Merge RefreshMap and UnpackMap commands. Add regex filename filter.
This provides a single utility command for interacting with maps, that takes an arg for the map operation. The filename filter allows all maps in the mod to be operated on by default, or a regex can be passed to limit the operation to certain maps.
2023-11-25 16:45:05 +01:00