train stop limit reservation
Posted: Sun Apr 26, 2026 11:16 am
Background
I am working on a Clusterio plugin (Universal Edges / Gridworld) that stitches multiple Factorio servers into one logical world. Trains can cross between servers through portal entities. Cross-server pathfinding runs on a dedicated server, pathworld, that picks the destination stop before the train enters the destination instance.
For this to honour the target stop's trains_limit, the controller needs a way to reserve a slot on a remote stop. That is, advance that stop's trains_count for the limit comparison, to represent an inbound-but-not-yet-spawned train.
Current workaround
The only way I have found to advance the limit count is to spawn an actual locomotive on the destination instance with a schedule pointing at the stop, so Factorio's pathfinder counts it. Concrete pain points:
A scripting API to reserve and release slots on a LuaTrainStop without spawning rolling stock. For example, either a property to +/- or a handle for stop.reserve_slot() returning a handle, and handle.release() to free it. Reserved slots would count toward trains_count for limit comparisons but would not appear in the GUI, map, or train lists.
Thanks!
I am working on a Clusterio plugin (Universal Edges / Gridworld) that stitches multiple Factorio servers into one logical world. Trains can cross between servers through portal entities. Cross-server pathfinding runs on a dedicated server, pathworld, that picks the destination stop before the train enters the destination instance.
For this to honour the target stop's trains_limit, the controller needs a way to reserve a slot on a remote stop. That is, advance that stop's trains_count for the limit comparison, to represent an inbound-but-not-yet-spawned train.
Current workaround
The only way I have found to advance the limit count is to spawn an actual locomotive on the destination instance with a schedule pointing at the stop, so Factorio's pathfinder counts it. Concrete pain points:
- Rolling stock cannot overlap on rails, so I cannot stack multiple proxies for multiple inbound trains. The dev team has confirmed that this cannot be bypassed via collision_mask or not_colliding_with_itself. Rail occupation is enforced separately by the train physics layer.
- Proxies leak into the trains GUI, the map, train-stop filters, train list searches, and so on. Hiding them everywhere is a losing game.
- They consume rail real estate that should be free for real trains.
- Multi-surface train scheduling mods (LTN-style dispatchers) honouring stop limits without test-pathing real locomotives.
A scripting API to reserve and release slots on a LuaTrainStop without spawning rolling stock. For example, either a property to +/- or a handle for stop.reserve_slot() returning a handle, and handle.release() to free it. Reserved slots would count toward trains_count for limit comparisons but would not appear in the GUI, map, or train lists.
Thanks!