Factorio’s base gameplay revolves around harvesting resources and automating their conversion into ever more complex items using machines and logistics. The Space Age expansion, released in 2024, added a Quality mechanic that splits every item and recipe into five tiers: normal (⚀), uncommon (⚁), rare (⚂), epic (⚃), and legendary (⚄). Quality modules installed in crafting machines affect the probability Q that an output jumps up a quality tier; each successive tier increase adds another 10 % chance. With four module slots the highest possible jump—from normal directly to legendary—has a probability of only 0.0248 %, while the best achievable single‑step upgrade chance is 24.8 % (primary source).

Diagram showing the 24.8% single-step quality upgrade chance in Factorio
Illustrates the maximum single-step upgrade probability from normal to legendary quality using four quality modulesexyr.org

This image supports the article’s claim that the best achievable single‑step upgrade chance is 24.8 %, which is used to compute quality transition probabilities in crafting recipes.

Because the recycler returns 25 % of an item’s ingredients, players can build loops that repeatedly craft and recycle items, using quality modules to slowly shift the distribution toward higher grades. The author shows that the process can be expressed as a row‑vector of ingredient probabilities multiplied by a transition matrix T_quality(q). For a chain of steps—such as mining ore (7.5 % quality chance), smelting plates (5 %), and crafting pipes (10 %)—the final product distribution is obtained by successive matrix multiplication, yielding approximately 79 % normal, 17 % uncommon, 3 % rare, 0.45 % epic and 0.07 % legendary pipes (primary source). In a pure recycling loop (“washing”), the steady‑state extraction probability for a target tier can be written as an infinite sum ∑ Lⁱ where L combines the recycling filter, the 1/4 survival factor, and the quality transition; the series converges because each term shrinks exponentially, allowing an exact solution via linear algebra rather than brute‑force simulation (primary source).

Screenshot of Factorio wiki showing quality transition probabilities for different module counts
Shows the probability matrix used to model quality jumps when crafting with quality modulesexyr.org

Matches the article’s description of expressing the quality process as a row‑vector multiplied by a transition matrix T_quality(q) for chains like mining, smelting, and pipe crafting.

To turn this math into practical factory designs, the community has built solver‑driven tools. The FactorioQualityOptimizer repository contains a Python script that accepts a cost function and uses a linear solver to minimize either inputs per legendary output or the number of modules required. For example, producing legendary gear wheels from normal iron plates with a 2‑productivity/2‑quality module split needs about 79.9 plates per legendary gear, while switching the cost to favor fewer modules reduces the module count to 27.1 at the expense of 84.1 plates per gear (support‑1). The Upcycle web app provides a graphical interface for the same kind of linear‑solver optimization, letting users specify output items, adjust cost functions (e.g., minimizing buildings, modules, or resources), and explore trade‑offs such as adding speed beacons or whitelisting recipes. The app highlights that a small amount of speed modules can greatly reduce building counts at lower quality levels, even though pure speed hurts legendary‑per‑input ratios (support‑2).

Screenshot of the Upcycle web app interface for Factorio quality optimization
Displays the graphical tool that lets users minimize inputs or modules for legendary output using linear solvingexyr.org

Corresponds to the community-built solver‑driven tools mentioned in the article, specifically the Upcycle web app that provides a graphical interface for linear‑solver optimization.