Factorio

Factorio

View Stats:
Frost Feb 1, 2021 @ 9:16am
Looking for idea (no mods) train: sit waiting for open station
I'm very experienced with trains, signals, even using the same name for a pickup station, disabling train stations if it doesn't have enough materials.

So I have a pickup station, which will be disabled if it doesn't have enough material to fill the train.
I used to have it so a train would sit at a dropoff station until it was empty, go fill back up and return. No problems.

But now I'd rather my dropoff train only show up if there's room to drop off all its materials and leave ASAP. I can disable the dropoff station until it has room to take all the materials off the train.

But this creates a new problem:

If a train only has 2 stops (pickup and dropoff) in it's schedule, and the next needed station is closed, it will either sit at a station or go into a loop to fill up when it's already full.

I want to create a "train yard" where a train will go and sit:
If it's empty, sit there waiting for an "available pickup station".
If it's full, sit there waiting for an "available dropoff station".

Is this too much for the current game / circuit abilities without a mod? I really do not have the desire to use a mod.

Any ideas?

I could probably pull it off if I create a circuit with wires, but that would require connecting far away stops with wires, which can seem unfeasible.

Curious what ideas others have.

I feel like I'm forced to keep the strategy of "train stay at the drop off until the train is empty and allow the train to show up at the dropoff even if the station is practically full already, while continuing to close pickup train stations that do not have enough material to fill the train asap".
< >
Showing 1-8 of 8 comments
Fel Feb 1, 2021 @ 9:24am 
What you are asking is a logistics network of sorts for trains, if you don't want mods I don't think you can do this without going into some pretty serious circuit network stuff and long distance wiring.

It's something many people playing with trains end up thinking about (not necessarily exactly like your idea but close enough), a decent amount even attempt it and a few manage to make something that works for their specific situation.

It's pretty complex and very prone to errors and signal pollution so good luck to you if you want to try your hand at it.
Frost Feb 1, 2021 @ 10:17am 
Originally posted by 76561198007674930:
What you are asking is a logistics network of sorts for trains,
I've heard of a "network train" mod of sorts - it solves this sort of thing and more? Maybe I'll take a peek at it.
Fel Feb 1, 2021 @ 10:33am 
I guess you are talking about this one?
https://mods.factorio.com/mod/LogisticTrainNetwork

It does take a bit of learning to get started but it's definitely worth a look when you want to do logistics stuff with trains.

It doesn't exactly work like you described, the trains stay at the parking unless an unloading station asks for something but it reduces the amount of required trains since it re-writes the schedules on its own and can support several networks at the same time if you don't want a single network taking care of all.
AlexMBrennan Feb 1, 2021 @ 10:35am 
Is this too much for the current game / circuit abilities without a mod? I really do not have the desire to use a mod.
This problem is solved by the 1.1 train limit: You will need four groups of stations: "wait empty X" (no stop condition), "load X" (wait until full), "wait full X" (no stop condition), and "unload X" (wait until empty).

Don't disable any stations but simply set the train limit to however many trainloads are available/needed. If there are no available stations then trains will wait at the "wait empty/full X" station, otherwise they will just drive through at full speed on their way to their next stop.

The downside is that waiting trains will keep flashing the "destination full" warning which is why I personally would still use circuits to make them wait but that's up to you.
Last edited by AlexMBrennan; Feb 1, 2021 @ 10:37am
Premu Feb 1, 2021 @ 10:59am 
The actual circuit isn't really that complicated. You need to have a complete network covering along all your rails, though.

For each dropoff station where you calculate the condition put it in the same signal (e.g. D). Link it not only to the station, but also to your data-bus along the railnetwork. Do the same with your pickup stations, but use a different signal name (e.g. P). Now the signals D and P on your data-bus will show how many dropoff or pickup stations are currently available.

Now create two waiting stations - one to be scheduled on the way from the pickup to the dropoff, one in the other direction. You can put a signal directly after these stations with a conditon to lock it if D respective P is 0, i.e. no dropoff or pickup stations are currently available.

This should work fine with one train serving several pickup and dropoff stations. You might run into issues if you try to use several trains on the same schedule, as you might end up with the "thundering herd" problem if you don't use the station limits introduced in the last version, though.
malph Feb 1, 2021 @ 2:26pm 
Just wrote this, it's bad english etc but i hope the principle will be understandable.
Pretty similar to other suggestions, but maybe some pictures will help.

https://steamcommunity.com/sharedfiles/filedetails/?id=2381416217
astrosha Feb 1, 2021 @ 7:38pm 
4 stations needed :
Wait Empty, Loading, Wait Full, Unloading. They need to go in that order.

Wait Empty and Wait Full would be no wait condition set at all. Loading, wait until full. Unloading, wait until empty.

At the loading stations :
Use a belt balancer to ensure that each 6 chest set for each cargo wagon gets the same amount of material. It does not matter how balanced or unbalanced the chests within each 6 chest set gets, so long as the entire set remains balanced with its brethren, thus the use of the balancer as opposed to a MadZuri. Wire all the chests together to an Arithmetic Combinator (Each / total capacity of train, output Each). Wire the output of the AC to the train stop. Enable when the contents of the station are >= 1. Set limit to that content signal.

Example : a 4 cargo wagon train is picking up Green Circuits. Each Cargo Wagon can hold 8000 circuits, so 32000 circuits is the train capacity. AC : Each / 32000, output Each. Train stop : Enable if Green Circuit >= 1; Limit Green Circuit.

At the unloading stations :
Use a belt balancer to ensure that each 6 chest set unloads evenly. Wire the chests together and go to an Arithmetic Combinator. Also add a Constant Combinator, set to the negative amount that the station can hold. Have the AC take Each / negative capacity of train, output Each. Send the output of the AC to the train stop, again enabling and setting the limit based on the station's unloading item.

Example :
That same 4 cargo wagon train gets to the unloading station. 4 wagons * 6 chests * 9600 = 230400 station capacity. Set the Constant Combinator to -230400. Wire this to the chests/Arithmetic Combinator. The AC takes Each / -32000, output Each. This result is sent to the train stop, where Enable if Green Circuit >= 1, Limit Green Circuit.

This works because the CC outputs the negative of the station at maximum capacity. The chests are then added to it by the circuit network, resulting in the total signal being how short of full the station is, but as a negative number. Dividing that by the negative gives a positive result, so we divide the space left by the capacity of one train to see how many trains are needed to fill the station.

The maximum station limit using this method will be 7. So plan your stackers accordingly. you can use a combination of Arithmetic Combinators and Decider Combinators to limit the number of trains if you want a max under 7.

This, of course, only works with homogenous trains, trains only carrying one cargo type. If you are mixing trains (such as a wall repair/resupply train carrying walls, repair packs, extra laser turrets and flamethrower turrets, as well as extra construction bots, pipes, and pipe to grounds, this method won't work.

Just make sure that the Wait Loaded and Wait Empty areas have enough capacity for all of your trains using this system.
Last edited by astrosha; Feb 1, 2021 @ 7:39pm
AlexMBrennan Feb 2, 2021 @ 6:46am 
Enable when the contents of the station are >= 1
This is a mistake - if you do this then trains will loop endlessly between the waiting areas if no provider or requester stations are available.
< >
Showing 1-8 of 8 comments
Per page: 1530 50

Date Posted: Feb 1, 2021 @ 9:16am
Posts: 8