Page 1 of 1

Overriding inserter stack size via circuit network

Posted: Sun Apr 30, 2017 3:48 pm
by alexzzzz
What are the use cases for overriding inserter stack size via circuit network?

The potential use case is to be able to move the exact number of items from a chest/wagon to a chest/wagon regardless of the current stack size bonus. But it didn't work out as expected. Here I'm trying to move 41 lights from the left chest to the right chest:
0.jpg
0.jpg (119.96 KiB) Viewed 6512 times
The target chest always gets some random number of lights that is greater than 41. As far as I understand, the reason is that the inserter updates its stack size too late, after it already has grabbed the items.

So, the questions are:
1. Is it possible to solve this problem somehow (except manually setting the stack size to always be 1)?
2. What are the problems that automatic stack size override can actually solve? What is it useful for?

Re: Overriding inserter stack size via circuit network

Posted: Sun Apr 30, 2017 6:05 pm
by Linosaurus
This looks like a bug, might want to repost in the bug forum.

Shorter version.

A stack inserter configured with (Enable on A>0, set stack size with control signal=A).
It receives A=2: it moves 2 items at the time.
Change to A=0: it stops.
Change to A=3: it moves 2 items, then 3 at the time.

Expected value: 3 each time. Seems like it should checks stack size at the same time as it checks the enabled condition.

Speculation: stack size is only updated when it has just dropped off an item, or it is idle with nothing to pick up.

Re: Overriding inserter stack size via circuit network

Posted: Sun Apr 30, 2017 6:57 pm
by Tekky
Linosaurus wrote:This looks like a bug, might want to repost in the bug forum.
According to this post by a factorio developer, it is not a bug, but works as intended, for performance reasons. However, I hope that they find a way to fix this issue without sacrificing too much performance.

Re: Overriding inserter stack size via circuit network

Posted: Sun Apr 30, 2017 8:08 pm
by alexzzzz
Tekky wrote:
Linosaurus wrote:This looks like a bug, might want to repost in the bug forum.
According to this post by a factorio developer, it is not a bug, but works as intended, for performance reasons.
Yeah, I saw it, and it made me wondering what is the purpose of this feature then?

Re: Overriding inserter stack size via circuit network

Posted: Mon May 01, 2017 12:19 am
by Linosaurus
Ah I see it was known already.

I can't think of anything much I want to use it for right now, but I'm sure someone will use it for something insane sooner or later.

Re: Overriding inserter stack size via circuit network

Posted: Mon May 01, 2017 12:35 pm
by Tekky
Meanwhile, in the thread I have linked to in my previous post, a Factorio dev has stated that this issue now is on his todo list (but bugs have priority). Yay! :-)

Re: Overriding inserter stack size via circuit network

Posted: Fri May 05, 2017 4:58 pm
by Tekky
According to the bug thread I have linked to in my previous post, it has now been implemented for the upcoming patch 0.15.8.

Re: Overriding inserter stack size via circuit network

Posted: Fri May 05, 2017 6:24 pm
by Escadin
I use it to keep the Kovarex enrichment process running. A simple wire to a chest and your inserter only takes the excess of 40 U-235 out of your cycle... unless of course stack size is a dick and makes it take 2-3 at once dropping you down to 39 or 38.
This is where overriding stack size comes into play. Pretty straight forward use actually.

I also think it is mandaroty to combine with every counter circuit you use. Again, for example in the korvarex enrichment process if you want to count the exact amount of U-235 moved to trim down the hoarding of your centrifuge.