In other languages:

Spoilage mechanics

From Official Factorio Wiki
Revision as of 13:52, 29 November 2024 by Orthotoma (talk | contribs) (rearranged table by spoil time since wikitable sort can't do it)
Jump to navigation Jump to search
No-building-material-icon.png
This article is a stub, and not comprehensive.
You can help this wiki by expanding it.

Space Age expansion exclusive feature.

For the article encompassing the spoilage item, see Spoilage.

Spoilage is a mechanism whereby an item type, after a fixed period of time, will spontaneously transform into a different item, or sometimes an entity (or nothing at all). Most items which can spoil are either produced on Gleba or produced from Gleba resources.

Spoil time and freshness

Any type of item which can spoil has a spoil time, the maximum time it takes for the item to spoil. An item's freshness is a percentage of how far the item is from spoiling. 100% freshness means that the item is at its maximum spoil time away from spoiling, and 0% meaning that it has spoiled.

Spoiling can happen at any time. It can happen while an item is in a chest, in the input or output slots of a machine, in the hand of an inserter, etc. Almost nothing can arrest the process of spoilage.

Spoilable Item Times
Item Time
Raw fish.png
Raw fish
2 hours, 5 minutes, 50 seconds
Bioflux.png
Bioflux
2 hours
Jellynut.png
Jellynut
1 hour
Yumako.png
Yumako
1 hour
Agricultural science pack.png
Agricultural science pack
1 hour
Biter egg.png
Biter egg
30 minutes
Pentapod egg.png
Pentapod egg
15 minutes
Nutrients.png
Nutrients
5 minutes
Jelly.png
Jelly
4 minutes
Yumako mash.png
Yumako mash
3 minutes
Copper bacteria.png
Copper bacteria
1 minute
Iron bacteria.png
Iron bacteria
1 minute

Freshness and stacking

When spoilable items form a stack (inserters picking up items, items being placed in containers, items being placed in a production machine, etc), the freshness of the resulting stack is determined by the average freshness of all items being combined. If you take a stack of 10 items with freshness 50% and add one item of freshness 100%, the result is a stack of 11 items with a freshness of 54.5%.

As such, all items in a stack will spoil at the same time. If spoiling spawns an entity, one entity will be spawned per item in the stack.

Production and freshness

Items that are generated by means other than a machine (or the player) executing a recipe are generated at 100% freshness. This includes harvesting Yumakos and Jellynuts, as well as extracting Biter eggs from Captive biter spawners.

If no spoilable inputs are used to generate a spoilable output, then the freshness of the output is determined by the recipe (usually 100% fresh, but nutrients created from spoilage are 50% fresh). Note that Recycler recipes are no different; if a non-spoilable item can be recycled to a spoilable input, that input item will have 100% freshness (the Biochamber recipe is one such example).

If a recipe generates a spoilable product using one or more spoilable inputs, the freshness of the spoilable input products may be transferred to the freshness of the output. If the recipe only has one spoilable input, then the freshness percentage is transferred directly to the output. If a recipe uses multiple spoilable inputs, then the freshness of the output is the average freshness of the input.

That having been said, catalytic recipes (recipes which consume and produce an item of the same type) do not transfer freshness to their catalytic product; their outputs are always 100% fresh.

While items can spoil while in a machine's input slots, once the item has been consumed to start a production cycle, the item cannot spoil.

The freshness of inputs can transfer to outputs. But the freshness of the fuel used to power the building producing the spoilable product is irrelevant. The Biochamber uses nutrients as fuel, but so long as the recipe itself does not use nutrients as an ingredient, the freshness of those nutrients does not matter to the freshness of the output.

Freshness effects

For most spoilable items, their freshness matters only in that the freshness can transfer during production. For Agricultural science packs however, there is an additional effect. Freshness affects the science value produced by a lab when the pack is being consumed. As such, a pack that is consumed while 50% fresh will only generate 50% the science value of a 100% fresh science pack.

Note that freshness does not affect the fuel value of any spoilable that has a fuel value. So long as the fuel is consumed before it spoils, it will impart all of its energy to the device.

Spoil products

Most items which can spoil will transform into Spoilage, but some items spoil into other things. Some items transform into entities on the map.

Special spoilables
Item Special effect on spoiling
Copper bacteria.png
Copper bacteria
Turns into copper ore
Iron bacteria.png
Iron bacteria
Turns into iron ore
Biter egg.png
Biter egg
Spawns a big biter
Pentapod egg.png
Pentapod egg
Spawns a wriggler

Special spoiling effects

When an item spoils, it transforms into a different item, or even an entity. Because spoiling can happen at any time, the game must account for this possibility in a variety of ways.

If a recipe consumes or generates a spoilable item, the machine executing that recipe gains a number of "trash slots" appropriate for the spoil products of these types. If a stack in its input or output slots spoils, then those items are moved to the machine's trash slots. The machine may not continue to operate if its trash slots are full. Any output inserter can take from trash slots, so you may need to filter inserters to specifically remove trash.

If an inserter is aimed at a machine which has trash slots based on spoilable input items, and the item it attempts to insert into the machine spoils before insertion is complete, the inserter will insert the item into the machine's trash slots. It will *not* do so if the item has spoiled before it was picked up (and it will not pick up spoiled items).

Labs and Biolabs have pass-through logic that allows science packs to be passed from one machine to another. While this works for Agricultural science packs, it does not work for spoilage. So each lab must have its own inserter specifically to remove any spoilage.

While inserters can be filtered, spoilable items can cause filters to be bypassed if the item spoils after being picked up. The inserter will not attempt to put the item back even if the spoiled item type violates the rules of the filter.

If an inserter is holding an item that spoils, it will immediately turn and attempt to insert the item in its destination. Note that this overrides the general rule of Stack inserters that they only turn when they have a full hand size. This is done to prevent stack inserters from getting stuck.