Page 1 of 1

LuaRecipePrototype.max_productivity_bonus

Posted: Wed Mar 13, 2019 10:20 am
by Earendel
When other mods are installed I lose control over the max productivity bonus a recipe can benefit from.

I would like to create reversible recipes procedurally (for recycling) but the potential for infinite resource generation is too high. Even if I set the reverse recipe to 50% yield and no productivity is allowed, if the forward recipe is benefiting from more than 100% productivity then they still end up with more than they started with.

Solution:

LuaRecipePrototype.max_productivity_bonus :: double [R] The maximum productivity bonus this recipe can benefit from. 0 means any productivity bonus has no effect, 0.5 means any productivity bonus over +50% will be ignored, nil means there is no limit. Default is 1 (+100% max).

This property would not be part of the recipe tooltip. It could be shown as a tooltip of the productivity bar if the productivity bonus is being limited.

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Wed Mar 13, 2019 12:20 pm
by Rseding91
I don't consider this worth the performance impact it would have on every assembling machine out there having to check if the current productivity bonus is acceptable for the recipe.

The solution is: don't use broken mods which allow productivity >= 100%.

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Wed Mar 13, 2019 10:48 pm
by Earendel
Rseding91 wrote: Wed Mar 13, 2019 12:20 pm The solution is: don't use broken mods which allow productivity >= 100%.
How can I prevent people from doing that?

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Thu Mar 14, 2019 1:52 am
by Rseding91
Earendel wrote: Wed Mar 13, 2019 10:48 pm
Rseding91 wrote: Wed Mar 13, 2019 12:20 pm The solution is: don't use broken mods which allow productivity >= 100%.
How can I prevent people from doing that?
You can't. It's up to the player to not use broken mods. If they want to use broken mods... well then they're going to use broken mods.

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Thu Mar 14, 2019 2:56 am
by DaveMcW
You can manually mark overpowered mods as incompatible with yours.

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Thu Mar 14, 2019 11:46 pm
by Earendel
DaveMcW wrote: Thu Mar 14, 2019 2:56 am You can manually mark overpowered mods as incompatible with yours.
Yeah that could work. I don't want to have to manage a blacklist though.

I guess I can search for:
  • Excessive productivity modules.
  • Excessive numbers of module slots in machines.
  • Excessive numbers of module slots in beacons.
  • Excessive beacon range.
  • Excessive beacon transmission efficiency.
And if it is over a threshold try to fix it in data-final-fixes. If it still a problem at runtime then throw an incompatibility error?

It doesn't seem like a great option, if anyone can thing of something better that would be great.

Re: LuaRecipePrototype.max_productivity_bonus

Posted: Wed Feb 28, 2024 10:41 am
by Bilka
As mentioned in https://factorio.com/blog/post/fff-375, this is a thing in 2.0 as RecipePrototype::maximum_productivity.