Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#3577 closed defect (fixed)

Fishing ships stuck at dock

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

Description

In an svn testgame, ycswyw experienced a bug where his fishing ships are stuck at a dock.

Looks similar to #3530 #3539

Thanks maxticatrix for reporting.

Attachments (3)

commands_maxticatrix.txt (374.2 KB ) - added by elexis 8 years ago.
The bug appears minute 8 with the only two fishing ships on the map. r17175
isInRange.patch (1020 bytes ) - added by mimo 8 years ago.
reverting.patch (1.6 KB ) - added by mimo 8 years ago.

Download all attachments as: .zip

Change History (8)

by elexis, 8 years ago

Attachment: commands_maxticatrix.txt added

The bug appears minute 8 with the only two fishing ships on the map. r17175

comment:1 by wraitii, 8 years ago

Owner: set to wraitii
Resolution: fixed
Status: newclosed

In 17178:

Bump fishing ships gathering range since their obstruction size was effectively increased with the new pathfinder. This resulted in them sometimes not being able to deposit their resources at docks.

Fixes #3577, reported by maxticatrix through elexis.

comment:2 by mimo, 8 years ago

Keywords: review added
Resolution: fixed
Status: closedreopened

I had a look at it, and the original source of the problem is the way diagonals are treated. From what I have understood, if we want to be at a distance d from a square of halfSize r, the pathfinder tries to go in a square of (d+r), but when we check if we are in range in unitMotion, we use the function distanceToSquare which uses rounded corners.

This is fixed in the patch attached here, isInRange.patch, which fixes the commands_maxticatrix.txt without the changes in the template from r17178 (btw 10 was certainly too big, and i would propose to decrease it after this patch is commited).

Debugging that, I realized that my changes from r17145 were wrong (I misunderstood the meaning of some variables) and are reverted in the second patch reverting.patch with an additionnal fix in the case of inverted circle.

by mimo, 8 years ago

Attachment: isInRange.patch added

by mimo, 8 years ago

Attachment: reverting.patch added

comment:3 by mimo, 8 years ago

In 17184:

revert r17145 which was based on misunderstanding of the algo, and fix the inverted_circle case, refs #3577

comment:4 by wraitii, 8 years ago

Resolution: fixed
Status: reopenedclosed

In 17190:

Fix an issue where square diagonals were incorrectly handled when checking the distance to the target. Fixes #3577 properly. Patch by mimo.

Decrease fishing ship gathering range in consequence (revert [17178]).

comment:5 by sanderd17, 8 years ago

Keywords: review removed
Note: See TracTickets for help on using tickets.