Add a "Freshness Coefficient" to recipes that make spoilables

Place to ask discuss and request the modding support of Factorio. Don't request mods here.
powdergamefreak
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Nov 20, 2024 2:43 am
Contact:

Add a "Freshness Coefficient" to recipes that make spoilables

Post by powdergamefreak »

Currently, the freshness of a spoilable product is determined by the average freshness of its ingredients.

I am trying to make the promethium science pack into a spoilable pack with a freshness based on its ingredients, and to this end I have made promethium asteroid chunks spoilable as well.

Because the recipe calls for 10 biter eggs and 25 promethium chunks, the spoil level of the chunks has a much larger effect on the freshness of the resulting science pack than the spoil level of the biter eggs.

I would like it if, in the recipe prototype, when specifying the ingredients and their amounts, if we could set a "freshness coefficient". By default, it would have a value of 1. For example:

(50% fresh biter eggs x 10 x (Freshness Coefficient = 1)) + (95% fresh promethium chunk x 25 x (Freshness Coefficient = 1)) / ((# of biter eggs * (Freshness Coefficient = 1)) + (# of promethium chunks * (Freshness Coefficient = 1))

or more simply

(500 + 2375) / 35 = 82.1% fresh product

But if I wanted to let the biter eggs have a greater effect on the freshness of the final product without changing the amounts of the respective inputs, I could do:

(50% fresh biter eggs x 10 x (Freshness Coefficient = 2)) + (95% fresh promethium chunk x 25 x (Freshness Coefficient = 1)) / ((# of biter eggs * (Freshness Coefficient = 2)) + (# of promethium chunks * (Freshness Coefficient = 1))

more simply

1000 + 2375 / 45 = 75% fresh product

An example of how it would be used in modding:

Image

Thanks :D
powdergamefreak
Burner Inserter
Burner Inserter
Posts: 10
Joined: Wed Nov 20, 2024 2:43 am
Contact:

Re: Add a "Freshness Coefficient" to recipes that make spoilables

Post by powdergamefreak »

I just thought about it, and perhaps it could also be adapted from the "ignored_by_productivity" setting, something like "ignored_by_freshness_calculation" that can lessen the effective amount of ingredients being considered by the freshness calculation
User avatar
protocol_1903
Filter Inserter
Filter Inserter
Posts: 469
Joined: Fri Sep 09, 2022 4:33 pm
Contact:

Re: Add a "Freshness Coefficient" to recipes that make spoilables

Post by protocol_1903 »

+1, ignored_by_freshness seems like the better option
Py and PyBlock developer, wielder of LUA in arbitrary ways. I make mods. Check them out, maybe.
https://mods.factorio.com/user/protocol_1903
Post Reply

Return to “Modding interface requests”