Allow spoil_weight and percent_spoiled > 1
Posted: Tue Sep 15, 2026 8:30 pm
As in title. The implementation details and how it would function differs, so I'll lay out my ideas below. I do think these ideas are related, though, so I thought to combine them here.
ItemIngredientPrototype::spoil_weight > 1
I have two ideas for how this could be implemented. The first is simple: allow it to be > 1, and the total spoil level for the recipe is the weighted sum of all ingredient spoilage levels divided by the sum of the spoil weights, so the output would always be [0, 1]. This isn't ideal, as (I think) it's a breaking change, but would require fewer changes than my other idea.
The second implementation would be identical to the first, except that the output would not be divided by the sum of spoil weights. This would produce a number > 1, that when applied to spoilable products, would increase the spoil time instead of decreasing it. So, taking the yumako mash -> nutrients recipe, if the spoil_weight of yumako mash was set to 1.5, the output nutrients would have 150% the spoilage time of the input (capped to 100%). 20% spoil time mash would make 30% spoil time nutrients, 50% -> 75%, 80% -> 100%
ItemProductPrototype::percent_spoiled > 1
I only have one implementation idea here. If the percent_spoiled is > 1, the spoil time of the output would increase relative to the input (again capped to 100%). Taking the mash -> nutrients recipe from before, if the output nutrients had percent_spoiled set to 1.5 the same result would occur. 20% spoil time mash would make 30% spoil time nutrients, 50% -> 75%, 80% -> 100%
Why?
Primarially, I want to make recipes to "recharge" spoilable items. It would also be nice to create a durability-like system where items with insanely high spoil times are consumed 1% at a time in recipes, then "recharged" 5% at a time with other recipes, so if you let the item fully spoil you have to do more work but getting it "recharged" is much easier. I can also see this being used for refrigerator type mods that extend spoil time, or some interesting calculations surrounding nuclear decay.
ItemIngredientPrototype::spoil_weight > 1
I have two ideas for how this could be implemented. The first is simple: allow it to be > 1, and the total spoil level for the recipe is the weighted sum of all ingredient spoilage levels divided by the sum of the spoil weights, so the output would always be [0, 1]. This isn't ideal, as (I think) it's a breaking change, but would require fewer changes than my other idea.
The second implementation would be identical to the first, except that the output would not be divided by the sum of spoil weights. This would produce a number > 1, that when applied to spoilable products, would increase the spoil time instead of decreasing it. So, taking the yumako mash -> nutrients recipe, if the spoil_weight of yumako mash was set to 1.5, the output nutrients would have 150% the spoilage time of the input (capped to 100%). 20% spoil time mash would make 30% spoil time nutrients, 50% -> 75%, 80% -> 100%
ItemProductPrototype::percent_spoiled > 1
I only have one implementation idea here. If the percent_spoiled is > 1, the spoil time of the output would increase relative to the input (again capped to 100%). Taking the mash -> nutrients recipe from before, if the output nutrients had percent_spoiled set to 1.5 the same result would occur. 20% spoil time mash would make 30% spoil time nutrients, 50% -> 75%, 80% -> 100%
Why?
Primarially, I want to make recipes to "recharge" spoilable items. It would also be nice to create a durability-like system where items with insanely high spoil times are consumed 1% at a time in recipes, then "recharged" 5% at a time with other recipes, so if you let the item fully spoil you have to do more work but getting it "recharged" is much easier. I can also see this being used for refrigerator type mods that extend spoil time, or some interesting calculations surrounding nuclear decay.