Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ship pathfinders ignore the max order distance #7062

Closed
SamuXarick opened this issue Jan 14, 2019 · 5 comments
Closed

Ship pathfinders ignore the max order distance #7062

SamuXarick opened this issue Jan 14, 2019 · 5 comments
Labels
bug Something isn't working component: pathfinder This issue is related to Pathfinder regression It used to work, and now it's broken.
Milestone

Comments

@SamuXarick
Copy link
Contributor

SamuXarick commented Jan 14, 2019

if (v->dest_tile == 0 || DistanceManhattan(tile, v->dest_tile) > SHIP_MAX_ORDER_DISTANCE + 5) {

Fentwood Transport, 1954-11-03.zip

After #6784, the ship in this savegame becomes lost.
The ship becomes out of distancemanhattan reach, and the pathfinder won't be invoked.

When the ship reaches map border and comes back again, it becomes within distancemanhattan reach and re-invokes the pathfinder again, only to get out of reach again, lost.

@LordAro LordAro changed the title Ship wasn't lost in 1.8.0 Ship becomes lost if destination is greater than maximum order distance Jan 14, 2019
@LordAro LordAro added component: pathfinder This issue is related to Pathfinder bug Something isn't working regression It used to work, and now it's broken. labels Jan 14, 2019
@PeterN
Copy link
Member

PeterN commented Jan 15, 2019

The path distance between the two docks is too far, you need to use buoys.
I believe it's a bug that the pathfinders ignore the max order distance.

@andythenorth andythenorth changed the title Ship becomes lost if destination is greater than maximum order distance Ship pathfinders ignore the max order distance Jan 16, 2019
@J0anJosep
Copy link
Contributor

It is difficult for pathfinders to be constrained by SHIP_MAX_ORDER_DISTANCE + 5, as that is a condition for consecutive orders in ManhattanDistance, not for the length of the path. I don't think it is a bug of the pathfinders.

@PeterN
Copy link
Member

PeterN commented Jan 23, 2019

Likely the change that caused this could be partially reverted now that we have ship path caching.

@nielsmh nielsmh added this to the 1.9.0 milestone Jan 24, 2019
@PeterN
Copy link
Member

PeterN commented Feb 25, 2019

In fact, since we have ship path caching, it is now feasible to remove the ship order distance limit completely.

PeterN added a commit to PeterN/OpenTTD that referenced this issue Feb 25, 2019
@TrueBrain TrueBrain modified the milestones: 1.9.0, 1.10.0 Mar 3, 2019
@TrueBrain
Copy link
Member

Rescheduling to 1.10 for a proper solution, given that the PR that fixes this depends on 2 other PRs, which are not approved yet. Especially as this has been a long outstanding issue, I see no reason to rush this for 1.9.

@PeterN PeterN closed this as completed in 66bed86 Mar 31, 2019
douiwby pushed a commit to douiwby/OpenTTD that referenced this issue Apr 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working component: pathfinder This issue is related to Pathfinder regression It used to work, and now it's broken.
Projects
None yet
Development

No branches or pull requests

6 participants