"Simple" Auto-scaling train supply depot

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
ruhroh
Burner Inserter
Burner Inserter
Posts: 16
Joined: Thu Sep 24, 2015 6:58 pm
Contact:

"Simple" Auto-scaling train supply depot

Post by ruhroh »

Still mostly a noob at this game...but I've finally worked through a design on my own without any direct help from the forums or youtube. That is to say, I didn't look at any other designs...only at the fundamentals like : "How does a combinator work?" and "What is an SR latch?".

It's one of my first designs that's made me genuinely happy. Thought it'd be worth sharing.(I hope?) Though, it wouldn't surprise me if something like this already exists...or if this design has some fatal flaw that I've overlooked...(Though it has been happily running for the last 10 hours of game-time...)

Works with version 2.0.23 of Factorio space age, no mods required.

Open to critique / improvement ideas as well...As I'd be incredibly surprised if I didn't screw up at least *something*.

The design

Basic automation photos for train and stops

What it does

But why

I also had/have the idea for a more detailed overview of this thing, explaining it in excruciatingly painful detail : the controller circuit, the SR-latch, etc...but I don't even know if anyone would actually be interested in such a thing...alas...lazy to the bitter end!

Hopefully this design was interesting enough to warrant the read...I know I at least had some fun with it...And it has significantly helped improve my sanity while setting up larger perimeters.

-Thanks for reading!
Tertius
Smart Inserter
Smart Inserter
Posts: 1322
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: "Simple" Auto-scaling train supply depot

Post by Tertius »

Consider using the real signals to compare if there is demand or not. Not the replacement signals (ghosts, lines).
You can multiply the demand by -1 and wire inventory + negated demand to the inserters, then activate the inserter if its item < 0.
Or you can directly subtract demand from inventory in an arithmetic combinator. Use one wire color for demand, the other wire color for inventory, and in the combinator check only the corresponding wire colors in the 2 operands, e. g. inventory[green]-demand[red]=difference. Then activate an inserter if its item < 0.
Or you use a decider combinator instead of the arithmetic combinator and compare inventory < demand, output EACH=1. This results in a 1 for every item where there is demand, so you can activate the corresponding inserter if its item=1.

Other ideas:
- consider adding a trash wagon to bring back trash/surplus items from the perimeter back to the home base. If you as player visit a perimeter roboport range, your trash items are emptied into the perimeter logistics network, which can be a blessing or a curse - depending on how you see it. This way you can bring back that trash to the home base.
- dynamically allocate space in the wagon and load/unload and allow an arbitrary number of different items. Currently, you're limited to 12 different items (if you use fixed inserters, one for each item, you cannot have more than 12 per wagon). There exist setups with a single inserter that extracts one item after the other instead of hardcoding one item in the inserter filter.
- Remove the necessity to define items in the interrupts. Instead, read the train content from the station and let the station circuits decide if the train needs a refill at the home base or can go to the next perimeter station.
- if you compute the exact number of missing items a I suggested above, use the exact number as inserter stack size and unload exactly this number of items with a bulk inserter. Not a single one more.
ruhroh
Burner Inserter
Burner Inserter
Posts: 16
Joined: Thu Sep 24, 2015 6:58 pm
Contact:

Re: "Simple" Auto-scaling train supply depot

Post by ruhroh »

Tertius wrote: Mon Dec 09, 2024 12:36 pmConsider using the real signals to compare if there is demand or not. Not the replacement signals (ghosts, lines).
You can multiply the demand by -1 and wire inventory + negated demand to the inserters, then activate the inserter if its item < 0.
I think I'm unsure exactly what kind of advantage this would provide for the controller as a whole...versus what's going on already...
Tertius wrote: Mon Dec 09, 2024 12:36 pmOr you use a decider combinator instead of the arithmetic combinator and compare inventory < demand, output EACH=1. This results in a 1 for every item where there is demand, so you can activate the corresponding inserter if its item=1.
The arithmetic combinators in this design are solely there to read the value of R provided by the roboports, and then multiply that value across all requested items, for each of the high/low thresh-holds as defined by the two constant combinators. Suppose I don't see how removing them would help improve what this design is doing...

Trash wagon is a nice idea...and would make remote station setups easier if bots could bring back the garbage from deconstructing. I thought about this, but haven't gotten that far yet. Could simply use the same wagon and allocate some empty/undefined trash space for it, use a requester chest to call for any junk items, and just have those passively fed back into the train any time it drops by.
Tertius wrote: Mon Dec 09, 2024 12:36 pm- Remove the necessity to define items in the interrupts. Instead, read the train content from the station and let the station circuits decide if the train needs a refill at the home base or can go to the next perimeter station.
Achieves the same thing though doesn't it? The interrupts just seem logically easier to me, and I only have to deal with them one time for the train anyway, so I'm not sure how this would be more advantageous than what's already going on?
Tertius wrote: Mon Dec 09, 2024 12:36 pmDynamically allocate space in the wagon and load/unload and allow an arbitrary number of different items. Currently, you're limited to 12 different items (if you use fixed inserters, one for each item, you cannot have more than 12 per wagon). There exist setups with a single inserter that extracts one item after the other instead of hardcoding one item in the inserter filter.
This seems pretty cool, but I think it falls outside the scope of what this design is trying to accomplish. Though I am already using the train'ss cargo to reserve slots for each item, so I only have to set the condition "Cargo full", vs. defining how many of each item gets put in there...rather than having to deal with any inserter automation at the main base.

Things I have to deal with once during setup don't bother me too much...it's if/when I have to change values over, and over...and over...
Cargo wagon
Tertius
Smart Inserter
Smart Inserter
Posts: 1322
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: "Simple" Auto-scaling train supply depot

Post by Tertius »

Some of my ideas are about manageability. Do you still understand this setup in a month? A single point of configuration would help with understanding the thing and more, with changing values and adding new items. Define lists of items in a constant combinator, use logistic groups to manage, since these are game global.

You have a very simple setup, if that works for you then it's fine. It's good as it is. However, you asked for comments, and I wanted to mention things beyond your current setup.

On the other end of the design type (simple versus sophisticated), there is a loading station where you define items to load in a constant combinator and an unloading station where you define items to unload in another constant combinator (not necessarily the same values as in the loader). You change one logistic group in the loader and one logistic group in the unloader, and every values for all stations are adjusted to new values at once. If your setup is too simple for everyday use for you in the long run, I just wanted to mention it's possible to build a more flexible thing as well, and with a not insanely high amount of combinators.

That is about reading the train content, reading the current inventory of the station, and reading the list of items you want to have at that station. Create diffs between what you have and what you want, then unload the diff as long as the train has enough.
Post Reply

Return to “Railway Setups”