Page 1 of 1

Limit trains routed to a stop

Posted: Sun Dec 01, 2019 8:12 pm
by Omnifarious
There is fundamental functionality that I feel is missing in Factorio that (given my very limited knowledge of the game internals) seems like it wouldn't be too hard to implement. This missing functionality results in mods that I think do too much (Train Supply Manager and Logistics Train Network) or mods that resort to extremely hacky solutions like Concurrent Train Restriction that make me reluctant to use them.

It would be really nice (even if it wasn't exposed in the base game in any way) if there was a way to limit the number of trains that can be routed to a stop and/or a way to query how many trains are currently travelling to a stop. The latter would allow circuit conditions to be set at other stops to hold the train there until the number of trains routed to a stop was less than a certain value. But... it has the issue that it's a loop between the circuit logic and the train dispatch logic that may require something like only one train being dispatched to a given stop per tick or something equally ugly.

Re: Limit trains routed to a stop

Posted: Tue Dec 10, 2019 2:06 pm
by Omnifarious
Does anybody have any opinions on this? This seems like a fairly simple primitive, that if implemented, would enable a lot of things.

Re: Limit trains routed to a stop

Posted: Wed Dec 11, 2019 9:56 pm
by IronCartographer
This is actually something mentioned before, by myself and others: viewtopic.php?p=258253#p258253

Given how much of a minefield train logic is, I wouldn't put too much weight on it happening...but it would be nice if there were a clean solution.

Re: Limit trains routed to a stop

Posted: Thu Dec 12, 2019 6:42 am
by Omnifarious
IronCartographer wrote:
Wed Dec 11, 2019 9:56 pm
This is actually something mentioned before, by myself and others: viewtopic.php?p=258253#p258253

Given how much of a minefield train logic is, I wouldn't put too much weight on it happening...but it would be nice if there were a clean solution.
Thanks for pointing me at that. :-)

Re: Limit trains routed to a stop

Posted: Fri Dec 13, 2019 2:21 pm
by mrvn
Maybe you could write a simpler mod that would work with station names with patterns.

For example name your station "Iron Plate 1", "Iron Plate 2", ... and then every time a train has "Iron Plate X" as next stop it would pick one of "Iron Plate 1" or "Iron Plate 2" depending on the number of trains for each station.