In other languages: 简体中文

Tutorial:Quality upcycling math: Difference between revisions

From Official Factorio Wiki
Jump to navigation Jump to search
Untitled7 (talk | contribs)
707090 (talk | contribs)
The original article is very high level and low on explanation for the way the math works. I have attempted to make the article easier to follow along for those who are rusty on their matrix algebra
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Languages}}
How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?
How do we get the most amount of [[Quality|legendary]] items out of an upcycling plant?


The answer is not quite as straight forward as we'd like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]].
The answer is not quite as straight forward as we'd like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from [[Technologies#Space_Age|infinite technologies]]. But first, a presentation of the results.
 
== Best ratios ==
The table below shows the best ratio for [[Quality module 3|quality]] to [[Productivity module 3|productivity modules]] in the crafting machines, while the [[Recycler|recyclers]] always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. "3.67 quality / 1.33 productivity" could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.
 
The columns "X products" denote modules need to install into the machines that are set to produce items of X quality.
 
{| class="wikitable"
|+ Use normal modules
! Crafting machine || [[File:quality_normal.png|16px]]Normal products || [[File:quality_uncommon.png|16px]]Uncommon products || [[File:quality_rare.png|16px]] Rare products || [[File:quality_epic.png|16px]] Epic products || [[File:quality_legendary.png|16px]] Legendary products || Percentage yield || Items recycled*
|-
| {{Imagelink|Chemical plant}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]3}} || 0.034014% || 2940
|-
| {{Imagelink|Assembling machine 3}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]4}} || 0.046275% || 2161
|-
| {{Imagelink|Foundry}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]4}}  || 0.133814% || 747
|-
| {{Imagelink|Electromagnetic plant}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]5}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]5}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]5}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]5}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]5}} || 0.176712% || 566
|-
| {{Imagelink|Cryogenic plant}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]6}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]2}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]6}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]2}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]6}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]2}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]6.5}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]1.5}} || {{icon|Quality module 3|[[File:quality_normal.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_normal.png|16px]]8}} || 0.119134%|| 840
|}
 
{| class="wikitable"
|+ Use uncommon modules
! Crafting machine || [[File:quality_normal.png|16px]]Normal products || [[File:quality_uncommon.png|16px]]Uncommon products || [[File:quality_rare.png|16px]] Rare products || [[File:quality_epic.png|16px]] Epic products || [[File:quality_legendary.png|16px]] Legendary products || Percentage yield || Items recycled*
|-
| {{Imagelink|Chemical plant}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]3}} || 0.059498% || 1681
|-
| {{Imagelink|Assembling machine 3}} ||  {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3.75}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.25}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3.75}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.25}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3.8}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.2}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]3.9}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.1}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]4}} || 0.082296% || 1216
|-
| {{Imagelink|Foundry}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]4}} || 0.243699% || 410
|-
| {{Imagelink|Electromagnetic plant}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.7}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.3}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.67}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.33}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.75}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.25}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.9}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]0.1}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]5}} || 0.324189% || 309
|-
| {{Imagelink|Cryogenic plant}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.6}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]3.4}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.6}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]3.4}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]4.67}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]3.33}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]5}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]3}} || {{icon|Quality module 3|[[File:quality_uncommon.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_uncommon.png|16px]]8}} || 0.257621% || 389
|}
 
{| class="wikitable"
|+ Use rare modules
! Crafting machine || [[File:quality_normal.png|16px]]Normal products || [[File:quality_uncommon.png|16px]]Uncommon products || [[File:quality_rare.png|16px]] Rare products || [[File:quality_epic.png|16px]] Epic products || [[File:quality_legendary.png|16px]] Legendary products || Percentage yield || Items recycled*
|-
| {{Imagelink|Chemical plant}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]2.8}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.2}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]2.8}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.2}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]2.9}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]2.9}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]3}} || 0.100660% || 994
|-
| {{Imagelink|Assembling machine 3}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.1}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.9}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.2}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.8}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.33}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.67}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4}} || 0.145220% || 689
|-
| {{Imagelink|Foundry}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.5}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.5}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.5}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.5}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.9}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]0.1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4}} || 0.424039% || 236
|-
| {{Imagelink|Electromagnetic plant}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]1.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]1.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]1.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.9}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]1.1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]5}} || 0.588510% || 170
|-
| {{Imagelink|Cryogenic plant}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.6}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4.4}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]3.9}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]4.1}} || {{icon|Quality module 3|[[File:quality_rare.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_rare.png|16px]]8}} || 0.565030% || 177
|}
 
{| class="wikitable"
|+ Use epic modules
! Crafting machine || [[File:quality_normal.png|16px]]Normal products || [[File:quality_uncommon.png|16px]]Uncommon products || [[File:quality_rare.png|16px]] Rare products || [[File:quality_epic.png|16px]] Epic products || [[File:quality_legendary.png|16px]] Legendary products || Percentage yield || Items recycled*
|-
| {{Imagelink|Chemical plant}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.33}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]0.67}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.4}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]0.6}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.4}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]0.6}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.4}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]0.6}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]3}} || 0.152486% || 656
|-
| {{Imagelink|Assembling machine 3}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.5}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.5}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.5}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.5}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.8}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.2}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]4}} || 0.232966% || 430
|-
| {{Imagelink|Foundry}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.7}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.3}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.7}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.3}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.75}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1.25}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]3}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]1}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]4}} || 0.664130% || 151
|-
| {{Imagelink|Electromagnetic plant}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]2.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]2.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.67}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]2.33}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.9}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]2.1}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]5}} || 0.974700% || 103
|-
| {{Imagelink|Cryogenic plant}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]5.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]5.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.6}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]5.4}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]2.8}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]5.2}} || {{icon|Quality module 3|[[File:quality_epic.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_epic.png|16px]]8}} || 1.122444% || 90
|}
 
{| class="wikitable"
|+ Use legendary modules
! Crafting machine || [[File:quality_normal.png|16px]]Normal products || [[File:quality_uncommon.png|16px]]Uncommon products || [[File:quality_rare.png|16px]] Rare products || [[File:quality_epic.png|16px]] Epic products || [[File:quality_legendary.png|16px]] Legendary products || Percentage yield || Items recycled*
|-
| {{Imagelink|Chemical plant}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]1.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]1.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]1.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.8}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]1.2}}  || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]3}} || 0.344061% || 291
|-
| {{Imagelink|Assembling machine 3}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.67}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.33}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.8}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.2}}  || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}} || 0.586191% || 171
|-
| {{Imagelink|Foundry}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.4}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.6}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.4}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.6}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.4}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.6}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1.5}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]2.5}}  || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}} || 1.624266% || 62
|-
| {{Imagelink|Electromagnetic plant}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]1}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]4}}  || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]5}} || 2.722332% || 37
|-
| {{Imagelink|Cryogenic plant}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]8}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]8}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]8}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]8}} || {{icon|Quality module 3|[[File:quality_legendary.png|16px]]0}} + {{icon|Productivity module 3|[[File:quality_legendary.png|16px]]8}} || 4.835199% || 21
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
 
 
=== Number of crafting machines ===
If we assume a constant input stream of uncommon items, which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier of quality. This is done by setting <math>m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}</math> after each iteration and further adjusting for the crafting machines change in speed dependant on the modules (assuming the machines which only house productivity modules are not additionally boosted by [[Speed module 3|speed moduled]] [[beacon]]s). See the calculations further below for a full explanation of the calculations.
 
{| class="wikitable"
|+ Per recycler
! Crafting machine || Recyclers || Machines for<br />[[File:quality_normal.png|16px]]normal products || Machines for<br />[[File:quality_uncommon.png|16px]]uncommon products || Machines for<br />[[File:quality_rare.png|16px]] rare products || Machines for<br />[[File:quality_epic.png|16px]] epic products || Machines for<br />[[File:quality_legendary.png|16px]] legendary products
|-
| [[Chemical plant]] || 1 || 4.418130519 || 0.037216657 || 1.294369664 || 0.009779 || 0.431955
|-
| [[Assembling machine 3]] || 1 || 4.733868899 || 0.052316655 || 1.527502978 || 0.015336 || 0.52576
|-
| [[Foundry]] || 1 || 4.314446 || 0.082198 || 1.683088 || 0.03016 || 0.58448
|-
| [[Electromagnetic plant]] || 1 || 4.494435 || 0.116985 || 1.93479 || 0.049665 || 0.60795
|-
| [[Cryogenic plant]] || 1 || 5.23556 || 0.21384 || 2.53374 || 0.1034 || 0.594
|}
 
{| class="wikitable"
|+ Per legendary crafter (exact)
! Crafting machine || Recyclers || Machines for<br />[[File:quality_normal.png|16px]]normal products || Machines for<br />[[File:quality_uncommon.png|16px]]uncommon products || Machines for<br />[[File:quality_rare.png|16px]] rare products || Machines for<br />[[File:quality_epic.png|16px]] epic products || Machines for<br />[[File:quality_legendary.png|16px]] legendary products
|-
| [[Chemical plant]] || 90.1223 || 331.8198 || 38.5325 || 11.2893 || 2.9653 || 1
|-
| [[Assembling machine 3]] || 52.8432 || 208.4632 || 30.3992 || 9.8094 || 2.8783 || 1
|-
| [[Foundry]] || 24.7668 || 89.0483 || 19.9206 || 7.7712 || 2.8592 || 1
|-
| [[Electromagnetic plant]] || 16.5379 || 61.9418 || 17.4010 || 7.4908 || 3.1822 || 1
|-
| [[Cryogenic plant]] || 10.8718 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1
|}
 
{| class="wikitable"
|+ Per legendary crafter (conservative)
! Crafting machine || Recyclers || Machines for<br />[[File:quality_normal.png|16px]]normal products || Machines for<br />[[File:quality_uncommon.png|16px]]uncommon products || Machines for<br />[[File:quality_rare.png|16px]] rare products || Machines for<br />[[File:quality_epic.png|16px]] epic products || Machines for<br />[[File:quality_legendary.png|16px]] legendary products
|-
| [[Chemical plant]] || 53 || 198 || 23 || 7 || 2 || 1
|-
| [[Assembling machine 3]] || 31 || 123 || 18 || 6 || 2 || 1
|-
| [[Foundry]] || 14 || 53 || 12 || 5 || 2 || 1
|-
| [[Electromagnetic plant]] || 14 || 56 || 16 || 7 || 3 || 1
|-
| [[Cryogenic plant]] || 9 || 41 || 16 || 8 || 4 || 1
|}


== The crafting machines ==
== The crafting machines ==
Line 17: Line 148:
| [[Cryogenic plant]] || 8 || +0%
| [[Cryogenic plant]] || 8 || +0%
|}
|}


== Quality probability ==
== Quality probability ==
Line 25: Line 155:
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.
The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.


* <math>m_{i,k}</math> ... Number of materials of tier <math>i</math> after the <math>k</math>-th iteration before being crafted. (this doesn't mean that an item only needs one type of ingredient, but that "1 materials" can be crafted into 1 item from them)
* <math>m_{i,k}</math> ... Number of materials of tier <math>i</math> (whereas 1 is normal, 2 is uncommon, 3 is rare, 4 is epic, and 5 is legendary) after the <math>k</math>-th iteration before being crafted. (this doesn't mean that an item only needs one type of ingredient, but that "1 materials" can be crafted into 1 item from them)
* <math>n_{i,k}</math> ... Number of items of tier <math>i</math> after the <math>k</math>-th iteration, after being crafted together.
* <math>n_{i,k}</math> ... Number of items of tier <math>i</math> after the <math>k</math>-th iteration, after being crafted together.
* <math>p_0</math> ... the crafting machines inherent productivity bonus
* <math>p_0</math> ... the crafting machines inherent productivity bonus
Line 33: Line 163:
* <math>q_i = (N-x_i) \cdot 6.2 \, \%</math> ... quality probability due to <math>(N - x_i)</math> legendary quality module 3's in the crafting machine which takes <math>i</math>-tier materials
* <math>q_i = (N-x_i) \cdot 6.2 \, \%</math> ... quality probability due to <math>(N - x_i)</math> legendary quality module 3's in the crafting machine which takes <math>i</math>-tier materials


=== Recycled materials ===
=== Quality Matrix ===
When a quarter of all items being recycled and the quality probability rules we can write the equations for the amount of materials received after recycling. This calculation is rather simple, as we the lowest tier can only come forth from it's own tier failing to raise in quality. The second tier are 90% of tier 1 items that did increase, and all those tier 2 items that didn't. This continues for all tiers as follows, but legendary items <math>n_{5,k}</math> will not be recycled
When any machine with a quality chance operates on its ingredients it will have a chance to increase its quality with the probability mentioned above. We can model this quality increase chance as a transformation matrix. Common outputs only have one term because they are only created from common inputs which fail to increase in quality since Uncommon items and above can only increase in quality. Uncommon outputs are created from uncommon inputs which failed to increase in quality, as well as all common inputs which got a single rarity upgrade. This equation repeats for the higher tiers, summing up the chances of a jump from lower tiers as well inputs which failed to upgrade from its own teir. Additionally, the number of outputs can be increased with machine productivity. The quantity of outputs from each tier machine can be multiplied by the productivity of the machine.
 
Inputs starting at each tier have different potential upgrade upside since quality is capped at legendary. This means that it is optimal to vary the ratio of productivity to quality modules used in each tier of machine (<math>p_i</math> will not be the same for all tiers).


<math>
<math>
\begin{align}
\begin{align}
m_{1,k+1} &= \frac{n_{1,k}}{4} \cdot (1 - q_r)\\
\text{normal outputs:}\quad n_{1,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\
m_{2,k+1} &= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.9 &+& \frac{n_{2,k}}{4} \cdot (1 - q_r)\\
\text{uncommon outputs:}\quad n_{2,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &+& m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\
m_{3,k+1} &= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.09 &+& \frac{n_{2,k}}{4} \cdot q_r \cdot 0.9 &+& \frac{n_{3,k}}{4} \cdot (1 - q_r)\\
\text{rare outputs:}\quad n_{3,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &+& m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\
m_{4,k+1} &= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.009 &+& \frac{n_{2,k}}{4} \cdot q_r \cdot 0.09 &+& \frac{n_{3,k}}{4} \cdot q_r \cdot 0.9 &+& \frac{n_{4,k}}{4} \cdot (1 - q_r)\\
\text{epic outputs:}\quad n_{4,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &+& m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9 &+& m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\
m_{5,k+1} &= \frac{n_{1,k}}{4} \cdot q_r \cdot 0.001 &+& \frac{n_{2,k}}{4} \cdot q_r \cdot 0.01 &+& \frac{n_{3,k}}{4} \cdot q_r \cdot 0.1 &+& \frac{n_{4,k}}{4} \cdot q_r\\
\text{legendary outputs:}\quad n_{5,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &+& m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1 &+& m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &+& m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\
\end{align}
\end{align}
</math>
</math>


which can also be written as a vector-matrix-multiplication <math>\textbf{m}_{k+1} = \textbf{A} \,\textbf{n}_k</math>
Something to note is that the equation for legendary items does not use <math>q_{5}</math>. This is because the number of legendary outputs made from legendary inputs is unaffected by quality modules since they are already the maximum quality.
 
This set of equations can be written as a matrix multiplication.
 
<math>
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} =  
\underbrace{\begin{bmatrix}
( 1 + p_1 ) \cdot (1 - q_1) & 0 & 0 & 0 & 0 \\
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &  ( 1 + p_2 ) \cdot (1 - q_2) & 0 & 0 & 0 \\
( 1 + p_1 ) \cdot q_1 \cdot 0.09 & ( 1 + p_2 ) \cdot q_2 \cdot 0.9 & ( 1 + p_3 ) \cdot (1 - q_3) & 0 & 0 \\
( 1 + p_1 ) \cdot q_1 \cdot 0.009 & ( 1 + p_2 ) \cdot q_2 \cdot 0.09 & ( 1 + p_3 ) \cdot q_3 \cdot 0.9  & ( 1 + p_4) \cdot (1 - q_4) & 0 \\
( 1 + p_1 ) \cdot q_1 \cdot 0.001 & ( 1 + p_2 ) \cdot q_2 \cdot 0.01 & ( 1 + p_3 ) \cdot q_3 \cdot 0.1  & ( 1 + p_4) \cdot q_4 & ( 1 + p_5)\\
\end{bmatrix}}_{Quality and Productivity Matrix}
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}
</math>
 
This Quality and Productivity Matrix can be built with a quality and productivity vector (<math>q_{1-5}</math> and <math>p_{1-5}</math>). It allows us to simply matrix multiply our vector of inputs <math>m_{k}</math> with our transformation matrix to get the number of outputs in each tier <math>n_{k}</math>. In order to further simplify, we can factor the productivity matrix out as well since it is simply a scaling matrix.


<math>
<math>
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} =
\underbrace{\begin{bmatrix}
(1 - q_1) & 0 & 0 & 0 & 0 \\
q_1 \cdot 0.9 & (1 - q_2) & 0 & 0 & 0 \\
q_1 \cdot 0.09 & q_2 \cdot 0.9 & (1 - q_3) & 0 & 0 \\
q_1 \cdot 0.009 & q_2 \cdot 0.09 & q_3 \cdot 0.9  & (1 - q_4) & 0 \\
q_1 \cdot 0.001 & q_2 \cdot 0.01 & q_3 \cdot 0.1  & q_4 & 1\\
\end{bmatrix}}_{Quality Matrix}
\underbrace{\begin{bmatrix}
1 + p_1 & 0 & 0 & 0 & 0 \\
0 & 1 + p_2 & 0 & 0 & 0 \\
0 & 0 & 1 + p_3 & 0 & 0 \\
0 & 0 & 0 & 1 + p_4 & 0 \\
0 & 0 & 0 & 0 & 1 + p_5 \\
\end{bmatrix}}_{Productivity Matrix}
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}
=
</math>
 
Now that we have a general framework modelling how machines interact with quality, we need to combine to the two parts of the upcycling cycle: recycling and recrafting.
 
=== Recycled materials ===
A recycler is a machine just like any other with a few nuances:
 
* Its inputs are fully built items (<math>n_{k}</math>), and its outputs are the materials for those items (<math>m_{k}</math>).
* It cannot accept productivity modules so it is clearly optimal to just fill it with quality modules. Since the amount of productivity cannot be varied, we will fill every tier of recycler with the same quality modules, thus making <math>q_{1-5}</math> all the same value <math>q_r</math>.
* The recycler comes with a built-in (anti-)productivity of -75% which gets rid of most of what is input to it.
* In an upcycling factory, we do not want to recycle legendary products since they are the final output. So we will manually set the 1 in the bottom right corner to 0 indicating that we will not be putting any legendary products into the recycler regardless of how many we have (this will be accounted for later in the final model).
 
If we plug those into our matrix model we get this:
 
<math>
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}} =  
\underbrace{\begin{bmatrix}
\underbrace{\begin{bmatrix}
\frac{1 - q_r}{4} & 0 & 0 & 0 & 0\\
(1 - q_r) & 0 & 0 & 0 & 0 \\
\frac{0.9 \, q_r}{4}  & \frac{1 - q_r}{4} & 0 & 0 & 0\\
q_r \cdot 0.9 & (1 - q_r) & 0 & 0 & 0 \\
\frac{0.09 \, q_r}{4}  & \frac{0.9 \, q_r}{4}  & \frac{1 - q_r}{4} & 0 & 0 \\
q_r \cdot 0.09 & q_r \cdot 0.9 & (1 - q_r) & 0 & 0 \\
\frac{0.009 \, q_r}{4} & \frac{0.09 \, q_r}{4} & \frac{0.9 \, q_r}{4} & \frac{1 - q_r}{4} & 0\\
q_r \cdot 0.009 & q_r \cdot 0.09 & q_r \cdot 0.9 & (1 - q_r) & 0 \\
\frac{0.001 \, q_r}{4} & \frac{0.01 \, q_r}{4} & \frac{0.1 \, q_r}{4} & \frac{q_r}{4} & 0\\
q_r \cdot 0.001 & q_r \cdot 0.01 & q_r \cdot 0.1  & q_r & 0\\
\end{bmatrix}}_{\textbf{A}}
\end{bmatrix}}_{Quality Matrix}
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}
\underbrace{\begin{bmatrix}
1 + -0.75 & 0 & 0 & 0 & 0 \\
0 & 1 + -0.75 & 0 & 0 & 0 \\
0 & 0 & 1 + -0.75 & 0 & 0 \\
0 & 0 & 0 & 1 + -0.75 & 0 \\
0 & 0 & 0 & 0 & 1 + -0.75 \\
\end{bmatrix}}_{Productivity Matrix}
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}}
</math>
</math>


As we assume there is nothing to be done about recyclers to make them more effective but fill them with all quality modules, the value of <math>q_r = 0.248</math> is a constant, and therefore the matrix <math>\textbf{A}</math> is also a constant. For legendary quality module 3's, it looks like:
This new set of Quality and Productivity Matrices has only a single input variable <math>q_r</math>. If we assume the recycler has 4 legendary quality module 3s, that produces a total quality chance of <math>q_r = 0.248</math>, we could for instance calculate the recycler's transformation matrix by plugging that in:


<math> \textbf{A} =  
<math> \textbf{R} =  
\begin{bmatrix}
\begin{bmatrix}
0.188 & 0 & 0 & 0 & 0 \\
0.188 & 0 & 0 & 0 & 0 \\
Line 72: Line 257:
\end{bmatrix}</math>
\end{bmatrix}</math>


=== Recrafted items ===
At this point in the tutorial I want to review what this all means for those of you who are new or rusty on your matrix algebra. This transformation matrix represents the ratio of outputs of each rarity that will be produced for every input. Each column represents the input rarity. Remember in our equations that we derived this matrix from, common items were always the first term. Each row represents the output rarity of the items after the machine has processed it. So for example the at <math>0.005</math> at <math>A_{3,1}</math> means that for every common input, we will get 0.005 rare (because it is in row 3) outputs. The beautiful thing about this transformation matrix is that it captures every transition chance from any rarity to any other rarity all at once when something is processed by the machine (a recycler with 4 legendary quality module 3s in this case).
Once more we first check how many items are produced, which is, again, the sum of all possible ways to get to a tier, this time adding productivity <math>p_i</math>, and bringing along all those items which are already legendary <math>n_{5,k}</math>
 
=== Combined model ===
We can combine the transforms for a machine using the quality chance matrix above, along with the special transform matrix for the recycling part of the loop to form a larger equation representing the transition through the full recycle+build cycle. We will call the assembly combined Quality and Productivity matrix A and the recycling Quality and Productivity matrix R:
 
The final outputs for a given iteration are formed from the assembler transformation applied to the materials we have in that same iteration.


<math>
<math>
\begin{align}
\begin{align}
n_{1,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot (1 - q_1)\\
\textbf{n}_{k+1}  
n_{2,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.9 &+&  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot (1 - q_2)\\
    &= \textbf{A} \, \textbf{m}_{k+1}\\
n_{3,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.09 &+&  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.9 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot (1 - q_3) \\
n_{4,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.009 &+&  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.09 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.9  &+& m_{4,k+1} \cdot ( 1 + p_4) \cdot (1 - q_4) \\
n_{5,k+1} &= m_{1,k+1} \cdot ( 1 + p_1 ) \cdot q_1 \cdot 0.001 &+&  m_{2,k+1} \cdot ( 1 + p_2 ) \cdot q_2 \cdot 0.01 &+& m_{3,k+1} \cdot ( 1 + p_3 ) \cdot q_3 \cdot 0.1  &+& m_{4,k+1} \cdot ( 1 + p_4) \cdot q_4 &+& m_{5,k+1} \cdot ( 1 + p_5) + n_{5,k}\\
\end{align}
\end{align}
</math>
</math>


This can once more be written as a vector-matrix-multiplication <math>\textbf{n}_{k+1} = \textbf{B} \,\textbf{m}_{k+1} + \textbf{C} \,\textbf{n}_{k}</math>
We can substitute the recycler matrix for <math>m_{k+1}</math> since that is where the materials come from.


<math>
<math>
\underbrace{\begin{bmatrix} n_{1,k+1}\\ n_{2,k+1}\\ n_{3,k+1}\\ n_{4,k+1}\\ n_{5,k+1}\\ \end{bmatrix}}_{\textbf{n}_{k+1}} =  
\begin{align}
\textbf{n}_{k+1}  
    &= \textbf{A} \, \textbf{R} \,\textbf{n}_{k}\\
\end{align}
</math>
 
This is where we need to remember our modification to the recycling transformation matrix. We set the value which represented the number of recycled legendary items to 0 because we dont want to recycle items which are already legendary. We need to account for those items which have already made it to legenedary in our combined cycle equation. To do that we will multiply our current products matrix <math>n_k</math> by a matrix unit to carry over legendary products from previous iterations. We will call this carryover from iteration k <math>C_k</math>
 
<math>
\begin{align}
\textbf{C}_{k}  
    &=  
\underbrace{\begin{bmatrix}
\underbrace{\begin{bmatrix}
( 1 + p_1 ) \cdot (1 - q_1) & 0 & 0 & 0 & 0 \\
0&0&0&0&0\\
( 1 + p_1 ) \cdot q_1 \cdot 0.9 &  ( 1 + p_2 ) \cdot (1 - q_2) & 0 & 0 & 0 \\
0&0&0&0&0\\
( 1 + p_1 ) \cdot q_1 \cdot 0.09 & ( 1 + p_2 ) \cdot q_2 \cdot 0.9 & ( 1 + p_3 ) \cdot (1 - q_3) & 0 & 0 \\
0&0&0&0&0\\
( 1 + p_1 ) \cdot q_1 \cdot 0.009 & ( 1 + p_2 ) \cdot q_2 \cdot 0.09 & ( 1 + p_3 ) \cdot q_3 \cdot 0.9  & ( 1 + p_4) \cdot (1 - q_4) & 0 \\
0&0&0&0&0\\
( 1 + p_1 ) \cdot q_1 \cdot 0.001 & ( 1 + p_2 ) \cdot q_2 \cdot 0.01 & ( 1 + p_3 ) \cdot q_3 \cdot 0.1  & ( 1 + p_4) \cdot q_4 & ( 1 + p_5)\\
0&0&0&0&1\\
\end{bmatrix}}_{B}
\underbrace{\begin{bmatrix} m_{1,k+1}\\ m_{2,k+1}\\ m_{3,k+1}\\ m_{4,k+1}\\ m_{5,k+1}\\ \end{bmatrix}}_{\textbf{m}_{k+1}}
+
\underbrace{\begin{bmatrix}
0&0&0&0\\
0&0&0&0\\
0&0&0&0\\
0&0&0&0\\
0&0&0&1\\
\end{bmatrix}}_{\textbf{C}}
\end{bmatrix}}_{\textbf{C}}
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}
\underbrace{\begin{bmatrix} n_{1,k}\\ n_{2,k}\\ n_{3,k}\\ n_{4,k}\\ n_{5,k}\\ \end{bmatrix}}_{\textbf{n}_k}
\end{align}
</math>
</math>


=== Combined model ===
Lets add that to the products created through reassembly above:
 
<math>
\begin{align}
\textbf{n}_{k+1}
    &= \textbf{A} \, \textbf{R} \,\textbf{n}_{k} + \textbf{C}_{k}\\
    &= \textbf{A} \, \textbf{R} \,\textbf{n}_{k} + \textbf{C} \,\textbf{n}_{k}\\
    &= (\textbf{A} \, \textbf{R} +\textbf{C} ) \, \textbf{n}_{k}\\
\end{align}
</math>


As such we gain an equation for the amount of items for every tier after any amount of iterations
We can simplify this by multiplying out matrices A and R and adding C to create a combined transformation matrix that represents all of the transitions between product rarity for a full cycle of the upcycler. We can call this combined loop matrix L. This compressed matrix that contains the transformation of all rarities for the full cycle allows us to quickly calculate the output ratios of cycling products through our upcycler multiple times. To do this we can simply multiply our input vector by the loop transformation matrix multiple times.


<math>
<math>
\begin{align}
\begin{align}
\textbf{n}_{k+1}  
\textbf{n}_{k+1}  
     &= \textbf{B} \, \textbf{m}_{k+1} + \textbf{C} \, \textbf{n}_{k}\\
     &= \textbf{L} \, \textbf{n}_{k}\\
    &= \textbf{B} \, \textbf{A} \,\textbf{n}_{k} + \textbf{C} \, \textbf{n}_{k}\\
\textbf{n}_{k+2} &= \textbf{L} \, \textbf{n}_{k+1} = \textbf{L} \,  \textbf{L} \, \textbf{n}_{k} = \textbf{L}^2 \, \textbf{n}_{k}\\
    &= (\textbf{B} \, \textbf{A} +\textbf{C} ) \, \textbf{n}_{k}\\
    &= \textbf{M} \, \textbf{n}_{k}\\
\textbf{n}_{k+2} &= \textbf{Q} \, \textbf{n}_{k+1} = \textbf{Q} \,  \textbf{Q} \, \textbf{n}_{k} = \textbf{Q}^2 \, \textbf{n}_{k}\\
&\vdots\\
&\vdots\\
\textbf{n}_k &= \textbf{Q}^k \, \textbf{n}_0\\
\textbf{n}_k &= \textbf{L}^k \, \textbf{n}_0\\
\end{align}
\end{align}
</math>
</math>


A realistic starting point for <math>\textbf{n}_0</math> is only items in tier 1, and if we do not care for any other tiers, we simply choose sufficiently large <math>k = 100</math>, and, through numeric means, try to maximize a single value. <math>q_{100,\text{crit}}</math>, which falls in the fifth row, first column, of the Matrix <math>\textbf{Q}</math> raised to the 100th power.
Because products can only get higher quality, or be destroyed by the recycler's negative productivity, all products will eventually either become legendary or be destroyed by the recycler. We can see what the ratio of our inputs become legendary be assessing the ratio of items in different tiers after many cycles though the loop. If we choose a sufficiently high iteration <math>k = 100</math> the ratio of items left in the common-epic rows will be nearly zero.
 
==== Example ====
To demonstrate, lets walk through an example. Lets assume we are using an Electromagnetic Plant with only quality modules at every stage, and that we use legendary quality module 3s. This is of course clearly not optimal since the machines assembling legendary outputs have no use for quality modules, but I will do it anyway for the sake of keeping the example simple. I will start by trying to find the loop transformation matrix and substitute in values from there:


<math>
<math>
\begin{align}
\begin{align}
\textbf{n}_k &= Q^k \, \textbf{n}_0\\
\textbf{L}  
\begin{bmatrix}*\\ *\\ *\\ *\\ n_{5,100} \end{bmatrix} &=
    &= \textbf{A} \, \textbf{R} + \textbf{C}\\
    &=
\underbrace{\begin{bmatrix}
(1 - q_1) & 0 & 0 & 0 & 0 \\
q_1 \cdot 0.9 & (1 - q_2) & 0 & 0 & 0 \\
q_1 \cdot 0.09 & q_2 \cdot 0.9 & (1 - q_3) & 0 & 0 \\
q_1 \cdot 0.009 & q_2 \cdot 0.09 & q_3 \cdot 0.9  & (1 - q_4) & 0 \\
q_1 \cdot 0.001 & q_2 \cdot 0.01 & q_3 \cdot 0.1  & q_4 & 1\\
\end{bmatrix}
\begin{bmatrix}
1 + p_1 & 0 & 0 & 0 & 0 \\
0 & 1 + p_2 & 0 & 0 & 0 \\
0 & 0 & 1 + p_3 & 0 & 0 \\
0 & 0 & 0 & 1 + p_4 & 0 \\
0 & 0 & 0 & 0 & 1 + p_5 \\
\end{bmatrix}}_{Reassembly Matrix}
\underbrace{\begin{bmatrix}
(1 - q_r) & 0 & 0 & 0 & 0 \\
q_r \cdot 0.9 & (1 - q_r) & 0 & 0 & 0 \\
q_r \cdot 0.09 & q_r \cdot 0.9 & (1 - q_r) & 0 & 0 \\
q_r \cdot 0.009 & q_r \cdot 0.09 & q_r \cdot 0.9  & (1 - q_r) & 0 \\
q_r \cdot 0.001 & q_r \cdot 0.01 & q_r \cdot 0.1  & q_r & 0\\
\end{bmatrix}
\begin{bmatrix}
\begin{bmatrix}
* & * & * & * \\
1 + -0.75 & 0 & 0 & 0 & 0 \\
* & * & * & * \\
0 & 1 + -0.75 & 0 & 0 & 0 \\
* & * & * & * \\
0 & 0 & 1 + -0.75 & 0 & 0 \\
* & * & * & * \\
0 & 0 & 0 & 1 + -0.75 & 0 \\
q_{100,\text{crit}} & * & * & * \\
0 & 0 & 0 & 0 & 1 + -0.75 \\
\end{bmatrix} \begin{bmatrix}n_{1,0}\\ *\\ *\\ *\\ * \end{bmatrix}\\
\end{bmatrix}}_{Recycling Matrix}
+
\underbrace{\begin{bmatrix}
0&0&0&0&0\\
0&0&0&0&0\\
0&0&0&0&0\\
0&0&0&0&0\\
0&0&0&0&1\\
\end{bmatrix}}_{\textbf{Legendary Carryover Matrix}}
\end{align}
\end{align}
</math>
</math>


The choice of optimization method (simplex, branch and bound, etc.) itself is irrelevant, although most software will want the problem to be stated in a way so it can find a minimum, and may require the proper guard rails as to not pick values below 0 or higher than the maximum number of allowed modules.
Substituting <math>q_{1-5} = 0.31</math> (5 quality modules) and <math>p_{1-5} = 0.5</math> (EM built-in productivity with no additional productivity modules) for the reassembly machines and <math>q_r = 0.248</math> for the recycler we get a final loop matrix:


== Best ratios ==
<math>
This table shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. "3.67 quality / 1.33 productivity" could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.
\begin{align}
 
\textbf{L}
<tabber>
    &=  
common modules =
\begin{bmatrix}
"Modules in Tier X" means which Modules need to go into the machines that are set to produce the item at tier X.
0.1946&0&0&0&0\\
{| class="wikitable"
0.1364&0.1946&0&0&0\\
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*
0.037&0.1364&0.1946&0&0\\
|-
0.006&0.037&0.1364&0.1946&0\\
| Chemical plant || 3 quality <br />0 productivity || 3 quality <br />0 productivity || 3 quality <br />0 productivity || 3 quality <br />0 productivity  || 0 quality <br />3 productivity || 0.034014% || 2940
0.001&0.007&0.044&0.1804&1\\
|-
\end{bmatrix}
| Assembling machine 3 || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity  || 0 quality <br />4 productivity || 0.046275% || 2161
\end{align}
|-
</math>
| Foundry || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity  || 0 quality <br />4 productivity || 0.133814% || 747
|-
| Electromagnetic plant || 5 quality <br />0 productivity || 5 quality <br />0 productivity || 5 quality <br />0 productivity || 5 quality <br />0 productivity  || 0 quality <br />5 productivity || 0.176712% || 566
|-
| Cryogenic plant || 6 quality <br />2 productivity || 6 quality <br />2 productivity || 6 quality <br />2 productivity || 6.5 quality <br />1.5 productivity  || 0 quality <br />8 productivity || 0.119134%|| 840
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
\-\
uncommon modules =  
"Modules in Tier X" means which Modules need to go into the machines that are set to produce the item at tier X.
{| class="wikitable"
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*
|-
| Chemical plant || 3 quality <br />0 productivity || 3 quality <br />0 productivity || 3 quality <br />0 productivity || 3 quality <br />0 productivity  || 0 quality <br />3 productivity || 0.059498% || 1681
|-
| Assembling machine 3 || 3.75 quality <br />0.25 productivity || 3.75 quality <br />0.25 productivity || 3.8 quality <br />0.2 productivity || 3.9 quality <br />0.1 productivity  || 0 quality <br />4 productivity || 0.082296% || 1216
|-
| Foundry || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity || 4 quality <br />0 productivity  || 0 quality <br />4 productivity || 0.243699% || 410
|-
| Electromagnetic plant || 4.7 quality <br />0.3 productivity || 4.67 quality <br />0.33 productivity || 4.75 quality <br />0.25 productivity || 4.9 quality <br />0.1 productivity  || 0 quality <br />5 productivity || 0.324189% || 309
|-
| Cryogenic plant || 4.6 quality <br />3.4 productivity || 4.6 quality <br />3.4 productivity || 4.67 quality <br />3.33 productivity  || 5 quality <br />3 productivity  || 0 quality <br />8 productivity || 0.257621% || 389
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
\-\
rare modules =
"Modules in Tier X" means which Modules need to go into the machines that are set to produce the item at tier X.
{| class="wikitable"
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*
|-
| Chemical plant || 2.8 quality <br />0.2 productivity || 2.8 quality <br />0.2 productivity || 2.9 quality <br />0.1 productivity || 2.9 quality <br />0.1 productivity  || 0 quality <br />3 productivity || 0.100660% || 994
|-
| Assembling machine 3 || 3 quality <br />1 productivity || 3.1 quality <br />0.9 productivity || 3.2 quality <br />0.8 productivity || 3.33 quality <br />0.67 productivity  || 0 quality <br />4 productivity || 0.145220% || 689
|-
| Foundry || 3.5 quality <br />0.5 productivity || 3.5 quality <br />0.5 productivity || 3.6 quality <br />0.4 productivity || 3.9 quality <br />0.1 productivity  || 0 quality <br />4 productivity || 0.424039% || 236
|-
| Electromagnetic plant || 3.6 quality <br />1.4 productivity || 3.6 quality <br />1.4 productivity || 3.6 quality <br />1.4 productivity || 3.9 quality <br />1.1 productivity  || 0 quality <br />5 productivity || 0.588510% || 170
|-
| Cryogenic plant || 3.6 quality <br />4.4 productivity || 3.6 quality <br />4.4 productivity || 3.6 quality <br />4.4 productivity  || 3.9 quality <br />4.1 productivity  || 0 quality <br />8 productivity || 0.565030% || 177
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
\-\
epic modules =
"Modules in Tier X" means which Modules need to go into the machines that are set to produce the item at tier X.
{| class="wikitable"
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*
|-
| Chemical plant || 2.33 quality <br />0.67 productivity || 2.4 quality <br />0.6 productivity || 2.4 quality <br />0.6 productivity || 2.4 quality <br />0.6 productivity  || 0 quality <br />3 productivity || 0.152486% || 656
|-
| Assembling machine 3 || 2.5 quality <br />1.5 productivity || 2.5 quality <br />1.5 productivity || 2.6 quality <br />1.4 productivity || 2.8 quality <br />1.2 productivity  || 0 quality <br />4 productivity || 0.232966% || 430
|-
| Foundry || 2.7 quality <br />1.3 productivity || 2.7 quality <br />1.3 productivity || 2.75 quality <br />1.25 productivity || 3 quality <br />1 productivity  || 0 quality <br />4 productivity || 0.664130% || 151
|-
| Electromagnetic plant || 2.6 quality <br />2.4 productivity || 2.6 quality <br />2.4 productivity || 2.67 quality <br />2.33 productivity || 2.9 quality <br />2.1 productivity  || 0 quality <br />5 productivity || 0.974700% || 103
|-
| Cryogenic plant || 2.6 quality <br />5.4 productivity || 2.6 quality <br />5.4 productivity || 2.6 quality <br />4.4 productivity  || 2.8 quality <br />4.2 productivity  || 0 quality <br />8 productivity || 1.122444% || 90
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
\-\
legendary modules=
"Modules in Tier X" means which Modules need to go into the machines that are set to produce the item at tier X.
{| class="wikitable"
! Crafting machine || Modules in Tier 1 || Modules in Tier 2 || Modules in Tier 3 || Modules in Tier 4 || Modules in Tier 5 || percentage yield || items recycled*
|-
| Chemical plant || 1.67 quality <br />1.33 productivity || 1.67 quality <br />1.33 productivity || 1.67 quality <br />1.333 productivity || 1.8 quality <br />1.2 productivity  || 0 quality <br />3 productivity || 0.344061% || 291
|-
| Assembling machine 3 || 1.67 quality <br />2.33 productivity || 1.67 quality <br />2.33 productivity || 1.67 quality <br />2.33 productivity || 1.8 quality <br />2.2 productivity  || 0 quality <br />4 productivity || 0.586191% || 171
|-
| Foundry || 1.4 quality <br />2.6 productivity || 1.4 quality <br />2.6 productivity || 1.4 quality <br />2.6 productivity || 1.5 quality <br />2.5 productivity  || 0 quality <br />4 productivity || 1.624266% || 62
|-
| Electromagnetic plant || 1 quality <br />4 productivity || 1 quality <br />4 productivity || 1 quality <br />4 productivity || 1 quality <br />4 productivity  || 0 quality <br />5 productivity || 2.722332% || 37
|-
| Cryogenic plant || 0 quality <br />8 productivity || 0 quality <br />8 productivity || 0 quality <br />8 productivity || 0 quality <br />8 productivity  || 0 quality <br />8 productivity || 4.835199% || 21
|}
<nowiki>*</nowiki> "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.
</tabber>


=== Number of crafting machines ===
When we raise this loop matrix to the 100th power to see what would happen to each common item after putting the outputs back into the upcycler 100 times, we get this:
If we assume a constant input stream of tier 1 items which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier. This is done by setting <math>m_{1,k+1} = 100 \, \% - m_{2,k+1} - m_{3,k+1} - m_{4,k+1}</math> after each iteration.


<tabber>
<math>
per recycler=
\begin{align}
{| class="wikitable"
\textbf{L}
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items
    &=  
|-
\begin{bmatrix}
| Chemical plant || 1 || 3.4427 || 0.0290 || 1.0086 || 0.0077 || 0.2979
0&0&0&0&0\\
|-
0&0&0&0&0\\
| Assembling machine 3 || 1 || 3.3027 || 0.0365 || 1.0657 || 0.0108 || 0.3286
0&0&0&0&0\\
|-
0&0&0&0&0\\
| Foundry || 1 || 2.9551 || 0.0563 || 1.1528 || 0.0208 || 0.3653
0.013&0.0347&0.0926&0.224&1\\
|-
\end{bmatrix}
| Electromagnetic plant || 1 || 2.7239 || 0.0709 || 1.1726 || 0.0301 || 0.3474
\end{align}
|-
</math>
| Cryogenic plant || 1 || 2.3798 || 0.0972 || 1.1517 || 0.0470 || 0.2700


|}
This this shows us what would happen to inputs of each rarity after 100 cycles. The number in the bottom left corner (0.013 in our example), which comes from the far left column (common input) and bottom row (legendary output), shows how many legendary outputs will be created for every common input. We can use an program to try out different ratios of productivity to quality for each stage to try to maximize this value.
\-\
per tier 5 crafter (exact) =
{| class="wikitable"
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items
|-
| Chemical plant || 108.8978 || 374.9134 || 43.5367 || 12.7555 || 3.3856 || 1
|-
| Assembling machine 3 || 70.4576 || 232.7032 || 33.9340 || 10.9500 || 3.2432 || 1
|-
| Foundry || 33.0224 || 97.5872 || 21.8308 || 8.5164 || 3.1550 || 1
|-
| Electromagnetic plant || 24.1178 || 65.6959 || 18.4556 || 7.9448 || 3.3747 || 1
|-
| Cryogenic plant || 19.9316 || 47.4350 || 18.2124 || 8.8138 || 4.2654 || 1
|}
\-\
per tier 5 crafter (conservative)=
{| class="wikitable"
! Crafting machine || Recyclers || Machines producing Tier 1 items || Machines producing Tier 2 items || Machines producing Tier 3 items || Machines producing Tier 4 items || Machines producing Tier 5 items
|-
| Chemical plant || 92 || 318 || 37 || 11 || 3 || 1
|-
| Assembling machine 3 || 62 || 205 || 30 || 10 || 3 || 1
|-
| Foundry || 30 || 89 || 20 || 8 || 3 || 1
|-
| Electromagnetic plant || 20 || 56 || 16 || 7 || 3 || 1
|-
| Cryogenic plant || 17 || 41 || 16 || 8 || 4 || 1
|}
</tabber>

Latest revision as of 01:08, 13 January 2026

How do we get the most amount of legendary items out of an upcycling plant?

The answer is not quite as straight forward as we'd like it to be, because it depends on a number of factors, luckily there is a finite number of possibilities of what the modules can be, and for the sake of simplicity this tutorial will ignore the productivity gain from infinite technologies. But first, a presentation of the results.

Best ratios

The table below shows the best ratio for quality to productivity modules in the crafting machines, while the recyclers always take only quality modules. The values are not given in whole numbers because often it is not just a single crafting machine per tier that will be used, then the ratios can change between different crafting machines in the same tier. e.g. "3.67 quality / 1.33 productivity" could have 4 machines where 3 have a ratio 4 to 1, and one a ratio 3 to 2.

The columns "X products" denote modules need to install into the machines that are set to produce items of X quality.

Use normal modules
Crafting machine Normal products Uncommon products Rare products Epic products Legendary products Percentage yield Items recycled*
Chemical plant
3
+
0
3
+
0
3
+
0
3
+
0
0
+
3
0.034014% 2940
Assembling machine 3
4
+
0
4
+
0
4
+
0
4
+
0
0
+
4
0.046275% 2161
Foundry
4
+
0
4
+
0
4
+
0
4
+
0
0
+
4
0.133814% 747
Electromagnetic plant
5
+
0
5
+
0
5
+
0
5
+
0
0
+
5
0.176712% 566
Cryogenic plant
6
+
2
6
+
2
6
+
2
6.5
+
1.5
0
+
8
0.119134% 840
Use uncommon modules
Crafting machine Normal products Uncommon products Rare products Epic products Legendary products Percentage yield Items recycled*
Chemical plant
3
+
0
3
+
0
3
+
0
3
+
0
0
+
3
0.059498% 1681
Assembling machine 3
3.75
+
0.25
3.75
+
0.25
3.8
+
0.2
3.9
+
0.1
0
+
4
0.082296% 1216
Foundry
4
+
0
4
+
0
4
+
0
4
+
0
0
+
4
0.243699% 410
Electromagnetic plant
4.7
+
0.3
4.67
+
0.33
4.75
+
0.25
4.9
+
0.1
0
+
5
0.324189% 309
Cryogenic plant
4.6
+
3.4
4.6
+
3.4
4.67
+
3.33
5
+
3
0
+
8
0.257621% 389
Use rare modules
Crafting machine Normal products Uncommon products Rare products Epic products Legendary products Percentage yield Items recycled*
Chemical plant
2.8
+
0.2
2.8
+
0.2
2.9
+
0.1
2.9
+
0.1
0
+
3
0.100660% 994
Assembling machine 3
3
+
1
3.1
+
0.9
3.2
+
0.8
3.33
+
0.67
0
+
4
0.145220% 689
Foundry
3.5
+
0.5
3.5
+
0.5
3.6
+
0.4
3.9
+
0.1
0
+
4
0.424039% 236
Electromagnetic plant
3.6
+
1.4
3.6
+
1.4
3.6
+
1.4
3.9
+
1.1
0
+
5
0.588510% 170
Cryogenic plant
3.6
+
4.4
3.6
+
4.4
3.6
+
4.4
3.9
+
4.1
0
+
8
0.565030% 177
Use epic modules
Crafting machine Normal products Uncommon products Rare products Epic products Legendary products Percentage yield Items recycled*
Chemical plant
2.33
+
0.67
2.4
+
0.6
2.4
+
0.6
2.4
+
0.6
0
+
3
0.152486% 656
Assembling machine 3
2.5
+
1.5
2.5
+
1.5
2.6
+
1.4
2.8
+
1.2
0
+
4
0.232966% 430
Foundry
2.7
+
1.3
2.7
+
1.3
2.75
+
1.25
3
+
1
0
+
4
0.664130% 151
Electromagnetic plant
2.6
+
2.4
2.6
+
2.4
2.67
+
2.33
2.9
+
2.1
0
+
5
0.974700% 103
Cryogenic plant
2.6
+
5.4
2.6
+
5.4
2.6
+
5.4
2.8
+
5.2
0
+
8
1.122444% 90
Use legendary modules
Crafting machine Normal products Uncommon products Rare products Epic products Legendary products Percentage yield Items recycled*
Chemical plant
1.67
+
1.33
1.67
+
1.33
1.67
+
1.33
1.8
+
1.2
0
+
3
0.344061% 291
Assembling machine 3
1.67
+
2.33
1.67
+
2.33
1.67
+
2.33
1.8
+
2.2
0
+
4
0.586191% 171
Foundry
1.4
+
2.6
1.4
+
2.6
1.4
+
2.6
1.5
+
2.5
0
+
4
1.624266% 62
Electromagnetic plant
1
+
4
1
+
4
1
+
4
1
+
4
0
+
5
2.722332% 37
Cryogenic plant
0
+
8
0
+
8
0
+
8
0
+
8
0
+
8
4.835199% 21

* "items recycled" quantifies how many items need to be crafted and put into the entire upcycler to yield a single legendary item, it doesn't account for those which get recycled multiple times.


Number of crafting machines

If we assume a constant input stream of uncommon items, which will always fill back up, we can additionally figure out what ratio of items will be inside the system at once, and with that we can figure out how many crafting machines we need per tier of quality. This is done by setting m1,k+1=100%m2,k+1m3,k+1m4,k+1 after each iteration and further adjusting for the crafting machines change in speed dependant on the modules (assuming the machines which only house productivity modules are not additionally boosted by speed moduled beacons). See the calculations further below for a full explanation of the calculations.

Per recycler
Crafting machine Recyclers Machines for
normal products
Machines for
uncommon products
Machines for
rare products
Machines for
epic products
Machines for
legendary products
Chemical plant 1 4.418130519 0.037216657 1.294369664 0.009779 0.431955
Assembling machine 3 1 4.733868899 0.052316655 1.527502978 0.015336 0.52576
Foundry 1 4.314446 0.082198 1.683088 0.03016 0.58448
Electromagnetic plant 1 4.494435 0.116985 1.93479 0.049665 0.60795
Cryogenic plant 1 5.23556 0.21384 2.53374 0.1034 0.594
Per legendary crafter (exact)
Crafting machine Recyclers Machines for
normal products
Machines for
uncommon products
Machines for
rare products
Machines for
epic products
Machines for
legendary products
Chemical plant 90.1223 331.8198 38.5325 11.2893 2.9653 1
Assembling machine 3 52.8432 208.4632 30.3992 9.8094 2.8783 1
Foundry 24.7668 89.0483 19.9206 7.7712 2.8592 1
Electromagnetic plant 16.5379 61.9418 17.4010 7.4908 3.1822 1
Cryogenic plant 10.8718 47.4350 18.2124 8.8138 4.2654 1
Per legendary crafter (conservative)
Crafting machine Recyclers Machines for
normal products
Machines for
uncommon products
Machines for
rare products
Machines for
epic products
Machines for
legendary products
Chemical plant 53 198 23 7 2 1
Assembling machine 3 31 123 18 6 2 1
Foundry 14 53 12 5 2 1
Electromagnetic plant 14 56 16 7 3 1
Cryogenic plant 9 41 16 8 4 1

The crafting machines

Crafting machine Module slots N Base productivity bonus p0
Chemical plant 3 +0%
Assembling machine 3 4 +0%
Foundry 4 +50%
Electromagnetic plant 5 +50%
Cryogenic plant 8 +0%

Quality probability

When an item gets produced and the initial roll decides that the quality of the item will increase, there is a 90% chance it will rise one tier, a 9% chance it will rise two, a 0.9% chance it will rise three, and a 0.1% chance it will rise four. This is of course capped if the item already started out at a higher tier.

Mathematical model

The mathematical model is time discrete. As opposed to dealing with derivatives in respect to time, the next state is a direct function of the previous state.

  • mi,k ... Number of materials of tier i (whereas 1 is normal, 2 is uncommon, 3 is rare, 4 is epic, and 5 is legendary) after the k-th iteration before being crafted. (this doesn't mean that an item only needs one type of ingredient, but that "1 materials" can be crafted into 1 item from them)
  • ni,k ... Number of items of tier i after the k-th iteration, after being crafted together.
  • p0 ... the crafting machines inherent productivity bonus
  • N ... number of modules the crafting machine can hold
  • qr=46.2%=0.248 ... quality probability of the recyclers with 4 quality module 3's (6.2% is the chance of a legendary tier quality module 3)
  • pi=p0+xi25% ... productivity due to xi legendary productivity module 3's in the crafting machine which takes i-tier materials (25% is the productivity boost of a legendary tier productivity module 3)
  • qi=(Nxi)6.2% ... quality probability due to (Nxi) legendary quality module 3's in the crafting machine which takes i-tier materials

Quality Matrix

When any machine with a quality chance operates on its ingredients it will have a chance to increase its quality with the probability mentioned above. We can model this quality increase chance as a transformation matrix. Common outputs only have one term because they are only created from common inputs which fail to increase in quality since Uncommon items and above can only increase in quality. Uncommon outputs are created from uncommon inputs which failed to increase in quality, as well as all common inputs which got a single rarity upgrade. This equation repeats for the higher tiers, summing up the chances of a jump from lower tiers as well inputs which failed to upgrade from its own teir. Additionally, the number of outputs can be increased with machine productivity. The quantity of outputs from each tier machine can be multiplied by the productivity of the machine.

Inputs starting at each tier have different potential upgrade upside since quality is capped at legendary. This means that it is optimal to vary the ratio of productivity to quality modules used in each tier of machine (pi will not be the same for all tiers).

normal outputs:n1,k+1=m1,k+1(1+p1)(1q1)uncommon outputs:n2,k+1=m1,k+1(1+p1)q10.9+m2,k+1(1+p2)(1q2)rare outputs:n3,k+1=m1,k+1(1+p1)q10.09+m2,k+1(1+p2)q20.9+m3,k+1(1+p3)(1q3)epic outputs:n4,k+1=m1,k+1(1+p1)q10.009+m2,k+1(1+p2)q20.09+m3,k+1(1+p3)q30.9+m4,k+1(1+p4)(1q4)legendary outputs:n5,k+1=m1,k+1(1+p1)q10.001+m2,k+1(1+p2)q20.01+m3,k+1(1+p3)q30.1+m4,k+1(1+p4)q4+m5,k+1(1+p5)+n5,k

Something to note is that the equation for legendary items does not use q5. This is because the number of legendary outputs made from legendary inputs is unaffected by quality modules since they are already the maximum quality.

This set of equations can be written as a matrix multiplication.

[n1,k+1n2,k+1n3,k+1n4,k+1n5,k+1]nk+1=[(1+p1)(1q1)0000(1+p1)q10.9(1+p2)(1q2)000(1+p1)q10.09(1+p2)q20.9(1+p3)(1q3)00(1+p1)q10.009(1+p2)q20.09(1+p3)q30.9(1+p4)(1q4)0(1+p1)q10.001(1+p2)q20.01(1+p3)q30.1(1+p4)q4(1+p5)]QualityandProductivityMatrix[m1,k+1m2,k+1m3,k+1m4,k+1m5,k+1]mk+1

This Quality and Productivity Matrix can be built with a quality and productivity vector (q15 and p15). It allows us to simply matrix multiply our vector of inputs mk with our transformation matrix to get the number of outputs in each tier nk. In order to further simplify, we can factor the productivity matrix out as well since it is simply a scaling matrix.

[n1,k+1n2,k+1n3,k+1n4,k+1n5,k+1]nk+1=[(1q1)0000q10.9(1q2)000q10.09q20.9(1q3)00q10.009q20.09q30.9(1q4)0q10.001q20.01q30.1q41]QualityMatrix[1+p1000001+p2000001+p3000001+p4000001+p5]ProductivityMatrix[m1,k+1m2,k+1m3,k+1m4,k+1m5,k+1]mk+1

Now that we have a general framework modelling how machines interact with quality, we need to combine to the two parts of the upcycling cycle: recycling and recrafting.

Recycled materials

A recycler is a machine just like any other with a few nuances:

  • Its inputs are fully built items (nk), and its outputs are the materials for those items (mk).
  • It cannot accept productivity modules so it is clearly optimal to just fill it with quality modules. Since the amount of productivity cannot be varied, we will fill every tier of recycler with the same quality modules, thus making q15 all the same value qr.
  • The recycler comes with a built-in (anti-)productivity of -75% which gets rid of most of what is input to it.
  • In an upcycling factory, we do not want to recycle legendary products since they are the final output. So we will manually set the 1 in the bottom right corner to 0 indicating that we will not be putting any legendary products into the recycler regardless of how many we have (this will be accounted for later in the final model).

If we plug those into our matrix model we get this:

[m1,k+1m2,k+1m3,k+1m4,k+1m5,k+1]mk+1=[(1qr)0000qr0.9(1qr)000qr0.09qr0.9(1qr)00qr0.009qr0.09qr0.9(1qr)0qr0.001qr0.01qr0.1qr0]QualityMatrix[1+0.75000001+0.75000001+0.75000001+0.75000001+0.75]ProductivityMatrix[n1,k+1n2,k+1n3,k+1n4,k+1n5,k+1]nk+1

This new set of Quality and Productivity Matrices has only a single input variable qr. If we assume the recycler has 4 legendary quality module 3s, that produces a total quality chance of qr=0.248, we could for instance calculate the recycler's transformation matrix by plugging that in:

R=[0.18800000.05580.1880000.005580.05580.188000.0005580.005580.05580.18800.0000620.000620.00620.0620]

At this point in the tutorial I want to review what this all means for those of you who are new or rusty on your matrix algebra. This transformation matrix represents the ratio of outputs of each rarity that will be produced for every input. Each column represents the input rarity. Remember in our equations that we derived this matrix from, common items were always the first term. Each row represents the output rarity of the items after the machine has processed it. So for example the at 0.005 at A3,1 means that for every common input, we will get 0.005 rare (because it is in row 3) outputs. The beautiful thing about this transformation matrix is that it captures every transition chance from any rarity to any other rarity all at once when something is processed by the machine (a recycler with 4 legendary quality module 3s in this case).

Combined model

We can combine the transforms for a machine using the quality chance matrix above, along with the special transform matrix for the recycling part of the loop to form a larger equation representing the transition through the full recycle+build cycle. We will call the assembly combined Quality and Productivity matrix A and the recycling Quality and Productivity matrix R:

The final outputs for a given iteration are formed from the assembler transformation applied to the materials we have in that same iteration.

nk+1=Amk+1

We can substitute the recycler matrix for mk+1 since that is where the materials come from.

nk+1=ARnk

This is where we need to remember our modification to the recycling transformation matrix. We set the value which represented the number of recycled legendary items to 0 because we dont want to recycle items which are already legendary. We need to account for those items which have already made it to legenedary in our combined cycle equation. To do that we will multiply our current products matrix nk by a matrix unit to carry over legendary products from previous iterations. We will call this carryover from iteration k Ck

Ck=[0000000000000000000000001]C[n1,kn2,kn3,kn4,kn5,k]nk

Lets add that to the products created through reassembly above:

nk+1=ARnk+Ck=ARnk+Cnk=(AR+C)nk

We can simplify this by multiplying out matrices A and R and adding C to create a combined transformation matrix that represents all of the transitions between product rarity for a full cycle of the upcycler. We can call this combined loop matrix L. This compressed matrix that contains the transformation of all rarities for the full cycle allows us to quickly calculate the output ratios of cycling products through our upcycler multiple times. To do this we can simply multiply our input vector by the loop transformation matrix multiple times.

nk+1=Lnknk+2=Lnk+1=LLnk=L2nknk=Lkn0

Because products can only get higher quality, or be destroyed by the recycler's negative productivity, all products will eventually either become legendary or be destroyed by the recycler. We can see what the ratio of our inputs become legendary be assessing the ratio of items in different tiers after many cycles though the loop. If we choose a sufficiently high iteration k=100 the ratio of items left in the common-epic rows will be nearly zero.

Example

To demonstrate, lets walk through an example. Lets assume we are using an Electromagnetic Plant with only quality modules at every stage, and that we use legendary quality module 3s. This is of course clearly not optimal since the machines assembling legendary outputs have no use for quality modules, but I will do it anyway for the sake of keeping the example simple. I will start by trying to find the loop transformation matrix and substitute in values from there:

L=AR+C=[(1q1)0000q10.9(1q2)000q10.09q20.9(1q3)00q10.009q20.09q30.9(1q4)0q10.001q20.01q30.1q41][1+p1000001+p2000001+p3000001+p4000001+p5]ReassemblyMatrix[(1qr)0000qr0.9(1qr)000qr0.09qr0.9(1qr)00qr0.009qr0.09qr0.9(1qr)0qr0.001qr0.01qr0.1qr0][1+0.75000001+0.75000001+0.75000001+0.75000001+0.75]RecyclingMatrix+[0000000000000000000000001]LegendaryCarryoverMatrix

Substituting q15=0.31 (5 quality modules) and p15=0.5 (EM built-in productivity with no additional productivity modules) for the reassembly machines and qr=0.248 for the recycler we get a final loop matrix:

L=[0.194600000.13640.19460000.0370.13640.1946000.0060.0370.13640.194600.0010.0070.0440.18041]

When we raise this loop matrix to the 100th power to see what would happen to each common item after putting the outputs back into the upcycler 100 times, we get this:

L=[000000000000000000000.0130.03470.09260.2241]

This this shows us what would happen to inputs of each rarity after 100 cycles. The number in the bottom left corner (0.013 in our example), which comes from the far left column (common input) and bottom row (legendary output), shows how many legendary outputs will be created for every common input. We can use an program to try out different ratios of productivity to quality for each stage to try to maximize this value.