KirkMcDonald / kirkmcdonald.github.io

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

Prepare for 0.17 #110

Closed KirkMcDonald closed 5 years ago

KirkMcDonald commented 5 years ago

0.17 is still an indeterminate time off, but it's probably worth keeping track of the changes that will be required in the calculator once it arrives.

Obviously, it will require a new data dump. As with previous versions, I plan on adding 0.17 as a new set of data files, while keeping 0.16 as the default. Once 0.17 is stable, the default will change. Hopefully, the format of the data files will remain compatible with the existing code. It isn't the end of the world if they are not, but it will make my life more complicated.

The math behind circular recipes is changing. This includes recipes like coal liquefaction and Kovarex processing. This will require setting some sort of flag depending on the dataset, so that the calculator can use the right math depending on the version of the game being modeled.

The math behind pipes may be changing. The details still seem to be up in the air, but this will affect the pipe length numbers that the calculator currently displays. As with circular recipes, this will need to use some sort of flag depending on the version.

KirkMcDonald commented 5 years ago

The latest FFF adds some more relevant changes:

Boiler efficiency is no longer a mechanic. The energy consumption of the boiler is currently hard-coded into the calculator, for reasons of expediency/laziness. This will need to be fixed.

The whole hardness/mining power, mining speed/mining time thing is being removed. This will have implications for the MinerDef and Miner types.

Assembling machines will no longer have ingredient limits.

billbo99 commented 5 years ago

https://factorio.com/blog/post/fff-275 .. they gave details here of the changes, and there is a mod out already to simulate appling the changes to 0.16

KirkMcDonald commented 5 years ago

ee956fd5a7cf5340c1528406a86866c36df229b2 adds a dataset that mimics the science changes in 0.17.

RustyBlade64 commented 5 years ago

FFF 276 has announced item spacing on belts to change from 9px to 8px, thereby increasing belt throughput by 12.5%. Being an engine internal change, this will not be reflected in the prototype definitions and also require a version flag.

terite commented 5 years ago

The formula for converting entity.belt_speed to items/sec is 0.16: entity.belt_speed * 60 * 2 / (9/32) 0.17: entity.belt_speed * 60 * 2 / (8/32)

Using the formula and pulling belts from game data will solve #118 edit: formula comes from https://wiki.factorio.com/Transport_belts/Physics

KirkMcDonald commented 5 years ago

937df6bfc30622e18e076c1155aecd0a7f33592d adds the useLegacyCalculations flag, which is true in 0.16 and will be false in 0.17. It also adds the calculations which 0.17 will use for prod modules.

Fun fact: This is actually code that the calculator used to use in error, a bug which was reported in #88 and fixed in 7ecbb31f47ef782b95dd3086b52d9e73ae56ed3d. Now 0.17 is moving to use the behavior which I had previously and erroneously modeled in the calculator, and this code gets to make a return.

The long-term plan for this flag (and the code which uses it) is for it to go away when I eventually remove the 0.16 datasets from the calculator, which will be at some point after when 0.17 is declared stable and when the major mods fully support 0.17.

KirkMcDonald commented 5 years ago

Also: 1ef6f35229b05f630178f968beaa8c1b6a1f779a uses the new flag to disable the pipe length numbers in 0.17, as the old formula is known to no longer be true, but we do not yet know what the new model will be. Once the new model is known, it may be added.

KirkMcDonald commented 5 years ago

5ea4b97bc6c3c9ca211fbf7b7cc258316b8478db adds the logic for 0.17 datasets to calculate belt speeds correctly.

KirkMcDonald commented 5 years ago

Added 0.17 datasets and a round of minor fixes in c5aca95ba1d37c5f5f44356c822a6903afe52776. Added the correct energy usage for boilers in f6f10a5e23dfe9ee35a5fb41ccda12e0932cba75; I will go back and fix this For Real later.

With that I am calling this issue complete. Specific problems may open their own issues.