Train delivery to defensive lines

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Wolfund
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Apr 15, 2025 4:34 pm
Contact:

Train delivery to defensive lines

Post by Wolfund »

Hello !

I've been wanting to make a simple train setup to push ammo, repair kit, walls and such from a central Supply Train Station to my different Defensive line stations. The train is a one wagon, one fluid wagon fill with light oil.

I have zero understand of logic circuit or nearly zero (basically I know how to make an insert stop insert things in a chest as well as have chest only taking some items and that's about it) and I can't figure out how to make the train wagon take multiple items like :
300 walls, 1000 ammo, 300 repair tool etc... and STOP at those numbers I don't want/need the train filled to the brim with supply, just a couple hundred of everything so the train can go tour the station after attacks for maintenance.

And I have not a single idea how to make sure the defensive station can request the items they just need from the train and not empty the wagon every time (I haven't come around designing it but after bashing my head against the supply station... think like it's also going to be a major pain...)

So could someone explain to me like I'm a two year old how I can do that ?
Tertius
Smart Inserter
Smart Inserter
Posts: 1207
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Train delivery to defensive lines

Post by Tertius »

I guess it's not useful to post a sophisticated fully working circuit controlled station blueprint, since that would be a blackbox for you and you don't know what to do if some issue arises.

But it's possible to build supply stations with a minimum amount of circuits, almost none.
The key is the slot filtering feature of train wagons. You're able to middle-click every slot of a wagon inventory and set a filter. So set filters for every slot with the items you intend to load into that wagon. This way you have a well defined amount for every item.

You're able to load up to 12 different item types into a wagon by placing 6 inserters+requester chests on each side of the wagon. Request a different item with each requester chest. This will be loaded into the corresponding filtered slot of the wagon, so you will not load more than you reserved by filtering.

Unloading is about the same: 2x6 inserters+passive provider chests for every item. Use a filter on each inserter to unload exactly one item type, and limit the amount to unload by blocking the slots in the destination chest.

Up to this, this works completely without circuits.

Now you want the supply train visiting the unloading station only if there is demand. Not if all the slots are already full. A little bit of circuit can help to activate a station only if there is demand and deactivate it if all items are full stocked.

Considering you unloaded into logistic chests, an inventory of all items can be acquired from a roboport, if you connect a circuit wire. Set it to 'read logistic network contents". This is the amount you have.
Now build a constant combinator and add signals for every item you want the station to contain and how much. This is the amount you want.

Add a decider combinator. With green wire, connect the roboport with the input of the decider. With the other wire color (red), add a wire from the constant combinator to the input of the decider.
Add a condition to the decider combinator. Set it to EACH(green) < EACH(red). For the first EACH check the green wire only, for the second EACH check the red wire only. This way each signal from the roboport is compared to the corresponding signal from the constant combinator. The decider generates internally a list of all signals matching the condition, i. e. a list of all signals where the amount from the roboport is less than the amount from the constant combinator. These are the signals where items are missing.
As output of the decider add a simple <green check mark>=1.
The whole decider generates an output, if at least one of the EACH comparisons are true. So if at least one item need resupply, the whole condition is true and the check mark is set to 1.
Wire the output of the decider to the train station and configure the activation condition of the station. Set it to activate if (green check mark) > 0, so whenever an item is needed, the station gets activated and a train will be requested. Set the train limit to 1 to avoid multiple trains getting there.

And that's it.
To have some kind of hysteresis, i. e. to not request a train if a single repair pack is missing, set the slot filter of the unloading chests to contain more items than you configure in the constant combinator. The constant combinator defines the minimum amount of items, the filtered slots define what's actually being unloaded - can be more.

This general setup ignores some details, for example you need proper waiting conditions to make the train wait while being loaded/unloaded and leave if the work is done or cannot be done. The best all-round condition is the inactivity condition: if there is no activity any more for 20 or 30 seconds, the train can leave.
Premu
Fast Inserter
Fast Inserter
Posts: 150
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: Train delivery to defensive lines

Post by Premu »

Just to show you an example - that's my wall BP book, including train stations for the main base to resupply and stations for the wall sections to deliver. In my case I have two different trains: One building train which is mostly used in the actual setup of the wall and delivers everything which is needed to actually build it, but can also replace losses for walls, turrets, etc. should these ever happen. And a second train providing ammo, repair kits and oil for the flamethrowers. The overall technique is as described by Tertius.

You can compare my blueprints to your needs if you need an inspiration.

Although one small correction: You can actually load up to 24 different goods in a single train car if you use two rows of requester chests on each side and fill the train with long inserters. You can see that for one of the train cars in my blueprint book, actually.

Last edited by Premu on Wed Apr 16, 2025 4:04 pm, edited 1 time in total.
Tertius
Smart Inserter
Smart Inserter
Posts: 1207
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Train delivery to defensive lines

Post by Tertius »

Premu wrote: Wed Apr 16, 2025 2:38 pm You can actually load up to 24 different goods in a single train car if you use two rows of requester chests on each side and fill the train with long inserters. You can see that for one of the train cars in my blueprint book, actually.
Good idea, however you seem to have left out this one and instead added the same unloading station twice (Haltestelle Bauzug and Bauzug Mauer) in your blueprint book.

By the way, your flamethrower turret density is much too high. A sufficient spacing is to put an underground pipe at maximum distance between 2 flamethrower turrets. Damage with this spacing is still enough.

And it's a matter of taste, but I found gun turrets are inferior to laser turrets for perimeter defense. It's a chore to build and supply all these turrets. Laser turrets just need electricity, that's all. A spacing of laser turret - 2 tiles space - laser turret - 2 tiles space - and so on is sufficient according to my experience. In frequently attacked areas, it might be useful to fill the spaces with more laser turrets as well.

You could add some kind of dragon teeth to the wall, so the biters are stalled before they attack, so there is less damage to the walls.

And I don't supply the flamethrower turrets with oil barrels. Instead, I just connect the nearest oil well with the one big perimeter oil supply pipeline. That pipeline goes around my whole base and is just divided by the 320 tile restriction, where I place a pump to keep up oil flow. Crude oil is sufficient, no need to use any other. One single oil well is enough for the whole perimeter defense, even for a megabase.
Premu
Fast Inserter
Fast Inserter
Posts: 150
Joined: Wed Nov 13, 2019 4:40 pm
Contact:

Re: Train delivery to defensive lines

Post by Premu »

Tertius wrote: Wed Apr 16, 2025 3:03 pm
Premu wrote: Wed Apr 16, 2025 2:38 pm You can actually load up to 24 different goods in a single train car if you use two rows of requester chests on each side and fill the train with long inserters. You can see that for one of the train cars in my blueprint book, actually.
Good idea, however you seem to have left out this one and instead added the same unloading station twice (Haltestelle Bauzug and Bauzug Mauer) in your blueprint book.
Oh, good find - I corrected the BP and edited it in my original post.
Tertius wrote: Wed Apr 16, 2025 3:03 pm By the way, your flamethrower turret density is much too high. A sufficient spacing is to put an underground pipe at maximum distance between 2 flamethrower turrets. Damage with this spacing is still enough.

And it's a matter of taste, but I found gun turrets are inferior to laser turrets for perimeter defense. It's a chore to build and supply all these turrets. Laser turrets just need electricity, that's all. A spacing of laser turret - 2 tiles space - laser turret - 2 tiles space - and so on is sufficient according to my experience. In frequently attacked areas, it might be useful to fill the spaces with more laser turrets as well.

You could add some kind of dragon teeth to the wall, so the biters are stalled before they attack, so there is less damage to the walls.

And I don't supply the flamethrower turrets with oil barrels. Instead, I just connect the nearest oil well with the one big perimeter oil supply pipeline. That pipeline goes around my whole base and is just divided by the 320 tile restriction, where I place a pump to keep up oil flow. Crude oil is sufficient, no need to use any other. One single oil well is enough for the whole perimeter defense, even for a megabase.
Hey, there's no kill like overkill! The bonus for this is that the actual wall is purely cosmetical, the biters never make it that far.

Besides, suppyling the flamethrower turrets with a train instead of just connecting a nearby oilwell has the advantage that you don't necessirily have a nearby oilwell to all wall sections. I at least don't have that as my ressource spots are spread out thinly. Oh, and if you can supply it with light oil easily it's just a nice bonus on top which you can incooperate in your defenses. 10% extra damage doesn't hurt at least. Well, unless you're a biter, of course. :lol:
Wolfund
Manual Inserter
Manual Inserter
Posts: 2
Joined: Tue Apr 15, 2025 4:34 pm
Contact:

Re: Train delivery to defensive lines

Post by Wolfund »

alright thanks for the help but after this bit >
Add a decider combinator. With green wire, connect the roboport with the input of the decider. With the other wire color (red), add a wire from the constant combinator to the input of the decider.
Add a condition to the decider combinator. Set it to EACH(green) < EACH(red). For the first EACH check the green wire only, for the second EACH check the red wire only. This way each signal from the roboport is compared to the corresponding signal from the constant combinator. The decider generates internally a list of all signals matching the condition, i. e. a list of all signals where the amount from the roboport is less than the amount from the constant combinator. These are the signals where items are missing.
As output of the decider add a simple <green check mark>=1.
The whole decider generates an output, if at least one of the EACH comparisons are true. So if at least one item need resupply, the whole condition is true and the check mark is set to 1.
Wire the output of the decider to the train station and configure the activation condition of the station. Set it to activate if (green check mark) > 0, so whenever an item is needed, the station gets activated and a train will be requested. Set the train limit to 1 to avoid multiple trains getting there.
You all completly lost me.

And the blueprint might as well be in Chinesse ASCII xD When I said I had absolutely no understanding of logic circuit I really meant that, I don't even understand how the darn things work, how to read the information I'm given or what any of this does. Really my absolute upper limit is to link a inserter to a chest and tell him keep things in there at X number. and that's the most complicated thing I understand from that side of the game.

Thanks for the help anyway, but I guess I'll keep sending the train by hands whenever XD
Tertius
Smart Inserter
Smart Inserter
Posts: 1207
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Train delivery to defensive lines

Post by Tertius »

Wolfund wrote: Thu Apr 17, 2025 2:05 pm And the blueprint might as well be in Chinesse ASCII xD When I said I had absolutely no understanding of logic circuit I really meant that
For guides/tutorials about the circuit network, see the wiki:
https://wiki.factorio.com/Circuit_network

and:
https://wiki.factorio.com/Tutorial:Circ ... k_cookbook
https://wiki.factorio.com/Tutorial:Combinator_tutorial

If your issue is purely the enable/disable station mechanics in my example, fall back to a completely static train setup with completely static schedules. Name your defensive line stations all differently, for example wall1, wall2, wall3, ... Name your base station that performs refilling the train base1. As first schedule entry put base1 with waiting condition inactivity 20s. Next schedule entry wall1 wit inactivity 20s as well. Next entry wall2 and so on. This way your train first gets filled, then will visit all your wall stations one after the other, then go back to refill, then start again.
NineNine
Filter Inserter
Filter Inserter
Posts: 346
Joined: Mon Oct 24, 2022 11:20 pm
Contact:

Re: Train delivery to defensive lines

Post by NineNine »

Tertius wrote: Thu Apr 17, 2025 3:50 pm
Wolfund wrote: Thu Apr 17, 2025 2:05 pm And the blueprint might as well be in Chinesse ASCII xD When I said I had absolutely no understanding of logic circuit I really meant that
For guides/tutorials about the circuit network, see the wiki:
https://wiki.factorio.com/Circuit_network

and:
https://wiki.factorio.com/Tutorial:Circ ... k_cookbook
https://wiki.factorio.com/Tutorial:Combinator_tutorial

If your issue is purely the enable/disable station mechanics in my example, fall back to a completely static train setup with completely static schedules. Name your defensive line stations all differently, for example wall1, wall2, wall3, ... Name your base station that performs refilling the train base1. As first schedule entry put base1 with waiting condition inactivity 20s. Next schedule entry wall1 wit inactivity 20s as well. Next entry wall2 and so on. This way your train first gets filled, then will visit all your wall stations one after the other, then go back to refill, then start again.
I couldn't agree more. Only build that sort of complexity if you want to. You definitely don't need to. I don't personally tend to build complex circuit systems because I don't really enjoy it. (I'm very far past the game completion, too.)

Or, work towards that level of complexity if you want to learn to do things like that. But consider stepping back from the Internet, and start with building simple rail systems on your own, and adding in circuitry later. That way you can learn how the game works by playing it, instead of trying to duplicate the work of somebody who has spent a long time in the game, already. In my experience, people tend to have a lot more fun that way.
Post Reply

Return to “Gameplay Help”