Opened 5 years ago

Closed 4 years ago

#5586 closed defect (fixed)

Pathfinding - Units deleting long-range path waypoints getting stuck.

Reported by: Freagarach Owned by: wraitii
Priority: Should Have Milestone: Alpha 24
Component: Simulation Keywords: pathfinder, pathfinding, regression
Cc: wraitii Patch: Phab:D2754

Description

When moving multiple units past an obstruction, the first waypoint is set at the edge of the obstruction, hence the units will gladly pass it. However, often units at the back bump into other units (or get too close) whereafter the waipoint at the edge of the obstruction is deleted (sometimes even more than only one).

This causes those units to have a long-range waypoint through the obstruction. Those units will walk straight to the obstruction. When arrived at the obstruction they use short-range waypoints to get around the obstruction which can be rather inefficient when it involves a large obstruction (e.g. a wall or ridge).

When many units are involved, this can lead to units getting stuck due to all paths being blocked by friendlies.

Attachments (3)

commands.txt (3.8 KB ) - added by Freagarach 5 years ago.
Minimal example with few units (SVN 22885).
commands.2.txt (5.1 KB ) - added by Freagarach 5 years ago.
Minimal example with slightly more units (SVN 22885).
commands.3.txt (6.7 KB ) - added by Freagarach 5 years ago.
Entities 2043 and 2058 getting stuck (SVN 22885).

Download all attachments as: .zip

Change History (8)

by Freagarach, 5 years ago

Attachment: commands.txt added

Minimal example with few units (SVN 22885).

by Freagarach, 5 years ago

Attachment: commands.2.txt added

Minimal example with slightly more units (SVN 22885).

comment:1 by Freagarach, 5 years ago

Above replays do not show units getting stuck, only the effect of deleting the waypoints, which eventually leads to units getting stuck ;) I will try to get a MWE of them getting stuck.

by Freagarach, 5 years ago

Attachment: commands.3.txt added

Entities 2043 and 2058 getting stuck (SVN 22885).

comment:2 by elexis, 5 years ago

Keywords: regression added

comment:3 by elexis, 5 years ago

Duplicate at #5619, which also has a minimal replay for r23072.

From http://irclogs.wildfiregames.com/2019-10/2019-10-13-QuakeNet-%230ad-dev.log

09:50 < Freagarach> Then you can see that when the unit-to-be-stuck bumps into another unit it removes the first waypoint of its long-range path. If it bumps often enough only the last waypoint remains. When that is through an obstruction it often gets stuck at it.
10:07 < Freagarach> In A23b the short-range pathfinder takes over.
10:11 < Freagarach> So the long-range waypoint is deleted (in both cases) but instead of using the long-range pathfinder to compute the path to the next waypoint (which happens now) the short-ranged pathfinder computes the path to the next waypoint. (Which won't get units stuck so easily but is way more expensive.)
10:14 < Freagarach> Me neither. The paths chosen in A23b are so weird. (E.g. standing left-below a CC, getting the order to the right-below and choosing the path above because the first try fails.)

comment:4 by wraitii, 4 years ago

Owner: set to wraitii
Patch: Phab:D2754

commands.3.txt shows a different (worse) bug. The entity is actually computing short-path to a long waypoints, and it succeeds. Only the short-path tells it to go inside the CC. So the unit fails to move. This is reported at #5547, comment https://trac.wildfiregames.com/ticket/5547#comment:1 .

It is supposed to be fixed though, because the unit is supposed to compute a long path now and then. This appears to be an off-by-one mistake...

Fixed correctly by Phab:D2754.

comment:5 by wraitii, 4 years ago

Resolution: fixed
Status: newclosed

In 23699:

Fix some cases of units getting stuck.

This fixes an off-by-one error that led to entities sometimes getting stuck against obstructions.
It also increases the max-range of the short pathfinder to help entities find their way around corridors and house blocks.

Fixes rP22609 (off-by-one error) and reverts the range changes from rP22526

Reported By: Freagarach

Fixes #5586 . Refs #5624

Differential Revision: https://code.wildfiregames.com/D2754

Note: See TracTickets for help on using tickets.