Opened 4 years ago
Closed 3 years ago
#5795 closed defect (fixed)
UnitMotion can go into dead ends when too many units are around
Reported by: | Silier | Owned by: | wraitii |
---|---|---|---|
Priority: | Must Have | Milestone: | Alpha 24 |
Component: | Simulation | Keywords: | |
Cc: | wraitii | Patch: | Phab:D3203 |
Description
See picture of stucked units because of that https://drive.google.com/file/d/1VhF1dRdCrxB7AQ1N-V9V0TSJxVK-78dS/view?usp=sharing
and replay from rP23919
Attachments (2)
Change History (5)
by , 4 years ago
Attachment: | commands.txt added |
---|
by , 3 years ago
Attachment: | commands.2.txt added |
---|
comment:1 by , 3 years ago
Summary: | Pathfinding tries to move units through unpassable terrain when obstructed by units → UnitMotion can go into dead ends when too many units are around |
---|
There's actually a few things at play here, but I'd say every component individually is working fine:
- Units give up (after a long while) when they can't find a path. This results in the stuckiness above, but only when there are a _lot_ of units. I don't think it's a huge issue. They're not actually stuck, just gave up.
- When the are obstructed, they compute short paths; If that fails, they 'pop' long waypoints to avoid issues with waypoints obstructed by units. In a case like the order in the replay above, this means they compute a path that crosses impassable terrain, after a while.
- The short-pathfinder has a limited domain, and can't go beyond that. It will still try to get closer to the goal in its limited domain.
All of the above combine to give the behaviour of a unit that fails to path, pops waypoints, calls the short-pathfinder, which finds it cannot path to the long-waypoint but can get close by moving further into the 'wrong' direction, and so on, until the unit cannot get any closer, at which point it recomputes a long-path, which sets it back on its way.
One thing to improve is to stop popping if the long waypoint is too far away, as that no longer really makes sense. Would likely avoid the issue in the first place.
The title is technically wrong, because the pathfinder never tries to move through impassable terrain. I've reworded it.
comment:2 by , 3 years ago
Patch: | → Phab:D3203 |
---|
"minimal" reproduction of the weird pathing