Page 1 of 1

[0.7.0] Assembling machine bug

Posted: Sun Sep 29, 2013 1:33 pm
by sword2410
I put to manufacture ammunition and realized that the assembler did not use iron and found that when I opened the menu ... :o

Try to get the iron, and ... surprise! you could get everything you want and does not decrease. :mrgreen: :mrgreen:

Re: [0.7.0] Assembling machine bug

Posted: Tue Oct 01, 2013 8:02 pm
by slpwnd
Are you able to reproduce this?

Re: [0.7.0] Assembling machine bug

Posted: Tue Oct 01, 2013 9:55 pm
by wrtlprnft
sword2410 wrote:Try to get the iron, and ... surprise! you could get everything you want and does not decrease. :mrgreen: :mrgreen:
Did you try filling your player's inventory with these iron plates at least 14000 times? Because you can only hold 7168 iron plates at a time (plus a couple in the quickbar slots), it will be a while until the change is guaranteed to show up in the rounded number.

On the other hand, try to mine your assembler for a huge item explosion (or more likely, a crash)!

On a perhaps more helpful note: 4.3G looks a lot like a 32-bit integer underflow.

Re: [0.7.0] Assembling machine bug

Posted: Tue Oct 01, 2013 10:24 pm
by sword2410
slpwnd wrote:Are you able to reproduce this?
I have not tried yet, but I will recreate the situation and I'll see if the bug repeats. :mrgreen:

Re: [0.7.0] Assembling machine bug

Posted: Tue Oct 01, 2013 11:01 pm
by n9103
wrtlprnft wrote:On a perhaps more helpful note: 4.3G looks a lot like a 32-bit integer underflow.
My money's on this.

Re: [0.7.0] Assembling machine bug

Posted: Wed Oct 02, 2013 9:21 am
by slpwnd
n9103 wrote:
wrtlprnft wrote:On a perhaps more helpful note: 4.3G looks a lot like a 32-bit integer underflow.
My money's on this.
Yeah :)

Re: [0.7.0] Assembling machine bug

Posted: Fri Oct 04, 2013 11:59 am
by slpwnd
This is probably related to the bug with inifinite item when crafting: https://forums.factorio.com/forum/vie ... =30&t=1370

Re: [0.7.0] Assembling machine bug

Posted: Sun Jul 06, 2014 2:33 pm
by Jinmago
Seems like the problem is not limited to the assembling machine.
Image
Version is 0.10.0 on 64 bit Windows
I'm using the Dytech Mod, so there might be something wrong with a research recipe as well.
Could it be possible for researches to require negative amounts of items?

Re: [0.7.0] Assembling machine bug

Posted: Tue Jul 08, 2014 11:42 am
by arl85
it also happened for me on Campaign mission #4: Coal available at starting mines was 4.3G but I thought it was intended...

game was 0.10.2 but started with 0.9.8

I'll try to find and post a save later

edit: you can find a save here
4_3G.png
4_3G.png (606.36 KiB) Viewed 5869 times
edit 2:
I found that there's a tile with a negative amount of coal (I removed drill in order to being able to inspect it).
what if the problem is that this tile has been mined by two different drills?
negativeAmount.png
negativeAmount.png (308.53 KiB) Viewed 5868 times

Re: [0.7.0] Assembling machine bug

Posted: Wed Jul 09, 2014 9:12 pm
by Jinmago
It is not actually a negative amount of coal, it's just a matter of how it's displayed.

The number -134 is the value of a 32 bit Integer in 2's complement representation:
11111111 11111111 11111111 01111010
The first 1 has a special meaning of: subtract 2^31 from the following number, so
Decimal(1111111 11111111 11111111 01111010) - 2^31 = -134
If you regard it as a ordinary binary number, you get
4294967162
Which are those ominous 4.3 B.
In the case of the campaign, the value of the coal is probably intentionally set to the number 111...111, which is -1 in 2's complement and 4294967295 in decimal.
In the case of the bug(s) there is likely some mechanism that subtracts more items from a stack that there are, the variable gets negative and we get what is displayed as 4.3B in short notation or a negative number in long notation.

Re: [0.7.0][kovarex] Assembling machine bug

Posted: Thu Jul 10, 2014 10:38 am
by slpwnd
This problem in the campaign has been fixed already afaik. Shouldn't happen in 0.10.2. Not sure what is causing it in the lab. If you guys have save + reproducible steps that would be great.

Re: [0.7.0] Assembling machine bug

Posted: Thu Jul 10, 2014 4:47 pm
by Jinmago
I think i figured it out:
With a lab with 0 Science Pack 2 in it, I started researching

Code: Select all

{
    type = "technology",
    name = "miner-6",
    icon = "__DyTech-Mining__/graphics/technology/miner.png",
    effects =
    {
      {
        type = "unlock-recipe",
        recipe = "basic-mining-drill-mk6"
      },
    },
    prerequisites = {"miner-5"},
    unit =
    {
      count = 1000,
      ingredients =
      {
        {"science-pack-2", 10},
        {"science-pack-2", 10},
        {"alien-science-pack", 10},
--        {"science-pack-4", 10}, to be added in a future version!
      },
      time = 150
    },
    order = "m-6",
	upgrade = true,
  }
Which has 2 times {"science-pack-2", 10} as ingredients - not intended i guess.

When there are 11 to 19 packs in the lab upon starting a research step, the bug occurs, as 20 packs get subtracted I think. It does neither happen with 10 or less nor with 20 or more.

Interesting as well : If there are 10 packs in there, 10 get subtracted, if there are more, 20 get subtracted. In both cases the research goes on successfully.

Here's the savefile and my mod folder:
http://www.datafilehost.com/d/cf628ee4
You can test it in the bottom right lab.

Re: [0.7.0] Assembling machine bug

Posted: Mon Jul 21, 2014 11:42 am
by kovarex
Jinmago wrote:I think i figured it out:
With a lab with 0 Science Pack 2 in it, I started researching

Code: Select all

{
    type = "technology",
    name = "miner-6",
    icon = "__DyTech-Mining__/graphics/technology/miner.png",
    effects =
    {
      {
        type = "unlock-recipe",
        recipe = "basic-mining-drill-mk6"
      },
    },
    prerequisites = {"miner-5"},
    unit =
    {
      count = 1000,
      ingredients =
      {
        {"science-pack-2", 10},
        {"science-pack-2", 10},
        {"alien-science-pack", 10},
--        {"science-pack-4", 10}, to be added in a future version!
      },
      time = 150
    },
    order = "m-6",
	upgrade = true,
  }
Which has 2 times {"science-pack-2", 10} as ingredients - not intended i guess.

When there are 11 to 19 packs in the lab upon starting a research step, the bug occurs, as 20 packs get subtracted I think. It does neither happen with 10 or less nor with 20 or more.

Interesting as well : If there are 10 packs in there, 10 get subtracted, if there are more, 20 get subtracted. In both cases the research goes on successfully.

Here's the savefile and my mod folder:
http://www.datafilehost.com/d/cf628ee4
You can test it in the bottom right lab.
Thanks for the info, it is fixed for 0.10.4, the game will show an error message on start when there are duplicates inputs in the technology.