Auto Research

by canidae

Automates research. Toggle GUI with Shift+T (customizable).

Utilities
4 years ago
0.13 - 1.1
55.8K

i Idea to improve Effort calculation

7 years ago

Effort calculation with effort = tech.research_unit_count * tech.research_unit_energy fails to correctly tell a research with 30t x1000 using 1x of each sci pack is less effort than a time 70t x400 using 2x red/green 1x blue/purple

I'd change the formula to
effort = tech.research_unit_count * tech.research_unit_energy * each(research_unit_ingredients.amount)
or as code
local sum_ingredients = 0
for _,ingredient in pairs (tech.research_unit_ingredients) do
sum_ingredients = sum_ingredients + ingredient.amount
end
local effort = tech.research_unit_count * tech.research_unit_energy * sum_ingredients

7 years ago

I'll likely implement something like this. For Factorio 0.14 I didn't bother as very few technologies in vanilla Factorio used more than 1 science pack of one type per iteration. As for Factorio 0.15 (and also other mods) there are more science packs per iteration so it makes more sense to weigh in this as well in the effort calculation.

7 years ago

Next version will include sum_ingredients in effort calculation. Cheers for the suggestion and code example.

New response