Page 1 of 1

[0.17.14] Strange pathfinding of Trains

Posted: Sun Mar 17, 2019 4:31 pm
by klausdieter5164
I think something is wrong about the pathfinding of the trains. Sometimes the train takes a much longer path than the shortest path. It is much more easier to show the issue than to explain it:

Here:
Condition.jpg
Condition.jpg (1.82 MiB) Viewed 1254 times
you can find 4 Stations and it is obvious, what would be the shortest path from the starting point.
- At "Wrong-Path-X.jpg" you can see the path that the train takes.
- At "Island_1.7.zip" you can find the savegame.

What might be the problem:

- It seems like the train is looking for the next crossroads and it might be more important turning left in a roundabout (which is faster on left-hand traffic) than finding a shorter way where you have to turn right in an other roundabout.

Re: [0.17.14] Strange pathfinding of Trains

Posted: Mon Mar 18, 2019 3:47 pm
by knightelite
I haven't checked your save yet since I'm not at home currently, but does the train ever turn right from the intersection shown? Perhaps there's a signaling issue or something there that causes it to only be able to turn left when leaving the InternBase stop?

Re: [0.17.14] Strange pathfinding of Trains

Posted: Mon Mar 18, 2019 4:32 pm
by Choumiko
Train stations apply a heavy penalty to the path length if a train passes through them.
When the path includes a train stop that is not the destination -> Add a penalty of 2000.
from https://wiki.factorio.com/Railway/Train_path_finding

Your InternKraftwerk and InternIronWest need to be passed by your train in order to get from the Base to Uranium
InternKraftwerk needs to be passed from Base to IronWest (or back to Base)

Adding bypasses and/or moving the stations resolves the problem

Re: [0.17.14] Strange pathfinding of Trains

Posted: Mon Mar 18, 2019 6:07 pm
by klausdieter5164
Choumiko wrote: Mon Mar 18, 2019 4:32 pm Train stations apply a heavy penalty to the path length if a train passes through them.
When the path includes a train stop that is not the destination -> Add a penalty of 2000.
from https://wiki.factorio.com/Railway/Train_path_finding

Your InternKraftwerk and InternIronWest need to be passed by your train in order to get from the Base to Uranium
InternKraftwerk needs to be passed from Base to IronWest (or back to Base)

Adding bypasses and/or moving the stations resolves the problem
Thank you, that solved the Problem