Page 1 of 1
How to organize train networks?
Posted: Sun Dec 10, 2017 9:58 pm
by alienwombat
Relatively new player here. I just finished the campaign by building some rather interesting factories. I think the technical term to describe them is "spaghetti". After that I've done some research, watching youtube etc., and decided that the first factory, that i launch a rocket with, has to be well designed, modular, efficient, colorful and highly over engineered.
My current idea is using a low throughput main bus to build everything that is very complicated, like all those science packs, or low demand, like rail signals. All high throughput stuff like smelting ore to iron and then turning those into green circuits should be done at separate facilities connected be railways.
Now i'm confused how i should set up a suitable railway system. The first part seems easy: I make i make an iron ore mining facility with an "iron ore pickup" train station. Then i make an iron smelting facility with an "iron ore intake" train station. This part seems easy to scale up. If i need more iron ore, i can have multiple trains from different mining facilities go to the same smelting facility. I just need a waiting bay and/or parallel train stops.
The part I'm confused about is the iron plate output. A lot of them have to go to the green circuit facility. A totally unknown number has to go to the main bus. And a very very small number has to go to towards making sulfuric acid somewhere else. How do i manage this one provider to many consumers scenario?
One idea I've had was using one output train station for every consumer, i.e. have an "iron ore for green circuits pickup" and "iron ore for sulfuric acid" train station and balance the iron plate output between them with "fair" splitters. Obviously the part going towards green circuits needs waiting bays etc. and the very low throughput part to the sulfuric acid can be very simple. But this seems hard to scale up, since i need a new train station for every new iron plate consumer, no matter how big or small the demand is.
The other idea was using one big "iron plate pickup" station with waiting bays and parallel train stops where every facility that needs iron plates can send a train to. But I'm afraid that could lead to starvation scenarios. If the iron plate production is too low, trains will get stuck in the "iron plate pickup" waiting bay. If the single train fetching iron plates for the facility with sulfuric acid never gets it's turn besides the many other trains carrying them other places, I will have a hard to fix bottleneck.
I'd be happy to hear any solutions (or get hints where to find them) for this problem, where of one facility supplies many other facilities with one product via a train network.
And one more, totally unrelated, question: is the the "Rail world" map generator setting a good idea for what in trying to do? I though about using a big starting area, to make sure i can get my factory really started before facing biters.
Re: How to organize train networks?
Posted: Mon Dec 11, 2017 2:23 am
by Zavian
What I do is have one or more trains for every consumer. So the main bus and green circuits would get 2-3 trains each (one train unloading, one loading, if transit times are long enough, one in transit). Things like sulfuric acid probably only need one train (the chests at the unloading station are probably enough of a buffer to keep acid producing whilst the train gets another load). Alternatively, if your refinery is close to the main bus you might just grab plates off the bus.
Regarding starvation, normally in such a setup it is self-limiting. If acid production stops, then green circuits start backing up and demand for iron plates drops, so those trains end up waiting at the green circuit iron unload, and there is less competition for iron plates for acid. In practice I find that if I over-design my smelters by about 5-10% then there are typically plates ready to be loaded, and my waiting bays for plate pickup are mostly empty. If iron plate production isn't keeping up, well then something is going to be short on iron plates until you add more smelting. The rational gets more complicated once you start having multiple loading stations for iron plate, but in general as long as my trains are using both loading platforms, and plate production is keeping up, then I find starvation isn't a problem in practice. If you do run into problems that way, then try to find the root cause. Trains queuing to load at one platform rather than using both loading stations is a possible cause, as is trains taking too long in transit. (If the distance between a producer and a consumer is high enough, and throughput need to be high, you might need 2 or more trains in transit at any one time).
I've never really been happy with the railworld preset. Ore patches always seem too small and close together for my tastes. Hopefully 0.16 will be better that way.
Re: How to organize train networks?
Posted: Mon Dec 11, 2017 12:07 pm
by Triaxx2
Two options, are train sizes. Option One is a single locomotive and two wagons, which is fast to accelerate, but will need to make more trips, while Option Two is one locomotive and four wagons, which accelerates slower, but moves much more ore. Personally I plan stations to allow for Option Two, while starting off with Option One. That saves materials early, and leads to only needing to upgrade, instead of rebuild stations.
I don't use waiting bays. If I have trains waiting, I find I've done something wrong. Something should always be in motion, if it's inserters, or trains it's fine. it's when they stop that something's wrong. Starvation is actually the goal. You want whatever your doing to be almost completely using up the train load before the new one arrives. That way as your next train is coming in, it's being completely unloaded. Buffering should be just enough to tide it over before the next shipment.
Railworld is okay, but I like to reduce the frequency and size one step, and boost the richness. That way you need to go find a lot of deposits to get the throughput you need, leading to a need for more trains.
Re: How to organize train networks?
Posted: Mon Dec 11, 2017 12:52 pm
by mrvn
Use the ability to name stations the same and to disable stations that shouldn't receive another train yet. Schedule all trains to have exactly 2 stops (pickup and delivery) and keep one end always activated while deactivating the other end as suitable.
I usually use a pull approach on smelters and refineries and a push approach everywhere else. Mines and crude oil stations are activated when they have sufficient items to fill a train. Trains sit at the smelter waiting for a mine to activate their station. Then they go and fetch the ore. On return they try to unload and hopefully the buffer chests are overflowing. Anyway, the train waits till empty before trying to go out again.
On the plate side I use a push approach, as mentioned. So again the trains sit at the smelter being filled till full. Consumers of plates are activated when their buffer chests have enough space for a full train (or are nearly empty if you don't want the completely full). When that happens the train leaves the smelter and delivers plates.
If you produce enough plates then all consumers will have their buffer chests full. Otherwise only the nearest one gets plates. But then it starts to back up because its consumer will wait for other products needing plates too. So it sort of self regulates. Mostly. Problem is science. It's easy for the science to eat all your plates leaving nothing for newer parts of the factory that are further away from the smelter. If you don't want to not research something for a while or build more mines and smelter then you can use circuit logic to activate stations on a priority basis.
If all that becomes to complex try the Logistics Train Network mod.
Re: How to organize train networks?
Posted: Mon Dec 11, 2017 3:23 pm
by Batou
I have done it this way, it is not ideal but works for me.
I have 2 bases that needs resources, Rocket base and sience base.
I have each Irone/copper/etc outpost set up with two or more loading stations with the same name, the resources are loaded evenly between the stations, and are set up with 2 or more trains, one or more are set up to go to sience base and one or more to rocket base. I use the circut network to send the train to the bases when needed. I have set up each of the bases to send out a signal when the amount of resources goes below a tresh hold, so if Iron is less then 250000 in the rocket base it outputs signal A=1, and i use diffrent signals for each resource at each base. Iron is A=1 in the rocket base, Copper B=1, and iron is k=1 in the sience base etc. The trains are setup to leave the loading stations if full and the coresponding signal is =1.
This serves two purposes, reduces the amount of total resurces in the factory at any time to reduse lag, and sending resources where it is needed the most, if one base uses less iron them the other, the resources gets spilled over to the other base as that train leaves more often. For example the sience base needs twise the amount of iron then the rocket base, in that case for every one train load that goes to the rocket base, two goes to the sience base.
This do have a down side, it might send 10 iron trains at the same time to the same base when iron is less then the tresh hold, but that is solved with multiple unload stations + a waiting area. With robots you can make the unload stations universal.
If all trains are full at an outpost and none of the bases needs the resource at that time, i simply turn off the power to the outpost with a circuit condition to stop production and reduce power usage, again to reduce lag. The factory will only produce the resource it can consume at any time.
Parts of the train logic ideas i stole from Nilaus
https://www.youtube.com/channel/UCD80bz ... Oqn7n0vKTg
I apologize for any spelling and grammer errors.
Re: How to organize train networks?
Posted: Tue Dec 12, 2017 10:34 pm
by alienwombat
Thanks for all those tips. I think i will use the Logistics Train Network mod.
Re: How to organize train networks?
Posted: Wed Dec 13, 2017 1:17 pm
by Frightning
Science packs actually eat a lot of raw materials in endgame especially (even while teching too). So I'd call that a fairly high throughput thing. For handling outgoing distribution: that's fairly easy, just have every consumer of that material have trains going to your loading station for output of said used material. As long as train throughput is high enough, the system will be regulated by backpressure. As trains that are taking more than is being used will eventually start waiting at their respective unload stations because they are backed up because their buffer chests are full. The real art for a modular train based base design is in deciding which processes to group together for each 'base module'. For example, it is probably a good idea to group all 3 circuit types into 1 largish module with lower tier circuits feeding into higher tier (as well as outgoing trains to other users of said circuits). Generally, logistics robots>belts once you have Requestor chests (Logistics network tech; which is 123PH science, so pretty late game).
Re: How to organize train networks?
Posted: Wed Dec 13, 2017 1:53 pm
by Deadly-Bagel
Heh, my first Bob's Mods game ended up a modular design connected by trains out of necessity. It was a very tree-heavy spawn area and the initial complexity shock can be difficult to overcome. I did as suggested here, each outpost had a "requester train" with filtered slots in roughly the ratios required by the outpost. Circuit logic ensured that when any material dropped low the train would do a full circuit - I considered it would be nice to just request the required material, but if it's going to be out and about anyway it may as well make the full trip and fill up on everything. Unless the demand for different products of the outpost vary wildly, trains shouldn't be leaving with much (if anything) in them.
However, Factorio isn't a game about "reaching the end", you should be finding your entertainment by designing solutions yourself. Something that meets your standards for efficiency, reliability, scalability, and over-engineering. For example, Triaxx2 says if he has trains waiting he has done something wrong, while I would argue that means you have machines that aren't doing anything and without care you risk locking up your train network. I ended up watching a Let's Play (just for something to watch) that told me a bunch of solutions before I had a chance to come up with my own, and I regret this, it's fun to see other ideas but have your fun first and then compare your solution to others'. About the only exception to this I would say is some circuit logic, I think everyone would seriously struggle coming up with an SR latch without at least knowing of the concept and basic principles beforehand.