In other languages: Deutsch 简体中文

Recycler: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
(→‎Non-recyclable items: Clarified the list and added implementation details.)
(→‎Mechanics: Renamed "deeper details" to "technical details", moved it to the end of the "mechanics" section, and improved it.)
Line 54: Line 54:
* [[Foundry]]
* [[Foundry]]
* [[Nutrients]] from [[spoilage]]
* [[Nutrients]] from [[spoilage]]
==== Deeper details ====
From an implementation standpoint, the recycler uses the [https://lua-api.factorio.com/latest/prototypes/FurnacePrototype.html furnace prototype]. This means that the building selects recipes to perform based on the item it is given to process. Since there are hundreds of items in the game, the quality mod that defines the recycler's behavior does not manually list every reverse recipe. Instead, it generates them in script from the list of existing recipes. The scrap recycling recipe is a special exception because it's the only hard-coded recipe (and is defined in the Space Age mod, not the quality mod).
The file <code>recycling.lua</code> in the quality mod's prototype folder has the details for the generation of recipes, as well as which recipes should be reverse and which should not. The function <code>default_can_recycle</code> is what decides whether a given recipe can be recycled or not. This code primarily keys off of the recipe prototype's category field. However, there is an <code>auto_recycle</code> field that ensures that the recipe cannot be reversed.


=== Unique recycling recipes ===
=== Unique recycling recipes ===
Line 124: Line 118:


In total, the recycler spits out 1.5 items/s, meaning 10 recyclers are just enough to saturate a yellow belt. The output values are increased by [[Scrap recycling productivity (research)|scrap recycling productivity research]].
In total, the recycler spits out 1.5 items/s, meaning 10 recyclers are just enough to saturate a yellow belt. The output values are increased by [[Scrap recycling productivity (research)|scrap recycling productivity research]].
=== Technical details ===
Internally, the recycler uses the [https://lua-api.factorio.com/latest/prototypes/FurnacePrototype.html furnace prototype], which performs recipes that are automatically selected based on input ingredients. Every item in the game has its own "recycling" recipe, almost all of which are hidden in the Factoriopedia and can only be performed by a recycler.
Since there are hundreds of items in the game, as well as to ensure compatibility with third-party mods, most recycling recipes are not explicitly defined. Instead, recycling recipes are procedurally generated based on existing recipes. Depending on whether or not the item is deemed "recyclable", these procedurally generated recipes will either output a quarter of an item's ingredients or have a 25% chance of outputting the item itself.
The recyclabillity of most items is based on the category of their recipes, with some exceptions being explicitly filtered by the name of the recipe's prototype. Furthermore, items with multiple viable recycling recipes are made non-recyclable to avoid ambiguity, and recipes with multiple different products will fail to generate a recycling recipe, thereby making them irreversible as a default. Third-party mods can also explicitly make a recipe irreversible by setting the recipe's <code>auto_recycle</code> field to <code>false</code>.
The scrap recycling recipe is a special case, as it is the only hard-coded recipe. It is also the only recycling recipe that is not hidden from the player, and which can be performed without a recycler. (Notably, this recipe is defined by the Space Age mod rather than the Quality mod, as scrap is exclusive to the former.)
The generation of recycling recipes, as well as the filtering of non-recyclable recipes, is defined by the file <code>recycling.lua</code> in the quality mod's prototype folder. More specifically, the function <code>default_can_recycle</code> decides whether a given recipe can be recycled or not, and the function <code>add_recipe_values</code> does most of the configuration of recycling recipes, which includes setting the products of these recipes and how long they take to perform.


== Trivia ==
== Trivia ==

Revision as of 09:41, 4 December 2024

Recycler.png
Recycler

Recycler entity.png

Recipe

Time.png
3
+
Concrete.png
20
+
Iron gear wheel.png
40
+
Processing unit.png
6
+
Steel plate.png
20
Recycler.png
1

Total raw

Time.png
3
+
Concrete.png
20
+
Iron gear wheel.png
40
+
Processing unit.png
6
+
Steel plate.png
20

Map color

Health

Quality normal.png 300
Quality uncommon.png 390 Quality rare.png 480
Quality epic.png 570 Quality legendary.png 750

Resistances

Fire: 0/80%

Stack size

20

Dimensions

4×2

Energy consumption

186 kW (electric)

Drain

6.0 kW (electric)

Crafting speed

Quality normal.png 0.5
Quality uncommon.png 0.65 Quality rare.png 0.8
Quality epic.png 0.95 Quality legendary.png 1.25

Mining time

0.2

Pollution

2/m

Crafted only on

Fulgora.png

Module slots

4 slots

Prototype type

furnace

Internal name

recycler

Required technologies

Recycling (research).png

Produced by

Assembling machine 1.png
Assembling machine 2.png
Assembling machine 3.png
Player.png
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.


The recycler is a building that can convert most items into the ingredients used in their recipes, at the cost of losing 75% of said ingredients. In other words, it performs a lossy reversal of crafting.

It has 4 module slots, but it cannot use Productivity modules.

Mechanics

When an item enters a recycler, the item's main recipe is found, and the recycler is automatically set to perform its inverse.

For each type of item used as an ingredient in the recycled item's main recipe, the number of items returned by the recycler is decided by , where is the number of items used as ingredients, is the number of items returned by the recipe, and is a random number that is greater than or equal to 0 but less than 1. On average, this returns exactly 25% of the items needed to craft one item of the same type as the recycled item. For example, recycling a processing unit always gives 5 electronic circuits while having a 50% chance of returning one advanced circuit.

All fluid ingredients are lost when recycling, as the recycler has no fluid output.

Without quality modules, the resulting items have the same quality as the item being recycled, even if the latter was crafted using lower-quality ingredients. Quality modules can further increase the output's quality, just like with regular non-recycling recipes.

The recycler has 12 internal slots for its output, but can only hold one stack of each item. The recycler will try to eject the contents of these slots, much like a mining drill. It is therefore not necessary to use an inserter to collect its output. Much like the big mining drill, if the recycler has more than one of an individual item type in its inventory, the recycler will output stacks of materials onto a belt if the stack inserter has been researched.

Non-recyclable items

The broad rule governing the recycler's ability to reverse a recipe is that it can only reverse recipes made in Assembling machines of some type. There are many exceptions to this, however. For the purposes of the recycler's ability to recycle items, the Electromagnetic plant counts as an "assembler". So all of its recipes count unless otherwise stated. Recipes shared by assemblers and other machines are not so clear-cut: sometimes they count as recipes for those other machines, but sometimes they count as pure assembler recipes.

Items can have multiple recipes; all that is needed for the recycler to reverse it is to find a single reversible recipe that produces that item.

If no valid recipe producing the item can be reversed, the recycler will return the same item 25% of the time (possibly with a Quality bonus if the appropriate modules are used), with the other 75% destroying the item.

Recipes which can be made in an assembler (possibly also in non-assembler buildings) which cannot be reversed:

Recipes exclusively executed by non-assembler machines, but can still be reversed recycled:

Recipes shared by assembler/EMP and non-assembler machines which can be reversed:

Unique recycling recipes

Some items have unique recycling recipes:

  • Recycling scrap will perform the scrap recycling recipe, for which there is no inverse, as scrap can not be crafted. This is used to obtain most resources on Fulgora.
  • Recycling one nutrients will yield 2.5x that amount of spoilage, as if they were made using the nutrients from spoilage recipe. This is useful for getting rid of excess nutrients, as they cannot be burned directly.

Stats

The recycling recipe for an item besides scrap takes time equal to 1/16th (0.0625) of the time it takes to craft that item. (Items without recipes, such as ore, are treated as having a crafting time of 0.5 seconds.) But because the recycler has a base crafting speed of 0.5, the time it takes one recycler to recycle one item is effectively 1/8th (0.125) of the item's crafting time without modules or beacons. For example, the time it takes to craft a steel plate in a stone furnace (which has a crafting speed of 1) is 16 seconds, and so recycling a steel plate takes 2 seconds. The following table provides some examples of how long it takes a recycler without modules or beacons to recycle one of that item, and the rate at which it recycles those items.

Recycler Input Time Rates
Processing unit.png
Processing unit
1.25s 0.8/s
Advanced circuit.png
Advanced circuit
0.75s 1.33/s
Low density structure.png
Low density structure
1.875s 0.533/s
Steel plate.png
Steel plate
2.0s 0.5/s
Copper plate.png
Copper plate
0.4s 2.5/s
Iron plate.png
Iron plate
0.4s 2.5/s
Iron ore.png
Iron ore
0.0625s 16/s

The scrap recycling recipe takes .2 seconds, meaning that it actually takes .4 seconds to run in a recycler, so a recycler takes in 2.5 scrap/s. The output rates are as follows:

Input Output Chance Rate
Scrap.png
Scrap
Processing unit.png
Processing unit
2% 0.05/s
Advanced circuit.png
Advanced circuit
3% 0.075/s
Low density structure.png
Low density structure
1% 0.025/s
Solid fuel.png
Solid fuel
7% 0.175/s
Steel plate.png
Steel plate
4% 0.1/s
Concrete.png
Concrete
6% 0.15/s
Battery.png
Battery
4% 0.1/s
Ice.png
Ice
5% 0.125/s
Stone.png
Stone
4% 0.1/s
Holmium ore.png
Holmium ore
1% 0.025/s
Iron gear wheel.png
Iron gear wheel
20% 0.5/s
Copper cable.png
Copper cable
3% 0.075/s

In total, the recycler spits out 1.5 items/s, meaning 10 recyclers are just enough to saturate a yellow belt. The output values are increased by scrap recycling productivity research.

Technical details

Internally, the recycler uses the furnace prototype, which performs recipes that are automatically selected based on input ingredients. Every item in the game has its own "recycling" recipe, almost all of which are hidden in the Factoriopedia and can only be performed by a recycler.

Since there are hundreds of items in the game, as well as to ensure compatibility with third-party mods, most recycling recipes are not explicitly defined. Instead, recycling recipes are procedurally generated based on existing recipes. Depending on whether or not the item is deemed "recyclable", these procedurally generated recipes will either output a quarter of an item's ingredients or have a 25% chance of outputting the item itself.

The recyclabillity of most items is based on the category of their recipes, with some exceptions being explicitly filtered by the name of the recipe's prototype. Furthermore, items with multiple viable recycling recipes are made non-recyclable to avoid ambiguity, and recipes with multiple different products will fail to generate a recycling recipe, thereby making them irreversible as a default. Third-party mods can also explicitly make a recipe irreversible by setting the recipe's auto_recycle field to false.

The scrap recycling recipe is a special case, as it is the only hard-coded recipe. It is also the only recycling recipe that is not hidden from the player, and which can be performed without a recycler. (Notably, this recipe is defined by the Space Age mod rather than the Quality mod, as scrap is exclusive to the former.)

The generation of recycling recipes, as well as the filtering of non-recyclable recipes, is defined by the file recycling.lua in the quality mod's prototype folder. More specifically, the function default_can_recycle decides whether a given recipe can be recycled or not, and the function add_recipe_values does most of the configuration of recycling recipes, which includes setting the products of these recipes and how long they take to perform.

Trivia

  • If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.

Gallery

Fff-375-recycler-freezeframe.png

History

See also