KirkMcDonald / kirkmcdonald.github.io

Simple web-based calculator for the game Factorio.
Apache License 2.0
553 stars 147 forks source link

Productivity and speed module beacon combinations yield wrong assembler counts #213

Open DeadMG opened 4 years ago

DeadMG commented 4 years ago

To reproduce:

Set the output to yellow science. Set the desired output to 250/minute. Set the assemblers being used to assembler 3s. Then set the assembler 3s to all prod 3 modules, and 3 beacons of speed 3 modules each.

Note the number of factories at 14.5.

Calculating the expected output:

Note that I actually observed this outcome in game, sustaining a rate well above 250/minute.

Obviously, you can't have 14.5 assemblers, so making 15 assemblers gives you above 250/minute if they're fully resourced, however this should lead to a small error, not nearly double the output rate. I also observe that this isn't explained by productivity alone, as 250 * 1.4 is only 350, when we're well above that too.

I observed an identical issue with Low Density Structure so I do not believe there is anything specific to yellow science in this case.

DRY411S commented 4 years ago

i HAVEN'T CHECKED YOUR MATHS, BUT COULD THIS BE BECAUSE YOU HAVE MISUNDERSTOOD THE 'BEACONS' PARAMETER?

sorry caps lock ^

The beacons parameter is in fact 'modules'. If you have 3 beacons in range of an assembler, each with 2 prod modules, you should in fact be setting 'beacons' to 6. Thus:

https://kirkmcdonald.github.io/calc.html#data=1-0-0&cp=2&min=3&mprod=20&items=utility-science-pack:r:250&modules=utility-science-pack:p3:p3:p3:p3;s3:6

Giving 8.78 assemblers. You say in your description that placing 15 (as opposed to 14.5) results in almost double the expected result. Well 15 is 'almost' double 8.78. Perhaps this is the reason?

Reference. The FAQ:

### Do the numbers in the "beacons" column represent the number of modules or the number of beacons? They represent the number of modules.

DeadMG commented 4 years ago

That.. seems quite possible. However, if so, one would probably argue for renaming the column to something clearer, such as "beacon modules".

DRY411S commented 4 years ago

I don't disagree. The number you put in the calculator is the number of modules in beacons that are in the proximity of the assembler. I think the developer has steered away from calling them 'modules' to distinguish them from the modules in the assembler itself.

But, is my explanation valid? Have you misinterpreted what that field should be?

lpld commented 3 years ago

Hey! I don't know if this is the same bug, but I have observed something similar too. Here's a minimal example that shows it:

Mining setup with 10000 items per minute and 3 speed modules in beacon slot: https://kirkmcdonald.github.io/calc.html#data=1-1-19&min=3&fuel=nuclear-fuel&belt=fast-transport-belt&items=iron-ore:r:10000&modules=iron-ore:;s3:3

Same setup, with productivity module: https://kirkmcdonald.github.io/calc.html#data=1-1-19&min=3&fuel=nuclear-fuel&belt=fast-transport-belt&items=iron-ore:r:10000&modules=iron-ore:p3;s3:3

When 3 or more speed modules are added into a beacon slot, adding productivity module for some reason increases the overall speed (the number or mining drills is reduced, while it has to increase).

Here's a small video that shows this behavior: https://i.gyazo.com/fad30d3df9fe9cec835eadbc3e1a33fa.mp4

@DRY411S It doesn't look like your explanation can be applied here. Should I open a new issue?

DRY411S commented 3 years ago

@lpld that looks like a different issue, and a bug. The original issue was in my opinion the OP misunderstanding that 'beacons' means 'modules'.

Having said that I think you've found a bug, I question why you'd want to surround every miner with only 3 speed modules. :)

Generally, players try to pack miners onto ore patches as densely as possible, with no space for beacons. The speed gain is offset by the tiles occupied by the beacons could instead be occupied by miners.

lpld commented 3 years ago

@DRY411S I have been experimenting with different mining setups, and now I am looking into this one: https://imgur.com/lOJXpAA If you are interested, here is reddit discussion: https://www.reddit.com/r/factorio/comments/4gn56w/compact_mining_drill_layouts/d2j34y5?utm_source=share&utm_medium=web2x&context=3

With this setup, every drill is affected by 4 beacons (8 beacon modules). Extra space that is used for beacons is compensated by a bunch of productivity and speed modules. Not sure still if I'm gonna try this one, but I was doing some math and realized that my own computations did not match with KirkMcDonald's calculator. The reason I used 3 in my example is because it is actually the minimal number at which the bug is reproduced (with 2 the calculator seems to produce correct values).