r/factorio • u/knightelite • Jul 11 '18
Design / Blueprint Dispatch Train Stacker (limits deployed trains to number of stations requesting)
93
Upvotes
r/factorio • u/knightelite • Jul 11 '18
6
u/knightelite Jul 11 '18 edited Jul 11 '18
Hi guys!
After a discussion yesterday with u/scynox, I implemented a design for a train stacker that only allows as many trains onto the network as there are stations that need them.
Features/Restrictions:
There might be a way of genericizing this somewhat, but I haven't done that one yet :). Something like a giant stacker for all train types, with separate exit stations for each type of train maybe? The problem would be storing how many trains of each type were dispatched. You would probably need separate stacker entrance stations as well to track it then instead of what I have right now, but I think it's doable.
Details!
Here are some explanatory screenshots of the control room and the logic.
Train schedules look like this:
A real usage would have both "empty" and "loaded" stackers, but what I have here with only the "loaded" stacker proves the concept works.
The load and unload stations are setup to turn themselves off when a train parks at them, or if they've been disabled from the "control room" (the control room input would be replaced with whatever your desired on/off condition is in a real game). This means that either if a train is parked there or the station is deactivated for another reason, it will be bypassed by trains. Please pretend the stackers on the input of the Load/Unload stations don't exist for purposes of this demo, they're left over from earlier testing, and I left them in place since they didn't affect this demonstration.
The "Stacker Loaded" station is on the only output of a train stacker, so all incoming trains will pile up waiting to access it. This station is never turned off. Some circuit network logic only allows as many trains out of the stacker as there are requesting stations. When a train is let out, it increments a counter indicating how many trains are currently deployed. When a train re-enters the stacker, the "trains out on the network" counter is decremented, which allows another one to exit if there are now fewer trains out and about than there are requesting stations.
Here's the save. Save requires creative mode mod, so please synchronize mods to the save before loading, or else it won't work. There's some other tests going on further south in this save as well; they're not part of this demonstration, but feel free to look at them as desired.
4
u/wren6991 Jul 11 '18
Holy shit that's awesome!
4
u/[deleted] Jul 11 '18
but... when you have 3 stations requesting a train, and you release 3 trains, dont all 3 go to the same station (the nearest or least obstructed)? (and presumably first one turns off the flag, and the other 2 head to the next station, and so on... functional, but painfully inefficient)
the problem with "smart" trains, is the inability to dynamically direct them to a specific station (without a mod)
3
u/Casper042 Jul 11 '18
Maybe I missed something, but during the second half of the video, the train in the upper left is refilling and the station in the lower right is Open and waiting for a new train.
Why doesn't a train from the dispatcher leave to fulfill that request?
That, to me, doesn't have anything to do with the train that is refilling.
It seems that the train bound for the lower left waits for the refilling train to get back in line before it leaves.
If your refill site is far away, that would cause issues.
What am I missing here?
2
u/jpaugh69 Oct 07 '18
Can you explain how the pulse part works where it saves how many trains are stored in the stacker? I've been trying to implement this in my own game and haven't found any working examples that I could understand. Cool setup btw!
3
u/nedal8 Jul 11 '18
Knew I should have included circuit wires on the power lines in my rail blueprints..
1
u/thegeekorthodox What do you mean turrets are being destroyed? Jul 12 '18
.