Page 1 of 1
Stopped trains effect on train stop selection
Posted: Fri Apr 04, 2025 3:57 pm
by ShadowTheThird
I have had trouble running the simulation myself so I hope someone has already wondered about that.
If I have 2 train stops with the same name and 2 trains that use that stop, assuming that all stops have the same priority and train limit of 2, when 1 of those stops is occupied by a single train (station is not full, because it has a limit of 2) can I assume the 2nd train will chose the empty station instead of the partially full one, or is it not guaranteed?
I am sure that the answer to that is somewhere on the wiki page, but I couldn't quite find it
Re: Stopped trains effect on train stop selection
Posted: Fri Apr 04, 2025 4:17 pm
by Loewchen
ShadowTheThird wrote: Fri Apr 04, 2025 3:57 pm
can I assume the 2nd train will chose the empty station instead of the partially full one, or is it not guaranteed?
No, the train stop is either full or not. Which station the train goes to depends solely on which has lower pathfinding penalty.
Re: Stopped trains effect on train stop selection
Posted: Fri Apr 04, 2025 4:19 pm
by robot256
The short answer is no. If both stops are the same priority and have at least one slot available, then the train will always choose the closest stop to itself (as the crow flies, not track length, IIRC). Trains do not change which stop they are bound for when they repath along the way, and they do not take into account path penalties like stopped trains or red signals.
An easy way to create the behavior you want is to use a simple combinator to set the stop priority to 50 - number of trains read from the stop.
Re: Stopped trains effect on train stop selection
Posted: Fri Apr 04, 2025 5:02 pm
by ShadowTheThird
Thanks for the help
robot256 wrote: Fri Apr 04, 2025 4:19 pm
The short answer is no. If both stops are the same priority and have at least one slot available, then the train will always choose the closest stop to itself (as the crow flies, not track length, IIRC). Trains do not change which stop they are bound for when they repath along the way, and they do not take into account path penalties like stopped trains or red signals.
An easy way to create the behavior you want is to use a simple combinator to set the stop priority to 50 - number of trains read from the stop.
I will be honest. I was fully prepared to setup an extensive circuits system that would check how many train stops are utilized and set the train limit from 1 to 2 to 3 accordingly, but messing with the priority is significantly easier lol