Factorio

Factorio

View Stats:
Dexter Aug 21, 2019 @ 10:00am
Precise Supply Train Loading
Hello there,

I'm looking for a way to auto load more than 12 different items (6 chests per side limit) into one cargowagon. I know there are plenty of blueprints out there but they all are rather complicated and do additional stuff that I am not (yet) interested in.
I have not yet fully wraped my head around all the circuit network stuff and I need something simple that only does one thing so I can check it out and understand it.

I am really stuck at this, the design I came up with is, due to my limited knowledge, flawed and inefficient. As mentioned above it's limited to 12 items per wagon and it involves reserving slots.

The goal here (besides having a working automated supplytrain loading station) is to understand more about circuit network, so any information and pointers are much appreciated.

Greetings

< >
Showing 1-12 of 12 comments
Fel Aug 21, 2019 @ 10:31am 
If you don't mind the loading/unloading taking a bit longer and the belts being much more complex, the limit is actually 24 different chests if you use red inserters instead.



But since you seem to just want hints about the circuit network instead of a pre-made solution, here is how you can setup a "test" site to fiddle with things:

Get 2 chests and a filter inserter (stack or not doesn't matter) as well as wires, as many decider combinators as you want "filters".
There is also an advanced version that will allow you to precisely insert an exact amount , but when combining it with the filters it can rapidly grow out of hands in term of complexity so I'll leave that out (if you still want to tackle it you will need more decider combinators as well as arithmetic combinators with the amount you want as a constant in the first slot, minus the content of the chest that serves as an output).

Anyway, you want to wire the receiving chest into the decider combinator, set it to "whatever item you want" inferior to the amount you want, then set the output of the combinator to the filter inserter and set it to "set filters".
You do that for each item you want, then put items in the input chest to see if it works.
With just that it will often put a bit more than the quantity requested because of the hand size but as long as you set the amount low enough that it wouldn't pose problems even if each item got to 6 over that amount you will be fine.

In real uses you will probably be using this to pre-fill the chests that will then fill the wagons since you can just use filter on wagons to ensure that each item has enough space.

I don't know if this type of answer is enough for you, so feel free to say it if something is not clear enough (or if something is wrong of course since I have been known to make mistakes with things like this).
The Chaotic Coder Aug 21, 2019 @ 10:39am 
^^ Pretty much what Fel said ^^

One thing is you don't need a lot of decider combinators. Use 1 arithmetic combinator and 1 constant combinator.

The train stop is wired to the input of the arithmetic combinator. The A.C. is set to Each * -1, so it will output the negative amount of each thing that's on the train.

The output of the A.C. is connected to the filter inserters (which are set to "set filters". The output of the constant combinator is also connected to the filter inserters. The C.C. lets you set a bunch of channels for the amount of each item you want.

These 2 signals (the + one from the C.C. and the - one from the A.C.) will combine to equal "the amount that still needs to be loaded".

The inserter will respond to whichever signal is largest, which is the item the train needs the most of.

If sometimes having up to 6 extra of some items (do to the inserter stack size bonus) is objectionable, you can force the inserter to only move 1 item at a time, but this will of course slow down your loading time significantly.
Last edited by The Chaotic Coder; Aug 21, 2019 @ 10:40am
Dexter Aug 21, 2019 @ 11:45am 
Alright, thanx alot guys!
I'll go play around a little with your suggestions and probably will come back with some questions.

Havent thought of the red inserters, regulated filter inserters seem to be more elegant so I'll give it a try.

Just to clarify:

"... you want to wire the receiving chest into the decider combinator, set it to "whatever item you want" inferior to the amount you want,..."

by "inferior" you mean "<" right?

Greetings
Fel Aug 21, 2019 @ 11:49am 
Yes.

By the way, both solutions have their pros and cons, so try both and see what works best for you (and if you use mine you might also want to add a little something to make sure you don't refill the chests while the train is being loaded, adding the train's content is usually enough but if you want even more precision you would need to also read the inserters from the chests to the train)
Dexter Aug 22, 2019 @ 3:19am 
Yep, those two suggestions set me on the right path, I think I am now able to solve my problem and dive deeper into circuit networks... thank you!

One thing though Fel, I'm afraid I don't understand how the chests beeing refilled while a train is loading might cause problems. Isn't that a problem for unloading trains, because when loading trains the data that control the inserters come from the train and not the chests...?
Fel Aug 22, 2019 @ 4:14am 
It depends on how you do your wagons, if you set filters for all of the non-blocked slots it doesn't matter, but if you want it to work better for non-filtered wagons (for example if you use a "dispatch" type setup) you want to avoid situations where the chest gets refilled with the first item and the wagon gets completely filled by that item alone.
Dexter Aug 22, 2019 @ 6:37am 
Well, back again...

I have built a setup with A.C. and everything worked fine while I was testing. Ofcourse I was only testing with a train in station set to impossible departure condition (I guess you know where this is going).
So satisfied with the result I let it go and run its errands and after a few cycles... overflow...

I believe this is the cause:

"...The problem is that everytime the train arrives the inserter is active because it takes one tick to registrate the train contents..."

source:
https://steamcommunity.com/app/427520/discussions/0/1741090847742352042/#c1741090847742584874

I tested it by letting a train with no "need to refill" go to that station and all inserters do one swing regardless, so I guess this is it.

The solution they found would not work for me because it involves enabling/disabling the inserters. I use filter inserters, network sets the filter but does not let me enable/disable it with say a second signal....

How would you go on and solve this?

I noticed the trend to solve overflow issues (caused by this and by inserter stack size) by setting up something to remove excess goods from the cargowagons as part of the loading procedure. Seems a bit crude to me though...

Last edited by Dexter; Aug 22, 2019 @ 6:40am
Fel Aug 22, 2019 @ 7:05am 
My bad (about my now deleted post), I forgot that set filter and enable are mutually exclusive.

You have two solutions available to you, the first is to add a decider comparator with the signal from "read stopped train" sent by the train stop superior to (">") 0 and with the output "everything" to input count.
If all of the filters are empty it shouldn't be trying to put things before the signals are calculated and the filters set properly.

(EDIT because I posted too soon...)
The second solution is to use a roboport, preferably not connected to any other network that covers a single logistics chest that has inserters connecting it to a normal chest in addition to the train stop.
The inserters are wired to fill the logistics chest when a train is at the stop and to empty it when there is no train, you only need 1 item to do that role.
That way you can use the logistics network as the enable condition for your inserters.
It adds a small delay so I'm not sure how well it will work but it's worth a try.
Last edited by Fel; Aug 22, 2019 @ 7:11am
Dexter Aug 22, 2019 @ 7:44am 
Not sure if you mean the same thing but I think I tried your first solution:

I squeezed a Decider inbetween the Station and the A.C., made it to check for T>0 and output everything from input when true. This failed though and I think it's because the inserters then get only a positive signal from the Constant Combinator and do their one swing before the negative signal arrives from the Decider / A.C.
So the result is the same, one unwanted swing...

...this gives me a thought though, I could then put one more decider between the C.C. and the inserter, only forward that signal when train is there, too. Ofcourse it involves setting up many Deciders.

The roboport thing sounds interesting but the station is fed by the logistic network so I simply can't isolate it.

Well, I have ideas to play around with, thanx for the input mate!
Fel Aug 22, 2019 @ 7:58am 
I would put it after the arithmetic combinators instead of before, it should be able to completely block all signals from going through unless a train is at the stop.

The roboport thing can work while being in an already existing network, but the item you will have to pick would be one that you are certain will not be in any other place in that network.
Dexter Aug 22, 2019 @ 8:57am 
Tried that, too. Doesnt work, they still swing once on arrival as long as inserters still get that signal from the C.C. I was able to test some more and indeed it now works:

One Decider at station taking the train ID and turning it into let's say T=1, one additional Decider between every C.C. and inserter, only forwarding the requests of the C.C. when T=1.
The Decider after or before the A.C. (Wich I tried initially) can even be scraped because that signal with it's negative values will have no effect on it's own on the inserters it seems.

This works like a charm now, with inserter stack forced to 10 (ofc at unloading, too), no more overflow, even without reserved slots and even on not maxed out wagons.
The Chaotic Coder Aug 22, 2019 @ 12:25pm 
You just need 1 Dedicder Combinator receiving the combined signals from the A.C. and the C.C. as its intput, and sending the output to the inserters. Use a different colored wire connecting the train stop to the D.C.'s input. The condition on the D.C. is "anything > 0", and its output is every input value.

The D.C. will block the signals from getting to the inserters unless a train is there. Even if the train was completely emptied, I think the loco's fuel should still be read by the circuit.
< >
Showing 1-12 of 12 comments
Per page: 1530 50

Date Posted: Aug 21, 2019 @ 10:00am
Posts: 12