I have problem with Assembling mashine 3. I put 4 Productivity modules 3 and craft 5x one item and Mashine give me only 2 additional products and end after 5th item on 99% next one. Is it a bug? I calculate it 5p. / 100% = 0,05% * 60% = 3 pieces I want all my bonuses
[0.7.4] Extra products
Re: [0.7.4] Extra products
Hello, thank you for the report.
The reason of this behavior is, that computer floating point numbers aren't precise.
This isn't issue in the long run, and I would personally tend to not mark it as a bug, but as a balancing feature
The reason of this behavior is, that computer floating point numbers aren't precise.
This isn't issue in the long run, and I would personally tend to not mark it as a bug, but as a balancing feature
Re: [0.7.4] Extra products
In my opinion it is a bug. Maybe not important, but a bug.
Greetings, Nova.
Factorio is one of the greatest games I ever played, with one of the best developers I ever heard of.
Factorio is one of the greatest games I ever played, with one of the best developers I ever heard of.
Re: [0.7.4] Extra products
Instead of having each crafted item fill a percent of the bar, count how much crafts are required for an extra item, and decrement this value at each craft or something ?
Re: [0.7.4] Extra products
The simple yet not elegant solution would be to multiply the bonus production by number like 1.0001 ....
-
- Fast Inserter
- Posts: 201
- Joined: Thu Apr 04, 2013 9:55 am
- Contact:
Re: [0.7.4] Extra products
I've got a bit less hacky solution: when the regular production bar hits 100, force the productivity item creation event to happen if the productivity bar is within some epsilon of 100% and reset it.
Example: 125% productivity, ingredients for 4 items - 4th item is produced, productivity bar is at 99.98%, so we treat it as 100%, produce 2 new items (one regular, one from productivity) and set productivity bar to 0%.
It could also work both ways - starting production (the same procedure that consumes ingredients) could clear the productivity bar if it's below 0.01%.
Example: 125% productivity, ingredients for 4 items - 4th item is produced, productivity bar is at 99.98%, so we treat it as 100%, produce 2 new items (one regular, one from productivity) and set productivity bar to 0%.
It could also work both ways - starting production (the same procedure that consumes ingredients) could clear the productivity bar if it's below 0.01%.
Re: [0.7.4] Extra products
i think this would create a bug were it clears the bar every time it starts a new craft, not sure tough i don't know the code for it...Coolthulhu wrote: It could also work both ways - starting production (the same procedure that consumes ingredients) could clear the productivity bar if it's below 0.01%.
this is an good idea tough
or just multiply by 1.0001 after each craft is doneI've got a bit less hacky solution: when the regular production bar hits 100, force the productivity item creation event to happen if the productivity bar is within some epsilon of 100% and reset it.
Re: [0.7.4] Extra products
It is now solved for 0.8.1.
When I compare the bonus production with the needed production, I add 0.0001.
When I compare the bonus production with the needed production, I add 0.0001.
Re: [0.7.4] Extra products
Such hacks. Wouldn't it be more reasonable to use some precise number format instead of float? Like Java has BigDecimal.
Re: [0.7.4] Extra products
From what I understood about the implementation, you still can't do 1/3 with unlimited precision, to do things like this, the value would have to be stored as symbolic expression, and it would definitely be slower.FrozenOne wrote:Such hacks. Wouldn't it be more reasonable to use some precise number format instead of float? Like Java has BigDecimal.