[boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

This subforum contains all the issues which we already resolved.
Krydax
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 09, 2021 6:18 pm
Contact:

[boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by Krydax »

I believe there was a misunderstanding over in post viewtopic.php?t=127859

Based on Rseding's response, it sounds like they thought the "reported bug" was that the "hard item count limit" was changing. This is not the bug that we discovered and were trying to report. The bug is that the "hard item limit" is NOT greater than the "automated insertion limit" prior to researching any stack size upgrades for the inserter. This bug occurs even in vanilla factorio with zero mods, where inserters can get stuck with no player interaction. {and just for clarity, when I say "hard item limit", I mean the limit that is meant to be slightly larger than the automated-insertion-limit.}

If you load the saves in the linked thread you can see that the issue is that the insertion limit is a hard limit at 400 soil (rather than 404) when the inserter stack size is 1 and no upgrades have been done. It seems if you do inserter stack size upgrades, then it updates the hard limit to be [inserter hand size x 4 + 400], so that you could theoretically have 3 or 4 inserters swinging stuff towards an assembler in the same tick, when it was at 399 befeore, and they wouldn't get stuck. This is great. This is the desired behavior

The problem is that this is NOT the case at the beginning of the game with no stack size upgrades. It seems the hard limit is locked at a flat 400, and therefore inserters are getting stuck if they grab items at the same time (say from a warehouse) to insert into buildings that have an automated-limit that is larger than a stack of something (in this case, soil stack size is 200)

So I respectfully argue this is indeed a bug, as the behavior to prevent inserters from being stuck isn't applying at the beginning of the game when they are just stack size 1.

in the attached picture you can see an inserter hand being stuck. In vanilla factorio (not even modded).
03-30-2025, 08-35-57.png
03-30-2025, 08-35-57.png (964.85 KiB) Viewed 654 times
Repro steps:
  1. start a game, throw down a yellow assembler for nukes. Manually place 989 or some other odd number of copper in it close to 1000
  2. Place the chests as shown in pic, with inserters set up.
  3. Place copper in the bottom left chest, now the two inserters will be "in sync".
  4. Since they are in sync, when there is 999 copper, they both grab a copper and try to insert it
  5. Then you can see one gets stuck, since there is a *hard limit* of 1000, rather than 1004 (we would expect the 1004, to prevent inserter stuckage, and I say 1004 because it seems that the formula is [4 x hand size] once you start doing hand size upgrades)
- If the intent is that inserters do NOT get stuck due to the automated insertion limit (when its greater than the stack size of the item in question), then that intent is not functioning properly at the moment and there is a bug of some sort.

- If the intent is that inserters DO get stuck (which I'm pretty sure is not the case since Rseding described the functionality to change the hard limit to *prevent* them getting stuck). Then there's a bug with all the behavior after the upgrades (which again I doubt as that sounds like the proper behavior)
jameinel
Burner Inserter
Burner Inserter
Posts: 14
Joined: Thu Mar 31, 2016 7:20 am
Contact:

Re: [2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by jameinel »

I ran into this as well in a modded playthrough, but as noted, this can happen in a non-modded playthrough if you're using multiple inserters.

The comment from rseding here: viewtopic.php?p=667368#p667368 is saying that they intentionally take into account the stack limit to avoid inserters getting stuck, which is good. The problem is that even at a stack size of 1, you can get an inserter stalled if you have more than one inserter. Both inserters will notice "I don't have enough copper", and end up swinging to insert another copper.

I just reproduced with Vanilla in Sandbox mode (I did add Editor Extensions mod just to make it easier to force research). I can attach a save game if that helps.
But if I research Nuclear without researching Bulk Inserters I can get it to stall:
03-30-2025, 09-30-11.png
03-30-2025, 09-30-11.png (373.24 KiB) Viewed 606 times
Once I research Bulk inserter, the max limit changes:
03-30-2025, 09-18-08.png
03-30-2025, 09-18-08.png (480.77 KiB) Viewed 606 times
And I can manually add to the machine all the way up to 204:
03-30-2025, 09-19-00.png
03-30-2025, 09-19-00.png (544.17 KiB) Viewed 606 times
Note that these inserters don't yet have a stack size increase, but it is true that the bulk inserter has a stack size of 2.
If I then research up to max stack capacity, I can manually insert up to 244 gears:
03-30-2025, 09-20-57.png
03-30-2025, 09-20-57.png (371.81 KiB) Viewed 606 times
These are the numbers I got:
```
1 - 200
1+1 - 204
1+2 - 208
1+3 - 212
1+4 - 216
1+5 - 220
1+7 - 228
1+9 - 236
1+11 - 244
```

So it is quite clearly 4x the stack bonus. The request is to just make it 4x the total stack count. (eg 204 at the minimum, and 248 at the maximum, and presumably 264 with stack inserters).
User avatar
boskid
Factorio Staff
Factorio Staff
Posts: 3765
Joined: Thu Dec 14, 2017 6:56 pm
Contact:

Re: [boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by boskid »

Grimacing.

This is quite minor issue but i decided to take a closer look. There was indeed a margin for insertion that was set to 4 * bulk inserter hand modifier. When this modifier was 0, then the margin was effectively 0. For 2.0.44 i made this logic slightly more robust to account for non bulk inserters, bulk inserters, inserters with bonus given by prototype (which includes stack inserters since they have +4 by default from prototype) and as such the margin will be increased to be exactly 4 * max inserter hand size at a current point in time. This means if you have up to 4 inserters inserting the same ingredient they should not deadlock so easily. If you would have 5 or more inserters, then all bets are off.
Quintuple5
Burner Inserter
Burner Inserter
Posts: 5
Joined: Fri Nov 12, 2021 4:43 pm
Contact:

Re: [boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by Quintuple5 »

Thanks a lot Boskid, on behalf of the Py playerbase! This makes malls a lot more easy to make before researching the inserter capacity tech, which in Py can easily take 100 hours.
jameinel
Burner Inserter
Burner Inserter
Posts: 14
Joined: Thu Mar 31, 2016 7:20 am
Contact:

Re: [boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by jameinel »

Thanks a bunch, Boskid, much appreciated!
Krydax
Burner Inserter
Burner Inserter
Posts: 9
Joined: Fri Jul 09, 2021 6:18 pm
Contact:

Re: [boskid][2.0.43] Inserters Get Stuck Due To Insertion Limit > Stack Size

Post by Krydax »

Thank you! This is great news and makes me so happy :)
Post Reply

Return to “Resolved Problems and Bugs”