Recycler: Difference between revisions
(fluid gets lost) |
(→Non-recyclable items: Clarified the list and added implementation details.) |
||
(30 intermediate revisions by 16 users not shown) | |||
Line 1: | Line 1: | ||
{{Languages}} | {{Languages}} | ||
{{:Infobox:Recycler}} | |||
{{Stub}} | {{Stub}} | ||
{{ | {{About/Space age}} | ||
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. | It has 4 module slots, but it cannot use [[Productivity module]]s. | ||
== 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 <math>\left \lfloor 0.25 \cdot \tfrac{i}{o} + r \right\rfloor</math>, where <math>i</math> is the number of items used as ingredients, <math>o</math> is the number of items returned by the recipe, and <math>r</math> 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 circuit]]s 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]]{{SA}}, 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]]{{SA}} 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 machine]]s 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: | |||
* All science packs | |||
* [[Biolab]] | |||
* [[Holmium plate]] (due to only using a liquid as input) | |||
* [[Landfill]] | |||
* [[Superconductor]] | |||
* [[Tungsten carbide]] | |||
* [[Uranium fuel cell]] | |||
* [[Wood processing]] | |||
* [[Yumako mash]]ing and [[Jelly]]. | |||
* [[Iron bacteria]] and [[copper bacteria]]. | |||
Recipes exclusively executed by non-assembler machines, but can still be reversed recycled: | |||
* [[Battery]] | |||
* [[Big mining drill]] | |||
* [[Fusion reactor]] | |||
* [[Fusion generator]] | |||
* [[Railgun]] | |||
* [[Railgun turret]] | |||
* [[Turbo transport belt]], [[Turbo underground belt]], and [[Turbo splitter]] | |||
Recipes shared by assembler/EMP and non-assembler machines which ''can'' be reversed: | |||
* [[Biochamber]] | |||
* [[Cryogenic plant]] | |||
* [[Foundry]] | |||
* [[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 === | |||
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. | |||
{| class="wikitable" style="text-align: left !important;" | |||
|- | |||
! Recycler Input !! Time !! Rates | |||
|- | |||
| {{Imagelink|Processing unit}} || 1.25s || 0.8/s | |||
|- | |||
| {{Imagelink|Advanced circuit}} || 0.75s || 1.33/s | |||
|- | |||
| {{Imagelink|Low density structure}} || 1.875s || 0.533/s | |||
|- | |||
| {{Imagelink|Steel plate}} || 2.0s || 0.5/s | |||
|- | |||
| {{Imagelink|Copper plate}} || 0.4s || 2.5/s | |||
|- | |||
| {{Imagelink|Iron plate}} || 0.4s || 2.5/s | |||
|- | |||
| {{Imagelink|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: | |||
{| class="wikitable" | |||
|- | |||
! Input || Output || Chance || Rate | |||
|- | |||
| rowspan="12" | {{Imagelink|Scrap|space-age=yes}} | |||
| {{Imagelink|Processing unit}} || 2% || 0.05/s | |||
|- | |||
| {{Imagelink|Advanced circuit}} || 3% || 0.075/s | |||
|- | |||
| {{Imagelink|Low density structure}} || 1% || 0.025/s | |||
|- | |||
| {{Imagelink|Solid fuel}} || 7% || 0.175/s | |||
|- | |||
| {{Imagelink|Steel plate}} || 4% || 0.1/s | |||
|- | |||
| {{Imagelink|Concrete}} || 6% || 0.15/s | |||
|- | |||
| {{Imagelink|Battery}} || 4% || 0.1/s | |||
|- | |||
| {{Imagelink|Ice|space-age=yes}} || 5% || 0.125/s | |||
|- | |||
| {{Imagelink|Stone}} || 4% || 0.1/s | |||
|- | |||
| {{Imagelink|Holmium ore|space-age=yes}} || 1% || 0.025/s | |||
|- | |||
| {{Imagelink|Iron gear wheel}} || 20% || 0.5/s | |||
|- | |||
| {{Imagelink|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)|scrap recycling productivity research]]. | |||
== Trivia == | |||
* If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour. | |||
== Gallery == | == Gallery == | ||
[[File:Fff-375-recycler-freezeframe.png|500px]] | [[File:Fff-375-recycler-freezeframe.png|500px]] | ||
== History == | |||
{{history|2.0.7| | |||
* Introduced in [[Space Age]]{{SA}} expansion. | |||
}} | |||
== See also == | == See also == | ||
* [ | * [[Quality]]{{SA}} | ||
{{ProductionNav}} | |||
{{C|Producers}} |
Latest revision as of 19:50, 1 December 2024
Recycler |
Recipe |
|||||||||||||
+ + + + → | |||||||||||||
Total raw |
|||||||||||||
+ + + + | |||||||||||||
Map color |
|||||||||||||
Health |
|
||||||||||||
Resistances |
Fire: 0/80% |
||||||||||||
Stack size |
20 |
||||||||||||
Dimensions |
4×2 |
||||||||||||
Energy consumption |
186 kW (electric) |
||||||||||||
Drain |
6.0 kW (electric) |
||||||||||||
Crafting speed |
|
||||||||||||
Mining time |
0.2 |
||||||||||||
Pollution |
2/m |
||||||||||||
Module slots |
4 slots |
||||||||||||
Prototype type |
|||||||||||||
Internal name |
recycler |
||||||||||||
Required technologies |
|||||||||||||
Produced by |
|||||||||||||
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:
- All science packs
- Biolab
- Holmium plate (due to only using a liquid as input)
- Landfill
- Superconductor
- Tungsten carbide
- Uranium fuel cell
- Wood processing
- Yumako mashing and Jelly.
- Iron bacteria and copper bacteria.
Recipes exclusively executed by non-assembler machines, but can still be reversed recycled:
- Battery
- Big mining drill
- Fusion reactor
- Fusion generator
- Railgun
- Railgun turret
- Turbo transport belt, Turbo underground belt, and Turbo splitter
Recipes shared by assembler/EMP and non-assembler machines which can be reversed:
Deeper details
From an implementation standpoint, the recycler uses the 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 recycling.lua
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 default_can_recycle
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 auto_recycle
field that ensures that the recipe cannot 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 | 1.25s | 0.8/s |
Advanced circuit | 0.75s | 1.33/s |
Low density structure | 1.875s | 0.533/s |
Steel plate | 2.0s | 0.5/s |
Copper plate | 0.4s | 2.5/s |
Iron plate | 0.4s | 2.5/s |
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 | Processing unit | 2% | 0.05/s |
Advanced circuit | 3% | 0.075/s | |
Low density structure | 1% | 0.025/s | |
Solid fuel | 7% | 0.175/s | |
Steel plate | 4% | 0.1/s | |
Concrete | 6% | 0.15/s | |
Battery | 4% | 0.1/s | |
Ice | 5% | 0.125/s | |
Stone | 4% | 0.1/s | |
Holmium ore | 1% | 0.025/s | |
Iron gear wheel | 20% | 0.5/s | |
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.
Trivia
- If the recycled item has a fluid ingredient, then the smoke emitted from the recycler matches the fluid in colour.