Commit Graph

3333 Commits

Author SHA1 Message Date
RoosterDragon
137d384304 Remove path caching.
The path cache was originally a moderate benefit, but over time a couple of things have conspired against it:

- Only paths with BlockedByActor.None are cached. Originally all paths regardless of blocking were cached but this was deemed unacceptable due to potentially returning outdated paths as actors move about. Paths with BlockedByActor.None are only invalidated if terrain conditions change, which are rarer.
- Move will try and find a path 4 times, trying with a different BlockedByActor check each time. BlockedByActor.None is the last check and only reached if the other searches fail. This is a rare scenario.

Overall, this means the hit rate for the cache is almost non-existent. Given the constraints on path validity it seems unlikely that the hit rate could be improved significantly, therefore it seems reasonable to remove the cache entirely to remove the overhead of cache management.
2021-11-29 01:03:14 +01:00
RoosterDragon
f0e24f6d21 Make knowledge of height discontinuities live in Locomotor not PathGraph. 2021-11-21 17:52:12 +01:00
RoosterDragon
290ed17c9d Adjust some naming and order of parameters in CellInfo
- Make Status the first field.
- Rename EstimatedTotal to EstimatedTotalCost to make it clearer it has the same unit as the CostSoFar field.
- Rename PreviousPos to PreviousNode as node terminology is a better match for usage.
2021-11-20 12:13:42 +01:00
Matthias Mailänder
98b25ddd5e Check for dead actors when searching for exits. 2021-11-18 20:52:05 +01:00
RoosterDragon
dd9d600ef9 Change GetCustomMovementLayers to expose an array, not a dictionary.
As there are few custom movement layers, using an array is good for improving lookup speed. Additionally, we can simplify some code by reserving index 0 of the array for the ground layer. Code that needs to maintain a state for the ground layer and every custom movement layer can now maintain a flat array of state using index 0 for the ground layer, and the the ICustomMovementLayer.Index for the custom movement layer. This removes a lot of ternary statements checking for the ground layer special case.
2021-11-13 12:15:48 +00:00
Matthias Mailänder
9b1cec7712 Add support for gapless looping music. 2021-11-11 23:49:54 +01:00
Gustas
c5a6577cee Fix production scalling 2021-11-05 00:01:21 +01:00
abc013
311b6fcd83 Don't count actors owned by noncombatant players to kills statistic 2021-10-29 21:07:06 +02:00
Oliver Brakmann
be4466115d Do not update countdown label unless there is a timelimit 2021-10-26 16:40:47 +02:00
abc013
0898655175 Fix radar preview not updating when editing actor owner 2021-10-24 22:54:10 +02:00
penev92
f056cbba13 Added a bunch of TraitLocationAttributes
Also moved a few traits to their proper subfolders.
2021-10-16 20:52:50 +02:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
RoosterDragon
df9398a871 Use named pathfinding constants.
- Rename CostForInvalidCell to PathCostForInvalidPath
- Add MovementCostForUnreachableCell
- Update usages of int.MaxValue and short.Maxvalue to use named constants where relevant.
- Update costs on ICustomMovementLayer to return short, for consistency with costs from Locomotor.
- Rename some methods to distinguish between path/movement cost.
2021-10-10 17:09:38 +02:00
Ivaylo Draganov
091d756c14 Change lobby options description to make sense in both disabled and enabled state 2021-10-09 08:43:28 -05:00
RoosterDragon
3a020e96fe Update ICustomMovementLayer to not depend on actor for costs.
No implementations require the actor.
2021-10-02 21:47:24 +01:00
abcdefg30
d370cb48c5 Remove unreachable code in TransformsIntoTransforms 2021-10-02 21:34:51 +01:00
Matthias Mailänder
a2a668077c Refactor RandomDelay:
Allow different types of random
and reflect other use cases by renaming.
2021-10-02 20:17:03 +02:00
RoosterDragon
3a7aeb5324 Ensure TargetLineRenderable width and marker size don't get lost.
By making the constructor take non-optional parameters, this highlights some calls sites which were forgetting to set these values. These are now fixed.

Set the path debug to have a marker size of 2 for better visibility.
2021-10-02 12:14:54 +01:00
Vapre
9d4d4bb924 Locomotor, PathGraph, trivial optimizations. 2021-10-01 22:21:47 +02:00
Vapre
e8bae2e50a Crash on capture fix. #19482. 2021-09-27 21:19:12 +01:00
Paul Chote
3d73d5ef29 Remove incorrect comment and merge nested conditionals. 2021-09-27 19:48:05 +02:00
Vapre
5ae4662f08 RunUnsynced, do not recalculate sync hash on reentry. Cache debug settings. 2021-09-12 10:06:44 +02:00
Matthias Mailänder
978de64903 Don't count suicides into the game score. 2021-09-02 08:00:44 +02:00
Paul Chote
52b597d5d2 Remove order latency checks from BaseBuilderQueueManager. 2021-08-26 22:00:59 +02:00
Paul Chote
7f94d67d39 Replace Map.CustomTerrain radar colors with IRadarTerrainLayer.
* TSVeinsRenderer now shows border cells on the radar
* BuildableTerrainLayer now uses the radar colors defined on the individual tiles
* CliffBackImpassabilityLayer no longer overrides the underlying terrain color.
2021-08-21 14:16:02 +02:00
Paul Chote
68710e48a6 Add terrain orientation support for Mobile. 2021-08-21 13:45:41 +02:00
Paul Chote
d509d3f5f9 Fix carryall InitialActor creation. 2021-08-20 21:04:18 +02:00
Paul Chote
864cc4becc Fix weather particle physics.
The trait documentation specified that the speed
and offset values are px/tick, but they have actually
always been treated as px/render.

Fix the update logic and rescale the map definitions
to account for the fixed behaviour.
2021-08-20 20:38:37 +02:00
MustaphaTR
2f44b016b0 Add a condition per tileset. 2021-08-11 19:09:20 -05:00
Matthias Mailänder
b7bba5d55a Restrict sonar pulse to unshrouded water. 2021-08-11 22:46:19 +02:00
Vapre
573a6cf645 FindAndDeliverResources, trivial optimizations. 2021-08-10 23:59:43 +03:00
reaperrr
eff7e803bf Minor MoveOrderTargeter optimization
IsTraitPaused should be cheaper than Map.Contains,
so let's perform the cheaper check first.
2021-08-10 18:26:05 +02:00
reaperrr
58f55b808a Add comment in Mobile
This isn't obvious to people not entirely familiar
with the code.
2021-08-10 18:26:05 +02:00
abcdefg30
453d59ae16 Defer rollover checks while generating selection decorations 2021-08-05 01:43:35 +03:00
Paul Chote
8fc042fed1 Fix style nits in OrderEffects. 2021-08-02 21:50:32 +02:00
Paul Chote
2c5fce5e3c Add missing TraitLocation to OrderEffects. 2021-08-02 21:50:32 +02:00
Paul Chote
7a93ff3258 Add support for TS-style tinted target flashes. 2021-08-02 21:50:32 +02:00
Paul Chote
9291263609 Fix indentation in OrderEffects. 2021-08-02 21:50:32 +02:00
Paul Chote
b08117dc93 Don't report "Primary Building Selected" when nothing changes. 2021-07-29 16:19:53 +02:00
Paul Chote
99322cee8f Set the closest production to Primary when force-targeting rallypoints. 2021-07-29 16:19:53 +02:00
Vapre
e201e410f4 PathGraph, skip closed cells early.
In path finding GetConnections considers connections to already closed cells and calculates the cost for them. The caller afterwards ignores them. These are 15% of all connections.
2021-07-27 14:49:22 +02:00
abcdefg30
dcaa658678 Remove an outdated reference to ConditionManager 2021-07-23 11:04:07 -05:00
Chris Harris
1c6ca394c1 Fix duplicate ActorIDs 2021-07-17 23:27:25 +02:00
Paul Chote
7bfe83cce7 Fix WithIdleOverlay PlayerPalette editor rendering. 2021-07-15 12:05:09 +02:00
Matthias Mailänder
d169210531 Display the production overlay only where the unit will exit. 2021-07-14 19:06:22 -05:00
Mustafa Alperen Seki
dcb70d12e3 Make Harvester conditional. 2021-07-12 15:41:04 +02:00
reaperrr
df8295fa2c Make aircraft turn speed scale with speed modifiers 2021-07-04 21:26:45 +01:00
reaperrr
0ac277a88d Improve Aircraft TurnSpeed getters readability 2021-07-04 21:26:45 +01:00
reaperrr
5a548d6acc Introduce IdleMovementSpeed
That actually factors in speed modifiers and trait pause/disable.
2021-07-04 21:26:45 +01:00
reaperrr
5ecb3eec16 Fix IdleTurnSpeed ignoring trait pause/disable 2021-07-04 21:26:45 +01:00