Multiple outputs from factory. Inserters priority question.

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Post Reply
Hooch
Inserter
Inserter
Posts: 20
Joined: Sun Jun 26, 2016 6:13 pm
Contact:

Multiple outputs from factory. Inserters priority question.

Post by Hooch »

Hell.
Quick question.

If there is factory with multiply output inserters. What is the mechanism those inserters use to take out from factory. Do they took equal share or is it random?

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by impetus maximus »

setting up an assembler to make gears it cycled the output inserters South, West, East, and North.
it repeated the same order every 4 gears.

Hooch
Inserter
Inserter
Posts: 20
Joined: Sun Jun 26, 2016 6:13 pm
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by Hooch »

So it ensures that output goes equally to all inserters. Great.

Tym
Long Handed Inserter
Long Handed Inserter
Posts: 66
Joined: Fri Feb 10, 2017 4:55 pm
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by Tym »

following up; if there are different -speed- inserters attached to an assembler, do the faster inserts get served before the slower ones? assume yellow and blue inserters.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by impetus maximus »

Tym wrote:following up; if there are different -speed- inserters attached to an assembler, do the faster inserts get served before the slower ones? assume yellow and blue inserters.
there will be a bias towards the faster inserter, but it still seems to share with the slower ones. tested in 0.15.21 with 'Creative Mode', and 'Nixie Tubes' mods.
[edit] the bias only happened when the output was faster than the standard inserters could keep up with. with a lvl 1 making gears it was 1:1:1:1
with a lvl 2 assembler the fast inserter output more gears than a standard one. [/edit]
screenshot

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by torne »

My guess would be that each inserter checks if there is anything to remove from the factory, and if not, adds itself to a wakeup queue associated with the factory. This just happens to give balanced behaviour with multiple same-speed inserters: they will probably start off cycling in the order they were built (since the first one to be built added itself to the queue first), and since they all take the same time to cycle back to their starting position, they will always reinsert themselves into the queue in the same sequence. If the inserters aren't the same speed, the faster ones might "jump the queue" ahead of a slower inserter which is still in the process of swinging.

If that's how it works (which seems likely to me given the observed behaviour and past dev comments about wakeup queues in the engine) then it's guaranteed that each inserter will get *some* amount of product (none will be completely starved) but you aren't guaranteed to get an even split in all cases even if the inserters are the same speed: for example if the inserters have a stack size of 2 and the factory produces 3 items in the time it takes the inserters to cycle once, then one of the inserters will always pick up 2 items and the other will always pick up 1, leading to unbalanced output.

torne
Filter Inserter
Filter Inserter
Posts: 341
Joined: Sun Jan 01, 2017 11:54 am
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by torne »

Hm, actually, it might not be starvation-free: it depends on the order of evaluation. It might be possible for an inserter that returns to its starting position on the exact same tick that the factory produces an item to "jump the queue" if that happens to be processed before the wakeups happen, because I don't think machines go into the queue if their inputs are already available (as that would be wasteful). That seems like a tricky experiment to set up..

User avatar
Ranakastrasz
Smart Inserter
Smart Inserter
Posts: 2124
Joined: Thu Jun 12, 2014 3:05 am
Contact:

Re: Multiple outputs from factory. Inserters priority question.

Post by Ranakastrasz »

Really? When did this get added. I've been irritated since i started having multiple output directions that one inserter hogs the entire output till it backs up.

Gotta re-test this.
My Mods:
Modular Armor Revamp - V16
Large Chests - V16
Agent Orange - V16
Flare - V16
Easy Refineries - V16

Post Reply

Return to “Gameplay Help”