Train stop

Overview
A train stop is a rail-side building used to mark destinations for trains and to create loading, unloading, and transit stations. Every placed train stop appears as a selectable station in a train's schedule, and trains use those stops to plan routes and perform wait conditions. Physically a train stop shows indicator lights that communicate its state to the player and to passing trains.
Trains choose which stop to go to by name; when multiple stops share the same name the game evaluates stops by enabled state, train limit, priority, and pathfinding distance. A stop disabled by the circuit network is ignored when selecting a destination. A train limit can be set in the stop’s GUI or via the circuit network; only up to the configured number of trains may reserve that stop as a destination. A train limit of 0 behaves the same as a disabled stop. If a train is already en-route or parked when its target stop is disabled or its limit changes, the train completes its trip and wait conditions at that stop.
Stop priority (0–255, default 50) biases selection when multiple enabled stops with available capacity share the same name: trains prefer higher priority stops. Priority is considered when a train is dispatched; changing priorities while a train is en-route does not force that train to re-path. While en-route, a train may repath to a different valid stop with the same name if that stop has capacity; when it does so it stops counting toward the original stop’s train limit.
Pathfinding distance, not raw rail distance, determines which stop is considered closest. Pathfinding distance is influenced by the network state and other trains, so occupied or congested routes increase effective distance and cause trains to favor empty or less-congested stops if they are not too far away. Trains also apply a penalty to routes that pass through stops that are not their designated next destination, which encourages them to pick routes that avoid unnecessary stops.
Train stops integrate with the circuit network to provide and accept multiple signals. They can be enabled/disabled via circuit signals, have their train limit and priority set by the circuit network, output the ID of a stopped train, provide contents of a stopped train (inventory and fluids; note fluid quantities are rounded down to the nearest integer except amounts less than 1 are reported as 1), pass circuit signals to trains, and count how many trains are currently heading to the stop. These features enable complex automated train routing, dynamic station control, and congestion management.
The top-of-stop indicator lights convey state at a glance:
- Solid light: stop is unoccupied and available.
- Alternating blinking: a train is approaching or passing.
- Simultaneous blinking: a train is stopped/occupying the stop.
- No lights: the stop is invalid (e.g., not placed correctly).
- Blinking red: the stop is disabled by the circuit network.
Practical notes and tactics:
- Name stations consistently (e.g., "Iron Loading") to let multiple identical-loading/unloading stops be used interchangeably.
- Use train limits to throttle throughput and avoid queuing too many trains at a single station; set limits via GUI or the circuit network for dynamic control.
- Use priority to prefer certain stations (closer, higher-throughput bases) while retaining fallbacks; combine with train limits to implement overflow behavior.
- Disable stations with the circuit network to force rerouting or to temporarily close maintenance/extraction sites; trains already en-route will still arrive.
- Account for pathfinding behavior: occupied or blocked tracks make a stop effectively farther away, so spacing and bypass tracks reduce unintended route choices.
- Use stop outputs to detect arriving trains, read their contents for logistic decisions, trigger loaders/unloaders, or implement centralized traffic-management logic.