Commit Graph

196 Commits

Author SHA1 Message Date
Gustas
049d0283f9 Remove TiberianSunRefinery
Also add IDockClientBody interface,
move WithDockingOverlay cnc -> common,
remove HarvesterDockSequence implementing classes
2023-02-18 16:35:15 +01:00
Gustas
75d65b3d20 Remove redundant INotifyRearm 2023-01-20 10:43:18 +02:00
Gustas
0d24f2c08b Merge INotifyBeingResupplied into INotifyDockClient 2023-01-20 10:43:18 +02:00
Gustas
dca07d240c Add INotifyDockHost and INotifyDockClient interfaces
Rename INotifyDocking to INotifyDockHost and extract INotifyDockClient from INotifyHarvesterAction
2023-01-20 10:43:18 +02:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
Matthias Mailänder
aa14c9c570 Add VTOL landing exhaust animation. 2022-08-12 00:54:44 +03:00
abcdefg30
0134f63f4d Fix actors with AttackFollow moving away from their targets on amove 2022-08-06 15:38:46 +02:00
RoosterDragon
aef65d353d Replace DomainIndex internals with a lookup from HierarchicalPathFinder instead
Teach HierarchicalPathFinder to keep a cache of domain indices, refreshing them only on demand and when invalidated by terrain changes. This provides an accurate and quick determination for checking if paths exist between given locations.

By exposing PathExistsForLocomotor on the IPathFinder interface, we can remove the DomainIndex trait entirely.
2022-08-03 23:12:42 +02:00
RoosterDragon
5a8f91aa21 Add a hierarchical path finder to improve pathfinding performance.
Replaces the existing bi-directional search between points used by the pathfinder with a guided hierarchical search. The old search was a standard A* search with a heuristic of advancing in straight line towards the target. This heuristic performs well if a mostly direct path to the target exists, it performs poorly it the path has to navigate around blockages in the terrain. The hierarchical path finder maintains a simplified, abstract graph. When a path search is performed it uses this abstract graph to inform the heuristic. Instead of moving blindly towards the target, it will instead steer around major obstacles, almost as if it had been provided a map which ensures it can move in roughly the right direction. This allows it to explore less of the area overall, improving performance.

When a path needs to steer around terrain on the map, the hierarchical path finder is able to greatly improve on the previous performance. When a path is able to proceed in a straight line, no performance benefit will be seen. If the path needs to steer around actors on the map instead of terrain (e.g. trees, buildings, units) then the same poor pathfinding performance as before will be observed.
2022-08-03 23:12:42 +02:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
RoosterDragon
d2935672ca Fix the shape of the IPathFinder interface, ensure all path searches use it.
Some path searches, using PathSearch, were created directly at the callsite rather than using the pathfinder trait. This means some searches did not not benefit from the performance checks done in the pathfinder trait. It also means the pathfinder trait was not responsible for all pathing done in the game. Fix this with the following changes:
- Create a sensible shape for the IPathFinder interface and promote it to a trait interface, allowing theoretical replacements of the implementation. Ensure none of the concrete classes in OpenRA.Mods.Common.Pathfinder are exposed in the interface to ensure this is possible.
- Update the PathFinder class to implement the interface, and update several callsites manually running pathfinding code to instead call the IPathFinder interface.
- Overall, this allows any implementation of the IPathFinder interface to intercept and control all path searching performed by the game. Previously some searches would not have used it, and no alternate implementations were possible as the existing implementation was hardcoded into the interface shape.

Additionally:
- Move the responsibility of finding paths on completed path searches from pathfinder to path search, which is a more sensible location.
- Clean up the pathfinder pre-search optimizations.
2022-04-18 11:18:43 +01:00
RoosterDragon
2583a7af31 After NotBefore<> support to control initialization order.
Requires<T> means that trait of type T will be initialized first, and asserts that at least one exists. The new NotBefore<T> means that trait of type T will be initialized first, but allows no traits.

This allows traits to control initialization order for optional dependencies. They want to be initialized second so they can rely on the dependencies having been initialized. But if the dependencies are optional then to not throw if none are present.

We apply this to Locomotor which was previously using AddFrameEndTask to work around trait order initialization. This improves the user experience as the initialization is applied whilst the loading screen is still visible, rather than the game starting and creating jank by performing initialization on the first tick.
2022-04-18 10:31:47 +01:00
RoosterDragon
d67f696bd0 Move BlockedByActor, IPositionableInfo, IPositionable to Mods.Common.
Actor previously cached targetable locations for static actors as an optimization. As we can no longer reference the IPositionable interface, move this optimization to HitShape instead. Although we lose some of the efficiency of caching the final result on the actor, we gain some by allowing HitShape to cache the results as long as they have not changed. So instead of being limited to static actors, we can extend the caching to currently stationary actor.
2022-02-11 23:35:08 +01: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
RoosterDragon
3a020e96fe Update ICustomMovementLayer to not depend on actor for costs.
No implementations require the actor.
2021-10-02 21:47:24 +01: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
Andre Mohren
7356f2506b Moved flashimage to world trait. 2021-07-01 16:38:51 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
abc013
8fede9d6ba Add ValidStances checks to BlocksProjectiles and Gate. 2021-05-27 21:37:37 +02:00
Paul Chote
3bc42543fa Decouple color picker palette definitions to their own trait. 2021-05-15 15:29:46 +02:00
Paul Chote
80e92849da Replace ResourceType with strings in interfaces/public methods. 2021-03-20 16:45:41 +01:00
Paul Chote
dcd8eccee4 Replace ResourceLayer references with IResourceLayer in traits/warheads. 2021-03-20 16:45:41 +01:00
Paul Chote
7e9d291223 Add IResourceRenderer interface. 2021-03-20 16:45:41 +01:00
Paul Chote
1dc26a9b8e Pass resource type and count to IAcceptResources instead of the value. 2021-03-20 16:45:41 +01:00
reaperrr
2473b8763b Rename methods/activities with Visual in them
While they may be only 'visual' in terms of influence/cell grid,
they all do update CenterPosition, which is essentially the
actual world position of the actor.
'Visual' would imply that it only affects the position where the
actor is drawn, which is inaccurate.
Furthermore, using the term 'Visual' here would make
naming future methods/properties related to visual interpolation
unnecessarily complicated, because that's where we might
need a real 'Visual(Only)Position'.
2021-03-08 11:19:11 +01:00
Paul Chote
632af7c7e6 Support mixed indexed/BGRA terrain tiles. 2021-01-16 22:09:08 +01:00
Paul Chote
53db1230ab Move default tileset parsing to Mods.Common. 2021-01-11 21:57:55 +01:00
Paul Chote
b86b638700 Move editor template rendering to TerrainRenderer. 2021-01-11 21:57:55 +01:00
Paul Chote
6d6efd5fe8 Move tileset image validation to TerrainRendererInfo. 2021-01-11 21:57:55 +01:00
Paul Chote
0a374e2264 Move ownership of tile sprites to the terrain renderer. 2021-01-11 21:57:55 +01:00
teinarss
13581c030d Use in parameter for Target 2020-11-06 22:02:24 +01:00
Mustafa Alperen Seki
8aeec24c9b Add DamageTypes to Demolition 2020-10-21 18:41:16 +02:00
Paul Chote
9cd6df2929 Replace DecorationPosition with mod-defined string ids. 2020-09-09 23:16:05 +02:00
abcdefg30
dd99fc93e4 Uncloak during resupply when "UncloakOn: Dock" is defined 2020-08-16 21:01:16 +02:00
teinarss
19b02875c7 Use Tuple syntax 2020-08-15 10:37:10 +01:00
Paul Chote
3bc5d2d02c Add INotifyEditorPlacementInfo interface.
This allows TraitInfos to act when the actor preview is placed
in the editor, returning arbitrary data which the editor stores
and gives back if the preview is removed.
2020-07-13 14:02:02 +02:00
Paul Chote
ae7cfa56b7 Restrict IActorPreviewInitInfo to ActorInit. 2020-06-19 17:57:56 +02:00
Paul Chote
86f61298e6 Replace ITraitInfo interface with TraitInfo class. 2020-05-21 13:01:04 +02:00
atlimit8
259c8d2c98 Merge ConditionManager trait directly into Actor 2020-05-09 15:46:11 +02:00
Matthias Mailänder
52d0490f95 Supersede INotifyNuke 2020-04-30 01:37:05 -05:00
Matthias Mailänder
b3b0aa75ae Add new interfaces for support powers. 2020-04-30 01:37:05 -05:00
Matthias Mailänder
e5457a3390 Allow wall renderers in mod code. 2020-04-11 16:29:00 +02:00
Matthias Mailänder
47e21f8bef Remove unused using. 2020-04-11 16:29:00 +02:00
Paul Chote
ac200f6173 Rework decoration renderable traits:
- Removed implicit pip definitions and IPips interface.
  New decoration traits have been added to render them.
  Pip types are no longer hardcoded in OpenRA.Game.

- Decoration rendering is now managed by SelectionDecorations(Base),
  which allows us to remove assumptions about the selection box
  geometry from the decoration traits.

- RenderNameTag has been replaced by WithNameTagDecoration, which is
  an otherwise normal decoration trait.

- Unify the configuration and reduce duplication between traits.

- Removed hardcoded references to specific selection box renderables.

- Remove legacy cruft.
2020-03-24 00:07:10 -05:00
Paul Chote
73a78eadb1 Move Interactable and Selectable to Mods.Common. 2020-03-24 00:07:10 -05:00
Paul Chote
16e0ea611e Revert "Fix AttackFollow ignoring allowMove flag when auto-targeting."
This reverts commit 3e116060cfc0a3e46563716c3e594a4ba3051b93.
2020-03-02 22:22:56 +01:00
Paul Chote
84419e4259 Add queued argument to CanIssueDeployOrder. 2020-02-24 12:56:49 +01:00
Paul Chote
ab196a23e6 Fix AttackFollow ignoring allowMove flag when auto-targeting. 2020-02-14 17:30:38 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
tovl
3236499fb7 Increase IMove.MoveTo call flexibility. 2019-12-13 23:51:03 +01:00