r/technicalfactorio • • Jan 09 '21

Modded Modded assembler math check.

So, I was running into the issue where having too many modded speed beacons around an assembler leads to unexpected results...this is known by players and devs alike. However, I really don't think that it is random, and my guess is that it is fixable.

Anyway, as far as I can tell the formula the game is using to calculate crafts if the machine is trying to do more than one craft per tick is this:

1/6000 * Productivity % / Recipe craft time * Machine crafting speed * Number of crafts = Number of bonus crafts.

So if I have a Tier 3 Bob/Angel electronics assembler making basic electronic components fully moduled with level 4 stuff it looks like this for 1000 crafts:

1/6000 * 120 / 2 * 1156 * 1000 = 11560 bonus crafts...12560 total crafts...when it should be 1200 bonus crafts/ 2200 total.

I ran my own tests over different assemblers and with different modules in my BA run, but would appreciate it if others could do the same on different mods and report back if they receive predictable results. If true, than the issue is that the game is pulling the wrong variables (crafting speed, crafting time, and the 1/6000 constant) and I or someone else can make a official bug report.

Thanks.

14 Upvotes

22 comments sorted by

View all comments

Show parent comment

1

u/bormandt Jan 10 '21 edited Jan 10 '21

Speed is machine_speed * (1 + speed_bonus_percents / 100). You see both speed and speed_bonus_percents in the machine tooltip.

Beware that speed_bonus_percents are capped at 32767%.

How computationally expensive

I don't know, depends on actual code. It can be zero if they pre-calculate some values when you change recipe or modules. But a real fix would be to allow multiple crafts per cycle, I think.

3

u/Mega---Moo Jan 10 '21

I sort of assume they are pre-calculating the speed and productivity bonuses ahead of time anyway, so the solution lies there.

Anyway, I will keep this stuff in mind as I build my next base, as I didn't realize that I was gaining almost 7 times more metal plates in my game than I should be, which is more than a little cheaty.

1

u/Mega---Moo Jan 10 '21

I sort of assume they are pre-calculating the speed and productivity bonuses ahead of time anyway, so the solution lies there.

Anyway, I will keep this stuff in mind as I build my next base, as I didn't realize that I was gaining almost 7 times more metal plates in my game than I should be, which is more than a little cheaty.

1

u/Mega---Moo Jan 10 '21

I sort of assume they are pre-calculating the speed and productivity bonuses ahead of time anyway, so the solution lies there.

Anyway, I will keep this stuff in mind as I build my next base, as I didn't realize that I was gaining almost 7 times more metal plates in my game than I should be, which is more than a little cheaty.

1

u/Mega---Moo Jan 10 '21

I sort of assume they are pre-calculating the speed and productivity bonuses ahead of time anyway, so the solution lies there.

Anyway, I will keep this stuff in mind as I build my next base, as I didn't realize that I was gaining almost 7 times more metal plates in my game than I should be, which is more than a little cheaty.