Stopped trains effect on train stop selection

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
ShadowTheThird
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Apr 04, 2025 3:48 pm
Contact:

Stopped trains effect on train stop selection

Post 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
Loewchen
Global Moderator
Global Moderator
Posts: 10237
Joined: Wed Jan 07, 2015 5:53 pm
Contact:

Re: Stopped trains effect on train stop selection

Post 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.
robot256
Smart Inserter
Smart Inserter
Posts: 1236
Joined: Sun Mar 17, 2019 1:52 am
Contact:

Re: Stopped trains effect on train stop selection

Post 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.
My mods: Multiple Unit Train Control, RGB Pipes, Shipping Containers, Rocket Log, Smart Artillery Wagons.
Maintainer of Auto Deconstruct, Cargo Ships, Vehicle Wagon, Honk, Shortwave.
ShadowTheThird
Manual Inserter
Manual Inserter
Posts: 2
Joined: Fri Apr 04, 2025 3:48 pm
Contact:

Re: Stopped trains effect on train stop selection

Post 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
Post Reply

Return to “Gameplay Help”