Open qoala opened 4 years ago
Extra credit C: When sprinting near guards (and some other distractions), the guard's observed/TAGged path doesn't continue updating past the initial destination, even though the investigation point continues to follow the agent. The guard paths correctly on their turn, but the prediction is wrong. Unclear if this also leads to incorrect reservations (and other guards' detours)
Some buggy findings from dissecting the pather code (still in progress).
Finding 2:
Finding 1 looks like it would've been responsible for multiple (though not all) of the wrong paths that AK has seen recently. Fixing that likely requires patching the coop pather to include AP limits, so that it can't reserve nodes the unit won't be able to reach.
Additional consequence of the 11 timestep reservations: Guards may end their turn with 1 AP left if the next step on their optimal route is a diagonal step.
This appears natural to the player, so any fix should leave this behavior in place.
Truncating pathing in the astar handler to the units AP would cause it to value getting as close to the goal as possible (and spend that 1AP with an orthogonal step in the most common layout). Might need to let the astar handler plan beyond the unit's AP, then truncate the path before passing it to reservePath
Conclusion: Example of finding 2, which is in scope for fixing.
When guards decide their paths for the next turn, they may deviate from the most direct route to move around another guard. If that other guard changes their mind or is otherwise disturbed, the first guard will now be pathing around an obstruction that never exists.
Option 1: Recalculate guard paths at the start of the guard turn
Option 2: Recalculate guard paths in response to more player actions
Extra credit A: Guards sometimes step around soft-cover orthogonally to allow ambush when an agent is in the diagonal destination tile. This also occasionally happens around doorways. Guards shouldn't step orthogonally for these cases when the agent is no longer there.
Extra credit B: Guards sometimes step around another guard that doesn't even reach the obstruction point this turn. Possibly because that guard gets re-pathed during a later step in evaluation?