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*.
- Only a single train needed, to supply multiple robo-port based outposts for perimeter defense
- Works in either a to/from, or loop setup. Shown above is the looped setup train config...but flip the 2nd train engine around and it does to/from without needing to change the station blueprint design. But if single line, then make sure there are no loops in the railway, because if the train turns itself around, then it'll show up to the stop backwards...and won't be able to unload.
- Automatically scales/adjusts the supplies needed at any given outpost using arithmetic combinators, based on the number of robo-ports in the network being supplied. Slap down another robo-port in that station's network? The station will adjust it's item demands for that automatically.
- Uses the almighty SR-latch, to only summon train-sama when any one supply type is low, refilling everything back to 100% during the supply visit.
- Indicator lights to show what the status is. Red = Needs supplies, Green = Reset state / Everything is at 100%, Yellow = after reset, supplies not at 100%, but not low enough for concern...
*** Red + Green at the same time = something is screwed up / I screwed something up / agggghhhhhhh
- Uses interrupts to keep train-sama from heading home if there are other outposts that need resupply. (Currently untested though/hasn't happened yet)
- Uses an interrupting interrupt to send train-sama back home if any one of its own supply items hits 0 in cargo. (Tested and working...)
But why
-- Because I'm inherently lazy, that's why...And also it was kinda fun! But also, also :
-- All outpost stations actually require having the same name for this to work, which is great! And it means no more having to name each and every single one of them...
-- Did I mention that it works using just one train? Yeah...No more multi-train waiting groups, loading stations...Rail...signals...ugh...no, that's just too much effort. With the addition of raised railways, having a single train dedicated to a single railway line, has helped me realize this dream.
-- No more changing parameters for each and every station. Sure, I could just dump a cargo train worth of items into every single station outpost, but that to me seems really inefficient, and just...well, bad. I want my [roughly] 100 repair packs, 50 walls, 10 logistic bots, 10 construction bots and 1,250 light oil for every roboport in the network at any given station...I don't want to have to count how many robo-ports I put down...or change any of the values for the combinators, grabby arms, pump...ugh...just, ack!, no.
-- A newly placed station will automatically summon the train, so long as it can get there. Given that the initial condition for the circuit will be 0 items in network, this *should* trigger the SR-latches "set" state condition...Which means I don't even have to interact with the train at all to get it there, so long as it's on autopilot. Can also keep that one train active and out resupplying things, while I go add in new outposts...which it will then come visit without me having to ask less than nicely...(So long...as it can path there...which would be my own fault)
-- Copies/uses the provided robo-port + chest settings to evenly store and distribute supplies across great distances. Having the items stored/distributed evenly next to each of the robo-ports cuts down on travel time, and helps keep the robos *behind* the walls. The 2x passive provider chests are there to store any minor excess the grabby arms happen to steal off the train...or any extra-extra supplies one might want sitting at the station.
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!
Re: "Simple" Auto-scaling train supply depot
Posted: Mon Dec 09, 2024 12:36 pm
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.
Re: "Simple" Auto-scaling train supply depot
Posted: Mon Dec 09, 2024 5:59 pm
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
Re: "Simple" Auto-scaling train supply depot
Posted: Mon Dec 09, 2024 6:43 pm
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.