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 is lost" when it's not #5531

Closed
DorpsGek opened this issue Apr 21, 2013 · 3 comments
Closed

"Ship is lost" when it's not #5531

DorpsGek opened this issue Apr 21, 2013 · 3 comments
Labels
component: pathfinder This issue is related to Pathfinder flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Samu opened the ticket and wrote:

I was in a game using YAPF for ships with forced 90 degrees.

The "Ship is lost" message briefly pops and disappears in a matter of a second while in truth the ship isn't lost. I noticed it happens when a ship suddenly needs to service at a randomly chosen depot and that depot happens to be behind its direction on a river.

In another case, when the distance from one place to another is quite long, the same message is shown for as long as it takes and only disappears when the distance towards its destination is shorter. I fixed this using buoys, though they shouldn't be needed, as the ships were never lost.

In either of these two issues, the ships were never lost, it's only the message showing up erroneously.

On a completely different issue, I had one ship that would never service on its own. I was aware of it when I was autoreplacing one model to another and this one had never been replaced. I found out its reliability was down to 0% and 44 breakdowns. I appended a new order to it to service at a specific ship depot and not even now the message "Ship is lost" would appear.

So I ended up appending a service order on all other ships to specificed depots and the vast majority of "Ship is lost" messages simply never have shown up again.

Attachments

Reported version: 1.3.0
Operating system: Windows


This issue was imported from FlySpray: https://bugs.openttd.org/task/5531
@DorpsGek
Copy link
Member Author

Rubidium wrote:

The problem is that we limit the search space for the pathfinder. We do this to prevent malicious people from completely draining the resources of a server.

With road vehicles and trains you will generally not reach this limit quickly since there are, relatively, few locations where you can choose between routes. For ships you can choose 3 different directions for every tile you enter. If the route is not near straight, but has to navigate around something, the pathfinder will try searching from the closest tile in it's search list towards the end point in the list of tiles to search. Since the ship needs to navigate around a bump, it first needs to move away from its destination, which means it is going to visit a lot of tiles even if it is fruitless. So, the ship reaches it's pathfinder search space limit and simply tells: "I don't know". After that, it lets the ship continue with its best guess of the direction, which in this case means it will eventually reach a location from the destination is within the search space. In other cases, your ship might be lost indefinitely.

So, algorithmically the ship is really lost; it does not know where is has to go to. You can work around this by either placing buoys in strategic places + preventing ships from using "the wrong" depots by setting service orders for depots on the route. Alternatively you increase the pf.yapf.max_search_nodes, however this will slow your game down over using buoys.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5531#comment12217

@DorpsGek
Copy link
Member Author

Rubidium closed the ticket.

Reason for closing: Won't fix

See the comment


This comment was imported from FlySpray: https://bugs.openttd.org/task/5531

@DorpsGek
Copy link
Member Author

peter1138 wrote:

It happens when a ship enters a dock on TILE_X or TILE_Y facing the dock. The ship will pathfind from the tile it is on but the only way it can move is into the dock. Then it will be forced around and after that it can find a path.


This comment was imported from FlySpray: https://bugs.openttd.org/task/5531#comment14403

@DorpsGek DorpsGek added component: pathfinder This issue is related to Pathfinder flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) bug labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pathfinder This issue is related to Pathfinder flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant