Opened 9 years ago

Closed 8 years ago

#3532 closed defect (fixed)

Units can go through obstruction after long-path to the edge

Reported by: elexis Owned by: wraitii
Priority: Must Have Milestone: Alpha 19
Component: Core engine Keywords: pathfinding
Cc: Patch:

Description (last modified by elexis)

As reported in #3410, units can go through obstructions. This ticket should deal with one particular case.

http://trac.wildfiregames.com/raw-attachment/ticket/3532/cav_inside_cc.gif http://trac.wildfiregames.com/raw-attachment/ticket/3532/after_longpath.jpg

Reproduce:

  1. Issue a walk order to the edge of a building or resource (The goal has to be far enough away so that the long-pathfinder will compute the path)
  2. Once reached that point, issue a walk order to the center of the building.

If you enable the obstruction and pathfinder overlay in the developer menu you will be easier able to see if you selected a long-path and a waypoint that will trigger the error.

Using this recipe you can enter every static obstruction, buildings, resources, but not units and you can also not leave the map.

Notice a second bug: If you get a short-path instead of a long-one, you will not be able to get as close to the obstruction as you should be able to get. The unit will cancel the move earlier.

Attachments (4)

commands_cav_in_cc.txt (1.8 KB ) - added by elexis 9 years ago.
Replay with only two commands (cavalry inside CC, r17136)
commands_infantry_in_cc.txt (2.9 KB ) - added by elexis 9 years ago.
Replay with only two commands (infantry inside CC, r17136)
cav_inside_cc.gif (617.8 KB ) - added by elexis 9 years ago.
Replay with the overlays enabled. The blue cell shows the goal of the longpath. Red are impassable cells. The bug is triggered reliably if the target (blue) is a neighboring cell of an impassable one (red).
after_longpath.jpg (84.0 KB ) - added by elexis 9 years ago.
The opaque blue square is the goal of the longpath. The blue outlined square is the obstruction of the cavalry. The blue line is the obstruction border of the civic centre. The teal / light blue line is the obstruction of the CC extended outwards by the size (clearance) of the cavalry (here 1). Notice the obstructions intersect significantly.

Download all attachments as: .zip

Change History (7)

by elexis, 9 years ago

Attachment: commands_cav_in_cc.txt added

Replay with only two commands (cavalry inside CC, r17136)

by elexis, 9 years ago

Attachment: commands_infantry_in_cc.txt added

Replay with only two commands (infantry inside CC, r17136)

by elexis, 9 years ago

Attachment: cav_inside_cc.gif added

Replay with the overlays enabled. The blue cell shows the goal of the longpath. Red are impassable cells. The bug is triggered reliably if the target (blue) is a neighboring cell of an impassable one (red).

comment:1 by elexis, 9 years ago

Description: modified (diff)

Notice once the unit has finished the long-path, it is already standing inside the obstruction. The other command makes it only more visible.

Last edited 9 years ago by elexis (previous) (diff)

by elexis, 9 years ago

Attachment: after_longpath.jpg added

The opaque blue square is the goal of the longpath. The blue outlined square is the obstruction of the cavalry. The blue line is the obstruction border of the civic centre. The teal / light blue line is the obstruction of the CC extended outwards by the size (clearance) of the cavalry (here 1). Notice the obstructions intersect significantly.

comment:2 by elexis, 9 years ago

Description: modified (diff)

comment:3 by wraitii, 8 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 17152:

Revert the logic change in r16998. This commit removed the checks in UnitMotion against structures, which should have been fine except the short-range pathfinder and the long-range pathfinder are not entirely compatible (check out #3532 for details). This behavior was probably slightly optimized, but it was too clever for its own good in the current state of the pathfinder, might be reintroduced later.

This resulted in ALL "units inside obstructions" issues.

Thanks to elexis for the testing.

Fixes #3532, #3450.
Refs #3538 (still OOSes), #3410 (unitmotion remains buggy for formations, but this is only aesthethic.)
Probably affects #3471 and #3505, but those are not fixed.

Note: See TracTickets for help on using tickets.