Teach HierarchicalPathFinder about Immovable actors.
By tracking updates on the ActorMap the HierarchicalPathFinder can be aware of actors moving around the map. We track a subset of immovable actors that always block. These actors can be treated as impassable obstacles just like terrain. When a path needs to be found the abstract path will guide the search around this subset of immovable actors just like it can guide the search around impassable terrain. For path searches that were previously imperformant because some immovable actors created a bottleneck that needed to be routed around, these will now be performant instead. Path searches with bottlenecks created by items such as trees, walls and buildings should see a performance improvement. Bottlenecks created by other units will not benefit. We now maintain two sets of HPFs. One is aware of immovable actors and will be used for path searches that request BlockedByActor.Immovable, BlockedByActor.Stationary and BlockedByActor.All to guide that around the immovable obstacles. The other is aware of terrain only and will be used for searches that request BlockedByActor.None, or if an ignoreActor is provided. A new UI dropdown when using the `/hpf` command will allow switching between the visuals of the two sets.
This commit is contained in:
committed by
Matthias Mailänder
parent
7e7d94ca89
commit
2d45e67bca
@@ -213,6 +213,7 @@ namespace OpenRA.Traits
|
||||
bool AnyActorsAt(CPos a);
|
||||
bool AnyActorsAt(CPos a, SubCell sub, bool checkTransient = true);
|
||||
bool AnyActorsAt(CPos a, SubCell sub, Func<Actor, bool> withCondition);
|
||||
IEnumerable<Actor> AllActors();
|
||||
void AddInfluence(Actor self, IOccupySpace ios);
|
||||
void RemoveInfluence(Actor self, IOccupySpace ios);
|
||||
int AddCellTrigger(CPos[] cells, Action<Actor> onEntry, Action<Actor> onExit);
|
||||
|
||||
Reference in New Issue
Block a user