Page 1 of 1

[kovarex] [15.34] Strange train repathing

Posted: Fri Aug 18, 2017 7:57 am
by BenSeidel
Hi,
The topic found here: viewtopic.php?f=18&t=51885 was the inspiration to build a reliable setup that exhibits the issue described in that thread.
In the attached save two trains go through a loop, the first has a slower acceleration than the second to allow the trailing locomotive to catch up. Both trains reach maximum speed by the end of the loop. The repath issue only occurs on every 2nd pass. It's a controlled example of the scenario put forward in the above thread.

I'm not sure if this is a bug, as I don't know if it's the intended behaviour of the pathing system to allocate a weight of over 2200 for the right hand turn to overcome the 2200 that should be applied to the other (top left) route (2000 for the station, 200 blocks of rail). You can line the top pass with as many stops as you want to and the pathfinder still exhibits the issue.

Thanks!

Re: Strange train repathing

Posted: Sat Aug 26, 2017 3:54 am
by BenSeidel
I have done some additional testing and found that it's the center (red) block being assigned a path penalty over 2,000,000 (1000 train stops). It was at 1000 train stops I decided to call it a day, figuring that the exact number could be anything.

if the signal circled in green is removed and the blue block is merged with the green so that no matter what the trains must travel through the block that is assigned the massive penalty, all works as expected.
bad block.jpg
bad block.jpg (298.01 KiB) Viewed 1916 times
I originally thought that maybe it was being assigned infinity, but as the pathfinder continues to find the shortest route that avoids the bad block (in all the test cases I can think of), I'm guessing that it's actually an extremely large value.

While removing this stop solves this particular setup, the "bug" is evident in many of my builds, and no matter how I try to "solve" it, it is always present.
Could someone please let us know if this is a bug or if it's working as intended, or if it's of a low enough priority that it probably won't be looked at/fixed? It would be good to know if it's worth the time sorting out workarounds or not.

Thanks.

Re: [kovarex] [15.34] Strange train repathing

Posted: Sun Sep 03, 2017 10:47 am
by BenSeidel
BenSeidel wrote:but as the pathfinder continues to find the shortest route that avoids the bad block (in all the test cases I can think of), I'm guessing that it's actually an extremely large value.
Yeah, I was wrong here. It turns out that while it does avoid the bad block, as show in the previous save, the path finder fails after the train is forced to path through the "bad" block instead just finding any path. It just shows that I really didn't think about the issue before I started trying to capture the behaviour.

In the attached save file, the signal circled in green in the previous post has been removed such that the train is FORCED to path through the now combined blue & red block. As there are now 3 routes for a train to get from the "bad" block to the destination and only two trains, I would expect that the 3rd route with a dummy rail stop on it would never be used. But as the rail stop track is the most recently built route (it's a guess, it could be fixed search pattern such as north or left first, but I have not tested that too much), when the path finder goes through each route, infinity + any > infinity = false, thus the paths are all "equal distance".

Thanks

Re: [kovarex] [15.34] Strange train repathing

Posted: Fri Dec 15, 2017 3:58 am
by BenSeidel
Hi,
This behaviour has stopped in 0.16.

Thanks.

Re: [kovarex] [15.34] Strange train repathing

Posted: Mon Dec 18, 2017 1:47 pm
by kovarex
Yes, it is related to a rail pathing bug I solved: 54042
Im moving it to resolved.