[0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

This subforum contains all the issues which we already resolved.
Post Reply
Nathan S
Burner Inserter
Burner Inserter
Posts: 5
Joined: Wed Mar 13, 2019 5:46 am
Contact:

[0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

Post by Nathan S »

Steps (from saved game):
  1. Load the attached saved game
  2. Open the inventory/crafting screen (E)
  3. Notice I have 57 iron plates, 10 copper plates, and plenty of free inventory slots
  4. Look at the combinators in the crafting pane
Actual:
Both combinators are disabled in the crafting pane.
Trying to craft a combinator, by left clicking on one of them in the crafting pane shows the floating message "Not Enough Ingredients".

Expected:
The combinator crafting buttons are enabled with the number 1 (crafting count limit).
I can build exactly 1 combinator by left-clicking on one of the buttons int the crafting pane.

(Note: The black at the bottom of screenshot is expected as this is a ribbon world)
Factorio Crafting Bug.png
Factorio Crafting Bug.png (171.87 KiB) Viewed 2932 times

Reproducibility: I can repro this every time I open this saved game (only started this map around 0.17.08 or so). I have not attempted to reproduce it from a new game state.
My thoughts on a potential cause:
  • At some point in the previous hour or two of gameplay, I ran out of inventory spaces when canceling some entries in my crafting queue. I think it may have been for copper cable.
  • I wouldn't be surprised if somehow I ended up with a fractional copper plate in my inventory as adding a single extra copper plate from a chest is enough to then build a combinator.
Log-File: Attached.
Save-File: Attached.
Attachments
factorio-current - Copy.log
(8.52 KiB) Downloaded 112 times
CannotCraftComparatorCopper.zip
(1017.51 KiB) Downloaded 123 times

ManaUser
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sat Aug 12, 2017 9:41 pm
Contact:

Re: [0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

Post by ManaUser »

I can replicate this in my own save. I doubt it has anything to do with canceling crafting earlier.

Here's what I think is happening:

How many copper plates do you need to make 5 copper cables? 3 (one cable left over)
How many copper plates do you need to make 5 electronic circuits? 8 (one cable left over)

3+8=11 Darn, you don't have enough.

You and I both know those leftover cables mean we only need 10 copper plates total, but apparently the algorithm isn't clever enough to spot this.

But interestingly if you do have 11 copper plates, it will work as expected, consuming only 10 and not leaving any extra cable in your inventory. So it would seem the actual crafting part is a bit smarter than the requirement check.

Altainia
Burner Inserter
Burner Inserter
Posts: 18
Joined: Sun May 20, 2018 5:27 pm
Contact:

Re: [0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

Post by Altainia »

I have my own observations to add to this:

When you have exactly the right materials to make a lamp (two iron plates and three copper plates) and nothing extra (so no copper cables), you are unable to hand-craft a lamp. It cites that you do not have enough ingredients. If you craft the electronic circuit needed for the lamp from those materials first, you will now be able to craft the lamp.

Furthermore, and probably related, if you have exactly the right amount of iron and copper plates to craft multiple lamps (and again, no spare copper cables or circuits) the game will count by two's. So if you have, for example, eight iron plates and twelve copper plates, the game will (correctly) show that you can craft four lamps. However, if you craft just one lamp, the game now shows that you can craft only two lamps. Despite that, you'll still have the resources for exactly three lamps. If you craft another lamp, the game will do so and will continue to show you can craft two lamps. Upon crafting yet one more lamp, it will now show you can craft none, though as above, you have the resources for one more.

Steps to reproduce this:
  • With lamp technology researched, have in your inventory exactly the following: 8 Iron plates and 12 Copper plates
  • Observe that, in the hand crafting menu, it is indicated you can craft 4 lamps.
  • Hand craft 1 lamp.
  • Observe that, in the hand crafting menu, it is indicated you can craft 2 lamps.
  • Observe that you have 6 Iron plates and 9 Copper plates (just enough for 3 lamps).
  • Hand craft 1 lamp.
  • Observe that, in the hand crafting menu, it is still indicated you can craft 2 lamps.
  • Observe that you have 4 Iron plates and 6 Copper plates (just enough for 2 lamps).
  • Hand craft 1 lamp.
  • Observe that, in the hand crafting menu, it is indicated you cannot craft any lamps.
  • Observe that you have 2 Iron plates and 3 Copper plates (just enough for 1 lamp).
  • Observe that you cannot hand craft any more lamps like this.
  • Hand craft 1 electronic circuit.
  • Observe that, in the hand crafting menu, it is indicated you can craft 1 lamp.
I'm imagining this is a simple rounding error.

ManaUser
Fast Inserter
Fast Inserter
Posts: 225
Joined: Sat Aug 12, 2017 9:41 pm
Contact:

Re: [0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

Post by ManaUser »

Also happens with red and green cables.

What all of these recipes have in common is that they contain an odd number of both copper cables and electronic circuits.

For comparison: Crafting an advanced circuit, which uses an even number of each, does not suffer from this problem.

This is consistent with my theory that the source of the issue is failing to recognize that the spare copper cable from the first part of the recipe can be used to complete the second. I guess that could be thought of as a rounding error, but I think it's a little more specific than that.

Twinsen
Factorio Staff
Factorio Staff
Posts: 1329
Joined: Tue Sep 23, 2014 7:10 am
Contact:

Re: [0.17.11] Unable to craft item due to "Not Enough Ingredients" even though inventory shows I have just enough

Post by Twinsen »

ManaUser wrote:
Wed Mar 13, 2019 7:10 am
Here's what I think is happening:

How many copper plates do you need to make 5 copper cables? 3 (one cable left over)
How many copper plates do you need to make 5 electronic circuits? 8 (one cable left over)

3+8=11 Darn, you don't have enough.
That's correct, the counting logic didn't account for the extra crafted items along the way.

Fixed in Version: 0.17.42.

I made some changes to the way the number of craftable items is calculated. Let me know if there are any issues introduced.

Post Reply

Return to “Resolved Problems and Bugs”