Page 1 of 2

Add custom spoilage categories

Posted: Mon Jun 29, 2026 9:25 pm
by AndreusAxolotl
Usually spoiling in the Vanilla game only shows up with biological products, as expected, spoiling into spoilage or other products.

Modders though have used the spoiling feature to show other kinds of processes, from nuclear decay to rusting.

So my suggestion is the addition of spoilage categories.
These would function like burner types, while internally everything works under the same system, externally these would differentiate different "spoiling" processes.

The default category would, of course, remain "Spoiling", showing itself in game like it currently does.
06-29-2026, 23-12-54.png
06-29-2026, 23-12-54.png (9.62 KiB) Viewed 1405 times
(Jelly as an example)

But if a custom category was declared it would be put in the ItemPrototype in a "spoil_category" field, spoil_category = "decaying" for example.
Spoiling categories would also be able to change the Icon that appears in the Factoriopedia tooltip, if possible code-wise, allowing for even clearer recognition by the player.

In the locale the modder would be able to specify the custom lines that replace the Vanilla spoiling text (spoil-time, spoil-result, percent-spoiled, spoilable, etc...) with fitting lines.

These are some mockups I made in Paint.
06-29-2026, 23-17-58.png
06-29-2026, 23-17-58.png (9.07 KiB) Viewed 1405 times
(An Uranium isotope decaying into Uranium-238)
06-29-2026, 23-18-16.png
06-29-2026, 23-18-16.png (8.6 KiB) Viewed 1405 times
(A hot version of a Tungsten Plate cooling down into the cold version)

This feature could also be used by the Vanilla game itself! Currently Biter and Pentapod eggs "spoil" into big biters or premature wrigglers, depending on the egg. With the addition of spoilage categories, this could be changed with them hatching!
06-29-2026, 23-19-54.png
06-29-2026, 23-19-54.png (8.43 KiB) Viewed 1405 times
(Mockup of the hatchable spoilage category)

The addition of spoilage categories would also help modders make mods that interact with spoilable items.
These mods specifically interact with items that spoil organically.
https://mods.factorio.com/mod/spoilage-solution

These two also have a blakclist to filter out items that spoil, but are not organic.
https://mods.factorio.com/mod/planetaris-tellus
https://mods.factorio.com/mod/apia

The latter two mods can replace their blacklists with a type check to find organic items, and filter accordingly, ignoring interacting with custom inorganic spoiling, like the example "decaying" or "cooling".

Already existing mods like, for example, these two could also simply change the spoilage on their items to "cooling" and "rusting" respectively, making the new features they add feel more complete and make more sense.
https://mods.factorio.com/mod/hot-metals
https://mods.factorio.com/mod/Rocs-Rusting-Iron

Re: Add custom spoilage categories

Posted: Mon Jun 29, 2026 9:32 pm
by front
I'm usually a strong critique of even my own ideas, so I rarely say this. This needs to be in the game.

This is not only added visual clarity (even for space age).
On the top of that it lets mods interact with each other in ways that currently can only be done either by custom apis (different one for each mod), a coordinated api (difficult to pull off), or by hard coding every modded item we know of.

I want this.

Re: Add custom spoilage categories

Posted: Mon Jun 29, 2026 10:27 pm
by FluidNatalie
+1

Awesome feature idea

Re: Add custom spoilage categories

Posted: Tue Jun 30, 2026 10:40 am
by Puke
+1

Re: Add custom spoilage categories

Posted: Tue Jun 30, 2026 10:53 am
by GN89
+1

Re: Add custom spoilage categories

Posted: Tue Jun 30, 2026 4:27 pm
by Thremtopod
+1

Re: Add custom spoilage categories

Posted: Wed Jul 01, 2026 7:19 pm
by Rseding91
If this was added, it would need to be integrated into Factoriopedia which would be the majority of the work. It would also need to account for a given thing spoiling and having any number of possible results. Right now it's simply a trigger that runs - and can do functionally anything.

Re: Add custom spoilage categories

Posted: Wed Jul 01, 2026 7:42 pm
by Thremtopod
What a very stripped-down version of this, something like a "spoil_type_localised_name", which just allows having custom text replace "Spoils into" but doesn't have any extra interactions? It'd presumably default to the vanilla "Spoils into". Even without any other functionality, I think this would still be useful for mods wanting to categorize spoiling types.

Re: Add custom spoilage categories

Posted: Thu Jul 02, 2026 8:33 pm
by AndreusAxolotl
Rseding91 wrote: Wed Jul 01, 2026 7:19 pm If this was added, it would need to be integrated into Factoriopedia which would be the majority of the work. It would also need to account for a given thing spoiling and having any number of possible results. Right now it's simply a trigger that runs - and can do functionally anything.
It wouldn't have a number of possible results? This wouldn't add new separate spoilages, it simply lets you have items of your choice have their spoilage tooltip displayed differently. They would stay as spoilable items internally, you wouldn't have an item be able to spoil in multiple different ways.

I believe you have misunderstood the way I'm proposing to implement this.

Re: Add custom spoilage categories

Posted: Fri Jul 03, 2026 11:59 am
by front
Rseding91 wrote: Wed Jul 01, 2026 7:19 pm If this was added, it would need to be integrated into Factoriopedia which would be the majority of the work. It would also need to account for a given thing spoiling and having any number of possible results. Right now it's simply a trigger that runs - and can do functionally anything.
Don't change the spoiling process, spoiling into multiple items also does not make sense. That code works so well that we use it for stuff beyond an item rotting.
For the factoriopedia, we only ask to be able to change the localizations. No other gui changes, no new layouts etc.

Re: Add custom spoilage categories

Posted: Fri Jul 03, 2026 5:41 pm
by Rseding91
I was looking into this and found there are 3 different locale keys shown in tooltips that would need "overrides" - which quickly goes into "this should probably be its own prototype type - like fuel category" which is even more work.

description.spoil-result
description.spoil-time
quality-tooltip.spoils-slower

Re: Add custom spoilage categories

Posted: Mon Jul 06, 2026 6:51 am
by Wizatek
Spoilage categories would interface well with other not yet implemented mod mechanics so that you could have "refrigerators" for biological spoilage, or "incubators" for hatching type spoilage, or other interactions that should differ between those types.

Edit: nevermind I guess both examples actually do the same thing to both types of spoilage - hot accelerates and cold slows.

Re: Add custom spoilage categories

Posted: Wed Jul 08, 2026 10:51 pm
by sben
+1

Re: Add custom spoilage categories

Posted: Mon Jul 13, 2026 7:50 am
by herrkatze0658
+1 on this. I agree that this could be quite useful

Re: Add custom spoilage categories

Posted: Thu Jul 16, 2026 2:30 pm
by BraveCaperCat
+1

Re: Add custom spoilage categories

Posted: Thu Jul 16, 2026 2:32 pm
by Osmo
+1

Re: Add custom spoilage categories

Posted: Mon Jul 27, 2026 11:42 am
by MrSmoothieHuman
+1
as someone working with a chemistry-based mod, this'd be very useful

Re: Add custom spoilage categories

Posted: Tue Aug 04, 2026 10:46 pm
by MeteorSwarm
+1

Re: Add custom spoilage categories

Posted: Mon Aug 10, 2026 4:51 am
by MeteorSwarm
In the meantime while Wube considers adding this to the base game, I've gone ahead and added this feature to a dev branch of PlanetsLib. The library supports adding new spoil categories with PlanetsLib.create_spoil_category(prototype):

Code: Select all

lua
PlanetsLib.create_spoil_category{
    name = "diffusible",
    localised_spoil_result = {"spoil-result.diffusible"},
    localised_spoil_time =  {"spoil-time.diffusible"},
    quality_header =  "quality-tooltip.diffuses-more-slowly",
}
Items can be assigned spoil categories with ItemPrototype::PlanetsLib_spoil_category:

Code: Select all

lua
{
    type = "item",
    name = "muluna-diffused-plastic",
    icon = data.raw["item"]["plastic-bar"].icon,
    icon_size = 64,
    stack_size = 100,
    weight = 2 * kg,
    subgroup = "muluna-products",
    order = "c[muluna-microfoamed-plastic]",
    spoil_ticks =  10.5*60,
    spoil_result = "plastic-bar",
    spoil_quality_change = -1,
    PlanetsLib_spoil_category = "diffusible",
    icons = {
        
        {
            icon = data.raw["item"]["plastic-bar"].icon,
            icon_size = 64,
            tint = {200,200,0,255},
            draw_background = true,
        }
    }
  },
  
Spoil category information can be seen by mods in prototypes.mod_data.Planetslib.spoil_categories and prototypes.mod_data.Planetslib.item_spoil_category.
08-09-2026, 21-45-04.png
08-09-2026, 21-45-04.png (628.08 KiB) Viewed 214 times
Players can see spoil category via custom tooltips that are added to items with custom spoil categories.
08-09-2026, 21-44-29.png
08-09-2026, 21-44-29.png (192.79 KiB) Viewed 214 times
Given what has been discussed in this thread, I believe that if mod developers use this library to add new spoilage categories, it would be quite easy to automatically redirect PlanetsLib to hook this implementation into Wube's system if it's created at a future date. For now, this system will allow developers to set up spoilage categories and decide which items go where to prepare for that date. If Wube never decides to add this, no worries. This implementation should be fully usable.

I will add this feature to PlanetsLib in the coming days once I've finished the documentation. For now, you can test this system in this dev branch of PlanetsLib: https://github.com/danielmartin0/Planet ... categories

Re: Add custom spoilage categories

Posted: Mon Aug 10, 2026 9:00 am
by thesixthroc
I can’t say I agree with this proposal as it stands. Spoilage refers not only to the flavor of the decay process, but also to a concrete game mechanic in which items get immediately swapped out while in machines, etc.

Players intuitively understand what it means for a biter egg to "spoil". It seems the flavor immersiveness of calling it "hatch" would be at the cost of gameplay clarity.