Page 1 of 1
[2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar
Posted: Fri Oct 18, 2024 9:50 pm
by micromario
Currently on the technology modifier struct we have `ChangeRecipeProductivityModifier`which aids in adding infinite productivity researches.
Could this instead be replaced with a more generic struct?
Code: Select all
technology.effects = {
{
type = 'add-recipe-effect',
recipe = 'iron-gear-wheel',
changes = {
quality = 0.1,
productivity = -0.05,
speed = 0.1,
pollution = 0.2,
}
}
}
Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar
Posted: Fri Oct 18, 2024 10:03 pm
by micromario
Five separate structs would also work.
Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar
Posted: Sat Oct 19, 2024 9:56 am
by curiosity
I am surprised it doesn't already allow applying an arbitrary effect.
Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar
Posted: Mon Oct 21, 2024 10:30 pm
by Rseding91
curiosity wrote: Sat Oct 19, 2024 9:56 am
I am surprised it doesn't already allow applying an arbitrary effect.
Some additional information: every bit of logic we add to the game we have to program in support for everywhere it's used. Recipes did not previously have any support for runtime productivity or modification of that value. That all had to be added to recipes, saved/loaded, the technology effects hooked up, tooltips handled everywhere they get shown, the bonus GUI, the productivity calculation in crafting machines and so on.
So to make it support an arbitrary effect isn't possible. We would have had to programmed in every possible effect we wanted to be runtime adjustable on the recipes and done everything listed above. And of course tests for it all.
Given base game had no plans to use any of that - it wasn't done as part of the expansion work.
Re: [2.0.6] Replace `change-recipe-productivity` with `add-recipe-effect` or similar
Posted: Tue Oct 22, 2024 1:17 pm
by curiosity
Maybe it is that bad, I don't actually know how effects are handled in code. Though I still don't see why adding one effect to a recipe would be fundamentally different from adding another.