LuaRecipePrototype.max_productivity_bonus

Coming soon!
Post Reply
User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

LuaRecipePrototype.max_productivity_bonus

Post 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.

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post 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%.
If you want to get ahold of me I'm almost always on Discord.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post 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?

Rseding91
Factorio Staff
Factorio Staff
Posts: 13209
Joined: Wed Jun 11, 2014 5:23 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post 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.
If you want to get ahold of me I'm almost always on Discord.

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3700
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post by DaveMcW »

You can manually mark overpowered mods as incompatible with yours.

User avatar
Earendel
Factorio Staff
Factorio Staff
Posts: 711
Joined: Sun Nov 23, 2014 11:57 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post 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.

Bilka
Factorio Staff
Factorio Staff
Posts: 3139
Joined: Sat Aug 13, 2016 9:20 am
Contact:

Re: LuaRecipePrototype.max_productivity_bonus

Post by Bilka »

As mentioned in https://factorio.com/blog/post/fff-375, this is a thing in 2.0 as RecipePrototype::maximum_productivity.
I'm an admin over at https://wiki.factorio.com. Feel free to contact me if there's anything wrong (or right) with it.

Post Reply

Return to “Implemented for 2.0”