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:
RoosterDragon
2022-08-07 17:21:00 +01:00
committed by Matthias Mailänder
parent 7e7d94ca89
commit 2d45e67bca
11 changed files with 286 additions and 68 deletions

View File

@@ -1864,14 +1864,21 @@ Container@PLAYER_WIDGETS:
Logic: HierarchicalPathFinderOverlayLogic
X: WINDOW_RIGHT - WIDTH - 240
Y: 40
Width: 150
Height: 25
Width: 175
Height: 60
Children:
DropDownButton@HPF_OVERLAY_LOCOMOTOR:
Y: PARENT_TOP
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Height: 25
Text: Select Locomotor
Font: Regular
DropDownButton@HPF_OVERLAY_CHECK:
Y: PARENT_TOP + 35
Width: PARENT_RIGHT
Height: 25
Text: Select BlockedByActor
Font: Regular
Background@FMVPLAYER:
Width: WINDOW_RIGHT

View File

@@ -645,11 +645,18 @@ Container@PLAYER_WIDGETS:
Logic: HierarchicalPathFinderOverlayLogic
X: WINDOW_RIGHT - WIDTH - 231
Y: 40
Width: 150
Height: 25
Width: 175
Height: 60
Children:
DropDownButton@HPF_OVERLAY_LOCOMOTOR:
Y: PARENT_TOP
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Height: 25
Text: Select Locomotor
Font: Regular
DropDownButton@HPF_OVERLAY_CHECK:
Y: PARENT_TOP + 35
Width: PARENT_RIGHT
Height: 25
Text: Select BlockedByActor
Font: Regular

View File

@@ -653,12 +653,19 @@ Container@PLAYER_WIDGETS:
Logic: HierarchicalPathFinderOverlayLogic
X: WINDOW_RIGHT - WIDTH - 260
Y: 40
Width: 150
Height: 25
Width: 175
Height: 60
Children:
DropDownButton@HPF_OVERLAY_LOCOMOTOR:
Y: PARENT_TOP
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Height: 25
Text: Select Locomotor
Font: Regular
DropDownButton@HPF_OVERLAY_CHECK:
Y: PARENT_TOP + 35
Width: PARENT_RIGHT
Height: 25
Text: Select BlockedByActor
Font: Regular

View File

@@ -623,11 +623,18 @@ Container@PLAYER_WIDGETS:
Logic: HierarchicalPathFinderOverlayLogic
X: WINDOW_RIGHT - WIDTH - 245
Y: 40
Width: 150
Height: 25
Width: 175
Height: 60
Children:
DropDownButton@HPF_OVERLAY_LOCOMOTOR:
Y: PARENT_TOP
Width: PARENT_RIGHT
Height: PARENT_BOTTOM
Height: 25
Text: Select Locomotor
Font: Regular
DropDownButton@HPF_OVERLAY_CHECK:
Y: PARENT_TOP + 35
Width: PARENT_RIGHT
Height: 25
Text: Select BlockedByActor
Font: Regular