Quickly spoiling, long craft time items, spoiling instantly on craft.
Posted: Fri Dec 27, 2024 2:28 am
There appears to be a bug with items with relatively long craft times, but short spoil times, and the freshness of the resulting item (even when result_is_always_fresh = true).
Steps to recreate:
Mod the following scenario:
Mod the recipe for an item (custom, or just use iron bacteria) with a short spoil timer, to take longer.
e.g. 10 minute craft time, 1 minute spoil time.
Mark the recipe result_is_always_fresh = true, to ensure that the output is always fresh.
for example, simply alter the following:
data.raw["recipe"]["iron-bacteria-cultivation"].energy_required = 600
Craft the recipe ingame, the result will always be spoiled instantly, you will only get iron ore. (even if you use the freshest of bacteria) (Note, it seems like the spoiled variant of the item is created from the recipe, instead of the intended item).
Craft the recipe in a legendary variant of the crafter, and/or add legendary speed modules, the result will now not be spoiled, and behave as normal after a threshold of crafting speed is reached.
(In my own tests, I also came to the same conclusion when using crafting ingredients themselves are not spoilable)
There appears to be some issue with the crafting time / spoil time ratio, that breaks the output, even when result_is_always_fresh is true during Prototype stage.
Expected behaviour: The freshness of an item when marked "result_is_always_fresh = true", should not be affected by the recipes craft time.
Possible reason: The item that is to be created starts spoiling from the recipes start point, if the item spoils during crafting, then its spoiled variant is output instead of itself. If the recipe is marked "result is always fresh", then that spoiled variant has its spoil timer reset, rather than the original resultant item, resulting in spoiled items when the ratio of craft-time to spoil time is too large.
Extra considerations: It should be investigated whether a 5 minute craft time, would result in spoiled outcomes for a 10 minute spoiling item, if provided with 50% spoiled ingredients (result item should have 5 minutes left on spoil timer, but due to craft time it may be less than this? This might be intended?, but doesn't work well with modded items with longer craft times.
Update: By setting preserve_products_in_machine_output = true, in the recipe itself, you can ensure the correct item is output again, however obviously this is not a true fix, as the lack of spoiling in the machine may not be desired behaviour.
Steps to recreate:
Mod the following scenario:
Mod the recipe for an item (custom, or just use iron bacteria) with a short spoil timer, to take longer.
e.g. 10 minute craft time, 1 minute spoil time.
Mark the recipe result_is_always_fresh = true, to ensure that the output is always fresh.
for example, simply alter the following:
data.raw["recipe"]["iron-bacteria-cultivation"].energy_required = 600
Craft the recipe ingame, the result will always be spoiled instantly, you will only get iron ore. (even if you use the freshest of bacteria) (Note, it seems like the spoiled variant of the item is created from the recipe, instead of the intended item).
Craft the recipe in a legendary variant of the crafter, and/or add legendary speed modules, the result will now not be spoiled, and behave as normal after a threshold of crafting speed is reached.
(In my own tests, I also came to the same conclusion when using crafting ingredients themselves are not spoilable)
There appears to be some issue with the crafting time / spoil time ratio, that breaks the output, even when result_is_always_fresh is true during Prototype stage.
Expected behaviour: The freshness of an item when marked "result_is_always_fresh = true", should not be affected by the recipes craft time.
Possible reason: The item that is to be created starts spoiling from the recipes start point, if the item spoils during crafting, then its spoiled variant is output instead of itself. If the recipe is marked "result is always fresh", then that spoiled variant has its spoil timer reset, rather than the original resultant item, resulting in spoiled items when the ratio of craft-time to spoil time is too large.
Extra considerations: It should be investigated whether a 5 minute craft time, would result in spoiled outcomes for a 10 minute spoiling item, if provided with 50% spoiled ingredients (result item should have 5 minutes left on spoil timer, but due to craft time it may be less than this? This might be intended?, but doesn't work well with modded items with longer craft times.
Update: By setting preserve_products_in_machine_output = true, in the recipe itself, you can ensure the correct item is output again, however obviously this is not a true fix, as the lack of spoiling in the machine may not be desired behaviour.