[2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Bugs that are actually features.
User avatar
ThePiachu
Inserter
Inserter
Posts: 37
Joined: Sat Aug 22, 2015 8:54 pm
Contact:

[2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Post by ThePiachu »

I wanted to make a neat system for processing scrap on Fulgora into a fully stacked belt, but there seem to be a few issues with that. Here is the blueprint I'm using:

Code: Select all

0eNqlVdtymzAQ/Rc9Sx2DjW2YaX8k42EErGNNhUR1cepm+PeuIMbYkZO4fUOXPXu05+zySirpoTNCOVK8ElFrZUnx9EqseFZchj3FWyAFMVCfagmGUPLLcyncCTclPINquDmRnhKhGvhNiqSnkXDnTaWZM1zZThvHKpBuFpT2O0pAOeEEjASGxalUvq0waZHQayTbIQU30Om0xTCtQjaEYvkipwTZsWy7/Zb1gc4NWEo/pBWDRKQzaB4HXU6gDdSiAcNq3VZCcafjLDdzQEoagSUebyRIEJVwRsuyggM/CoTAuDfgEs+aAcyG3fkKC7cXxrryIoA7dYHUURiHupGJ5XiDAa8PQYigvOPBBkkWVm3HzUC9ID9IUEd713l3644vo3cnpO2VK/dGt6VQiEWKPZcW+l0fq+fqguUAJKsPYOParC/abIdSxgxKScWDj9JIqmyWitc/mVAWzD1zbW6zzYRbxXWrham9QFEAny8kImMZnfGA0dMay3ruoIkOgtUGHFw1ndKmHUp9JdJ3Eh52bqcJQdQPBy9vCt9J/jiDmXpaiobtPchHMS6yCKMVewZu2MsBvgqEnvUWrguONj6CMdhF5SA19skfTJCsI65Y08jse++H1dTG75s4bkThoH0TvJmNSNsBNKzVjZfAlh/M2TE8lAn76IisNR6M/plWyGp4ICkWY0UjJ8ndk/TuyTJ06y5Src3jM3Xx6Uzd/hfonemfT6CVl580e3JN8bbZ4wq9/3kt/i3l9qsp0eoveCuY6mlJU7qi6Y7i14pm+LUbPROyTz97SrAP7ACardN8ledZlmbrZZr0/V9G3LAd
I have a Recycler feeding into a chest that is being emptied by a Stack Inserter with filters set by Decider Combinator. On paper it should be simple enough, but there are some problems.

First, if I let the chest have its full slot amount, for some reason it tends to fill up with like two kinds of items. Eventually it will process them, but for some reason for the longest time the Inserters would only output everything but Holmium Ore. I guess it's some kind of weird deterministic way Inserter filters are set with the Decider Combinator that grabs everything else first (maybe we could change it so highest item value would have the highest priority for the filter? That way things would balance easier). So I tried something else.

Since the Scrap Recycling can only output 12 different items, I set the chest to have only 12 slot open. The reasoning would be that you would always have some item to empty without overfilling the chest. But as it turns out this system tends to block. I find the chests with two stacks of the same item, but only having like, 3-4 items in each stack, while my Decider is waiting for 16 items. I'm guessing it's something due to the chest filling in from one direction while emptying from the other and so sometimes you have wonky numbers and things jam up. So I guess the only way to make sure the system doesn't jam is to have like, 15 slots for each item and then one extra to make sure you always have at least one set of 16 items to output... Or use train wagons and set the item filters in the storage I guess...

So at any rate, it would be nice if Factorio handled this edge case a little better - items should first go to any slots having the same item type in the chest, inserters should probably try emptying less filled slots first, and maybe inserter filter should get a priority based on how high a value is not to have chests that fill up with one item while all the others are being emptied...
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 199
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: [2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Post by Khazul »

Try putting a much faster stack inserter on it.
Last edited by Khazul on Sun Jan 12, 2025 1:33 am, edited 1 time in total.
Muche
Filter Inserter
Filter Inserter
Posts: 714
Joined: Fri Jun 02, 2017 6:20 pm
Contact:

Re: [2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Post by Muche »

Both issues look to be working as expected.

An inserter can filter maximum of 5 items at one time. It takes first 5 signals, based on signals ID (identical to craft menu order, I believe).
(For ideas/suggestions to change that see e.g. Filter inserters priority list / Filter inserters: Prioritise item pickup based on Set Filter signal levels).
Also, out of those 5 items, it prioritizes the "newest" items in the chest (furthest slot matching the filter).
Prioritizing can be also done with selector combinator, e.g. (this version has some uneven signal propagation delays, so occasionaly outputs 6 largest signals instead of 5)


If the recycler, while outputting an item (e.g. LDS), finishes a stack in a later slot (e.g. 10), it then pushes the remaining items into earlier slot (e.g. 1).
Now there are e.g. 2 LDS in slot 1 and 50 LDS in slot 10.
Stack inserter takes 3x16, leaving 2 LDS in slot 1 and 2 in slot 10.
User avatar
Khazul
Fast Inserter
Fast Inserter
Posts: 199
Joined: Fri Sep 03, 2021 4:47 am
Contact:

Re: [2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Post by Khazul »

Muche wrote: Sun Jan 12, 2025 1:25 am Both issues look to be working as expected.

An inserter can filter maximum of 5 items at one time. It takes first 5 signals, based on signals ID (identical to craft menu order, I believe).
(For ideas/suggestions to change that see e.g. Filter inserters priority list / Filter inserters: Prioritise item pickup based on Set Filter signal levels).
Also, out of those 5 items, it prioritizes the "newest" items in the chest (furthest slot matching the filter).
Prioritizing can be also done with selector combinator, e.g. (this version has some uneven signal propagation delays, so occasionaly outputs 6 largest signals instead of 5)


If the recycler, while outputting an item (e.g. LDS), finishes a stack in a later slot (e.g. 10), it then pushes the remaining items into earlier slot (e.g. 1).
Now there are e.g. 2 LDS in slot 1 and 50 LDS in slot 10.
Stack inserter takes 3x16, leaving 2 LDS in slot 1 and 2 in slot 10.
Still same problem - there is a chance that an emptied slot will be filled by an item that already needs to be removed (filled another slot) because the stack inserter is too slow. Eventually there recycle may get stuck as it cant output the item it needs to. Stick a legendary one in for eg and then it works fine in either case. If you want to use slower inserters, use a slower recycler machine or have multiple inserters emptying the box so they can keep up.

Also probably only needs one legendary bulk inserter.
User avatar
ThePiachu
Inserter
Inserter
Posts: 37
Joined: Sat Aug 22, 2015 8:54 pm
Contact:

Re: [2.0.28] Scrap recycling into a chest with stack inserter output gets stuck

Post by ThePiachu »

Then I guess it sounds like a race condition bug. Faster stack inserter might be a way to mitigate it, but leave it to Factorio players to also surround a Legendary Recycler with Legendary Speed Legendary Beacons to exceed that throughput anyway.
Post Reply

Return to “Not a bug”