Page 1 of 1

[Rseding91] [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 2:26 am
by kapaer
One of 0.16.17 Bugfixes:
- Fixed that a furnace or assembling machine with > 100% productivity with a <= 1 tick crafting time recipe wouldn't work correctly. (56859)
is not fix correctly. Base production speed is restricted to 1 tick, but productivity bonus is not restricted.

For example:
a. Make "Iron gear wheel" with +50% productivity and 30 machine speed (=1 tick/production). 120 iron plates are consumed and last products are 60 base products + 30 bonus products per second. It's correctly.
b. 60 machine speed with above case, base production speed is restricted to 1 tick. 120 iron plates are consumed and last products are 60 base products + 60 bonus products. Productivity bonus is not restricted.

Now, productivity bonus per tick seems to be ((machineSpeed/craftingTime)/60)*productivityBonus, but Min((machineSpeed/craftingTime)/60), 1.0) * productivityBonus is right.

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 5:35 am
by Rseding91
Could you give an example mod and steps to reproduce where it's not working? I'm having a hard time understanding what you're saying.

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 8:44 am
by Engimage
Rseding91 wrote:Could you give an example mod and steps to reproduce where it's not working? I'm having a hard time understanding what you're saying.
As I understand his words actual crafting speed is limited to 1 cycle per tick but productivity bonus result is calculated without that restriction as like production speed was not actually limited.
That means that if real recipe cycle time is 1 tick everything is fine. But if recipe time is 2/tick (120 cycles/sec) it is limited to 1/tick (60 cycles/sec) but productivity bonus is still calculated like machine is producing 120/sec so while real crafting speed is 60/sec 50% bonus grants another 60 items (120*50%) instead of real 30 (60*50%).

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 9:18 am
by kapaer
productivity_problem.jpg
productivity_problem.jpg (344.5 KiB) Viewed 2441 times
test mod and save file:
productivity_problem.zip
(2.23 MiB) Downloaded 132 times

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 9:19 am
by Zaflis
Does it sound like the bug is on machine crafting itself, not the productivity? Say you boost assembler so fast that math tells it should make 120 items per second (2 per tick). What actually happens? I haven't tested.

What i expect to happen is that the production bar (while UI's progress bar would always be limited to 100%) would internally allow exceeding it.

Code: Select all

onTick:
  while progress > 100.0 do {
    Craft()
    progress -= 100.0
  }

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 1:56 pm
by Rseding91
Zaflis wrote:Does it sound like the bug is on machine crafting itself, not the productivity? Say you boost assembler so fast that math tells it should make 120 items per second (2 per tick). What actually happens? I haven't tested.

What i expect to happen is that the production bar (while UI's progress bar would always be limited to 100%) would internally allow exceeding it.

Code: Select all

onTick:
  while progress > 100.0 do {
    Craft()
    progress -= 100.0
  }
That's literally what it does now.

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 3:00 pm
by eradicator
Rseding91 wrote:I'm having a hard time understanding what you're saying.
The OP is saying that when increasing the speed of an assembler while keeping the same productivity bonus you still gain additional products from the productivity bonus while consumption stays the same.

Prod +50%, Speed 30 -> Consumption 120, Products 60+30, Cost per unit 1.33
Prod +50%, Speed 60 -> Consumption 120, Products 60+60, Cost per unit 1.00

(That's how i understand the OP, i haven't tested any of this myself.)

Re: [16.17] Bugfix: >100%productivity... is not fixed correctly

Posted: Tue Jan 23, 2018 7:37 pm
by Rseding91
Ok, It should be fixed for the next version of 0.16.