the rules for repathing can be found there :
https://wiki.factorio.com/Railway/Train_path_finding , you can also use the debug menu to show "
train repathing" it shows some text poping above trains when it occurs, it allows to show when the
train repath to the same destination, which would otherwise be unnoticed, if that can help making sense of the rules.
TheBuzzSaw wrote: Mon Apr 06, 2026 2:40 pm
Now, increase the priority of one of the stations. The
train will stubbornly target that station even when the other one is free.
As far i understand that is the intended purpose of the priority, to "force" a
train to go to the highest priority station, no matter if the "others" are available, this is what i think you can use to forbid a
train from changing destination.
The logic you have if i'm not mistaken is to try and distribute
train evenly to station that could receive them, if you have station A and B that can receive
train, you expect the distribution to be A B A B A B when the priority system is rather AAAA BBBB. If you change priority dynamically when a
train is en-route, it can and will repath to the new highest priority station if there slots available.
To distribute evenly trains, it's "easier" to have the priority fixed, and you open limit slot in the lower priority one only when the high priority one has a
train en route. If you have 2 station A and B, and A has the highest priority, it will have 1 limit slot open, and when this limit
train is occupied by a en-route
train, you can open a limit slot in the B station, so the next
train will go there, then if you open a slot for the A station again, it is possible that the
train going to B change destination, UNLESS there is another
train that has departed to A, because in such case the limit is full. It prevent the
train going to B to steal the newly open slot in high priority A station.
The suggestion to prevent a
train from changing destination i feel i read about it several time, specifically related to how the mod LTN function, i thought the priority system was a "solution" for "some cases", but i'm not sure i got the context right.