News:

Simutrans Chat Room
Where cool people of Simutrans can meet up.

JPS fails on some estuaries [WAS Humber keel refuses to use Medium River]

Started by AP, January 05, 2018, 07:48:04 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

AP

On the current Bridgewater server game, I have several Humber Keels, which say they should be able to sail up "medium rivers", refusing to use the 'midstream medium river' to get to Christerhill Village Dock (2321,2998) from Bearidge Corner Dock (2335,2957).


I can't see anything that should prevent them using this river, every tile is navigable and there are no low bridges, so am inclining to think "bug"...


Could someone take a look and let me know what they think?

Moderator note: The title of this post has been changed for clarity.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

AP

Quote from: jamespetts on January 05, 2018, 08:06:35 PM
Have you checked the range?

I hadn't, but on checking, the Keel's range is 50km, whereas the between the co-ordinates mentioned is 14 tiles in the x and 41 in the y (simplistically), at 8 tiles/km, nowhere close to the range limit.

jamespetts

Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

AP

There are sloped river tiles, but they are tagged "navigable".

jamespetts

Thank you for that. I have logged in and I can see where the issue occurs, although I am not sure what is causing it; I will have to look into this in more detail when I get home and have a chance to look into the code properly.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

jamespetts

Having looked into this, I have determined that this is (so far as I can tell) a fault with the JPS routefinding system for ships when coupled with one very specific sort of estuary:



Because this code is common with Standard, I have moved this thread to the Standard bug reports section. My tests so far show that: (1) disabling the JPS search; and (2) deleting and re-building the estuary thus as the public player:





allows the boats to route past this estuary tile. Testing using breakpoints in the debugger, it seems that, with JPS enabled, the estuary tile never gets added to the list in the route finder.

I do not know the cause of or solution to this problem, since I did not write and do not fully understand the JPS system (I suspect that it is some interaction between the unusual ribis of this particular estuary and the JPS's way of not checking all directions), but I have resolved the issue on the Bridgewater-Brunel server by rebuilding the river as shown above, and confirmed that the ships do route. Incidentally, this should make the server run more responsively, since the repeated failed attempts by these boats at finding a route were taking a huge amount of CPU power.

For the purposes of Standard developers looking into fixing this: I have a saved game available (albeit an Extended saved game) showing this failure state if that would be helpful.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

This is a very old bug, even the old "experimental" server suffered from something like it, where cannel tiles would be ignored for path finding. Just it was trivial to fix back then as one still had access to terraform as one wanted. Standard never noticeably suffered from it as both Pak64 and Pak128 are not ship focused so ships are seldom used and certainly nowhere near as much as on the extended server.

Dwachs

Will look into this when I find time.

@James: In your pictures, which of the pictures shows the faulty configuration? I suppose the first one? Is this a canal or a river? Does this only happen for generated rivers? Or does this also occur for player built canals?

I am aware that there is a route finding bug in standard, but was never able to track it down.
Parsley, sage, rosemary, and maggikraut.

jamespetts

Dwachs - the first picture shows the fault. It is an automatically generated river, not a canal. I have not seen the issue with canals, although there are not many on the server.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

DrSuperGood

Worth noting that Simutrans Extended has different water logic from Standard. Some ships cannot path over open water. Some rivers and cannels limit the sort of ships that can path over them, and not just the maximum speed of the ships. This adds more potential causes of the problem.

jamespetts

Quote from: DrSuperGood on January 08, 2018, 05:27:22 PM
Worth noting that Simutrans Extended has different water logic from Standard. Some ships cannot path over open water. Some rivers and cannels limit the sort of ships that can path over them, and not just the maximum speed of the ships. This adds more potential causes of the problem.

I did specifically check using breakpoints whether any of the Extended specific routing restrictions were activated: they were not. Also, it could not be one of these restrictions if turning of JPS solves the problem, as there is no distinction between JPS and non-JPS searches in any of the code that provides for these restrictions.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

The bug appears to be more difficult to fix than expected. Here is a supposed fix, please test it. The bug appeared also with player-built canals. The jps method was not able to turn into or behind canals.

Many thanks to James for hunting down the bug to the jps code.
Parsley, sage, rosemary, and maggikraut.

jamespetts

Splendid, thank you for that. I have now tested it in Extended using the original case in which this issue occurs, and I confirm that the problem can no longer be reproduced.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Dwachs

This is not yet submitted to standard svn.... will do tonight.

Edit: Submitted, it is r8366.
Parsley, sage, rosemary, and maggikraut.