This bug is largely related to the Production Scrap mod, but the root cause might impact other things.
Steps to reproduce:
1) Attempt to handcraft multiple items (craft 5 or craft all) that only have a partial change of success (largely the production scrap mod)
2) If doing craft 5, have just enough items for 5 (craft all will use all possible items, so this step doesn't apply)
3) The game will internally figure out how many will succeed, and when an intermediate product fails, will add another craft (I'm guessing a bit on this step)
4) When the internal "add another craft" occurs, and you don't have any more items in your inventory, this will happen
5) Note that this doesn't happen every time, since it is related to probabilities
What I expect to happen:
If the craft fails, then simply don't craft it (for the craft 5, you get less than 5; for the craft all, you just get less).
What actually happens:
You get a near infinite amount. I see 4.2G, which I think is 4.2 billion, which I believe is the max value of an unsigned 32 bit integer. I suspect there is an overflow (or rather underflow) issue.
The attachment show me attempting to craft 5 filter inserters, which have an intermediate craft of a fast inserter. You can see the 4.2G fast inserters in the handcraft queue. I definitely do not have the required billions of iron, circuits, or inserters to do this.
[kovarex] [0.17.23] Handcraft infinite free items
[kovarex] [0.17.23] Handcraft infinite free items
- Attachments
-
- Capture.PNG (224.3 KiB) Viewed 7590 times
- TruePikachu
- Filter Inserter
- Posts: 978
- Joined: Sat Apr 09, 2016 8:39 pm
- Contact:
Re: [0.17.23] Handcraft infinite free items
Possibly the fix would actually be to prevent using any recipies that have a branched success rate from being used as handcrafting intermediates.
Re: [0.17.23] Handcraft infinite free items
My thoughts as well.TruePikachu wrote: ↑Mon Apr 01, 2019 1:37 am Possibly the fix would actually be to prevent using any recipies that have a branched success rate from being used as handcrafting intermediates.
If you want to get ahold of me I'm almost always on Discord.
Re: [0.17.23] Handcraft infinite free items
I would be fine with that solution as well.
Re: [0.17.23] Handcraft infinite free items
What happens if you cancel that craft, biggest item spill in the history of Factorio?
Re: [kovarex] [0.17.23] Handcraft infinite free items
Thanks for the report.
We can still allow recipes with branching, it just needs to have non zero minimum always (which wasn't the case here). The calculator is assuming the worst possible case, but was broken with 0. Actually I got several debug-only asserts when I was trying to perform the craft.
Fixed for the next version.
We can still allow recipes with branching, it just needs to have non zero minimum always (which wasn't the case here). The calculator is assuming the worst possible case, but was broken with 0. Actually I got several debug-only asserts when I was trying to perform the craft.
Fixed for the next version.
Re: [0.17.23] Handcraft infinite free items
The game froze. I waited 20 minutes and eventually killed the processes. It might have been the biggest spill, but it also might have tripped something internally and never completed.
Re: [kovarex] [0.17.23] Handcraft infinite free items
Thank you sir!kovarex wrote: ↑Thu Apr 11, 2019 3:22 pm Thanks for the report.
We can still allow recipes with branching, it just needs to have non zero minimum always (which wasn't the case here). The calculator is assuming the worst possible case, but was broken with 0. Actually I got several debug-only asserts when I was trying to perform the craft.
Fixed for the next version.
Re: [0.17.23] Handcraft infinite free items
Yes: Of course the game's pretty well useless at that point because it's got all this stuff it wants to dump.
Denying intermediates seems more of a workaround to me; I'd prefer to see a solution where it sometimes works, but sometimes you just get the scraps and intermediates. You'd then try again, of course, because you did in fact want the thing you tried to craft in the first place - my need for that boiler isn't going to go away just because it got scrapped, and so that would deal with any leftover intermediates.