Page 1 of 1

[0.11.19] [kovarex] Crafting by hand with probability tag causes lockup

Posted: Tue Mar 31, 2015 3:38 pm
by bobingabout
Again, discovered while modding.

I made a recipe with the following peice of code.

Code: Select all

  {
    type = "recipe",
    name = "sort-gem-ore",
    energy_required = 1,
    ingredients =
    {
	  {"gem-ore", 2},
    },
    results =
    {
      {type="item", name="ruby-3", amount=1, probability = 1},
      {type="item", name="sapphire-3", amount=1, probability = 0.8},
      {type="item", name="emerald-3", amount=1, probability = 0.6},
      {type="item", name="topaz-3", amount=1, probability = 0.4},
      {type="item", name="diamond-3", amount=1, probability = 0.2},
    },
    subgroup = "bob-ores",
    icon = "__bobplates__/graphics/icons/ore/gem-ore.png",
    order = "f-a[gem-ore]",
  },
This is made perfectly by an assembly machine with no problems.
However, when made by hand causes the game to lock up, and start taking imense ammounts of CPU power and RAM (in excess of 4GB) to the point where my computer pretty much stopped responding, causing me to need to press the reset button. When the crafting recipe completes its cycle and would give you the results, you hear a chime like it's trying to send you a message as the game locks up. I can't see the message, the lockup freezes the game's image.

Further analysis shows that the issue is with the probability tag, when set below 1. (not tried above 1, why would you set a probability above 100%?)
The ammount of result items has no effect, with a probability tag or not, if any of them have a probability below 1, you get the issue.

note: this does not happen with mining, I have ores with probabilities to drop while mining and this works fine, the issue apears to be exclusive to crafting by hand.

Re: [0.11.19] Crafting by hand with probability tag causes lockup

Posted: Sat Apr 04, 2015 8:49 am
by MF-
There was a change in hadling the probability in 0.11.20 AFAIK.

Fixed the loot table probability calculation bug. (https://forums.factorio.com/forum/vie ... php?t=9277)

Re: [0.11.19] Crafting by hand with probability tag causes lockup

Posted: Mon Apr 06, 2015 2:47 am
by bobingabout
As you can see, also posted by me.
The bug does still exist in 0.11.20, I updated to it shortly after posting this bug report, and the error still exists.

Re: [0.11.19] Crafting by hand with probability tag causes lockup

Posted: Tue Apr 07, 2015 9:36 am
by kovarex
MF- wrote:There was a change in hadling the probability in 0.11.20 AFAIK.

Fixed the loot table probability calculation bug. (https://forums.factorio.com/forum/vie ... php?t=9277)
This has nothing to do with the loot table probability calculation, I will take a look at the bug.

Re: [0.11.19] [kovarex] Crafting by hand with probability tag causes lockup

Posted: Tue Apr 07, 2015 10:25 am
by kovarex
Ok, so I fixed the issue for 0.11.21. We actually never even tried the manual crafting of things with minimal amount less than 1.

Thx for the report.

Re: [0.11.19] [kovarex] Crafting by hand with probability tag causes lockup

Posted: Tue Apr 07, 2015 5:53 pm
by bobingabout
kovarex wrote:Ok, so I fixed the issue for 0.11.21. We actually never even tried the manual crafting of things with minimal amount less than 1.

Thx for the report.
And thank you for the fix! :)

As a temporary solution, I added it to the "Crafting with fluids" crafting group to force it to assembly machines only, when I get the update I'll remove the tag and try it again by hand.

Though in the next version, maybe I'll delete the recipe entirely, the only reason the unsorted gems item and gem sorting recipe exists is because of the issue with the mining drill not being able to drop all 6 types at once. If that problem is fixed, I don't need this anymore.

I'll at least test it again before I delete it though, it all helps build a stable, versitile game engine, am I right?

Re: [0.11.19] [kovarex] Crafting by hand with probability tag causes lockup

Posted: Tue Apr 07, 2015 7:50 pm
by kovarex
bobingabout wrote:
kovarex wrote:Ok, so I fixed the issue for 0.11.21. We actually never even tried the manual crafting of things with minimal amount less than 1.

Thx for the report.
And thank you for the fix! :)

As a temporary solution, I added it to the "Crafting with fluids" crafting group to force it to assembly machines only, when I get the update I'll remove the tag and try it again by hand.

Though in the next version, maybe I'll delete the recipe entirely, the only reason the unsorted gems item and gem sorting recipe exists is because of the issue with the mining drill not being able to drop all 6 types at once. If that problem is fixed, I don't need this anymore.

I'll at least test it again before I delete it though, it all helps build a stable, versitile game engine, am I right?
For sure! Once we get to steam, it will be very helpful that we fixed these hundreds of bugs, because it would just overwhelm us.

And also, we can now decide to use these features in the vanilla somehow without the fear of breaking everything :)