Factorio modding explained: how mods change game data
Every number on this site is read from Factorio's prototype definitions — the Lua data files that ship with the game. Mods work by overriding or extending those same definitions. Understanding that mechanism tells you exactly which figures on a ratio page survive a modded install and which ones silently stop being true.
Figures computed from game version 2.1.12, updated 2026-08-23.
The data-driven architecture
Factorio does not hard-code its game balance into the engine. The C++ engine knows how to simulate belts, assemblers and power networks, but it does not know how fast an assembling machine crafts or how many iron plates a gear costs. Those facts live in prototype files written in Lua, loaded at startup. When the game launches it reads every prototype definition from the base mod, then from each installed mod in load order, and builds a single merged table that the engine uses for the rest of the session.
This is the single fact that makes modding powerful. A mod does not
patch a binary or hook into engine code; it declares prototype changes
in a data.lua file (and often data-updates.lua
or data-final-fixes.lua for staged changes), and the engine
treats the result exactly as if Wube had shipped it. An assembling
machine whose crafting_speed has been changed by a mod
crafts at that modified speed with no special-case code anywhere.
What a prototype actually looks like
The assembling machine 3 is defined as a prototype of type
assembling-machine. The fields that matter for ratio
calculation are its crafting speed, its energy usage, its module slots
and the crafting categories it accepts. Here is the relevant subset of
the prototype as extracted from the game data:
| Field | Value | Why it matters for ratios |
|---|---|---|
name | assembling-machine-3 | Identifier used in recipes and technology |
crafting_speed | 1.25 | Divides recipe energy to get crafts per second |
module_slots | 4 | Caps how many modules affect the machine |
energy_usage | 375kW | Power draw at 100% load |
crafting_categories | crafting, advanced-crafting, crafting-with-fluid | Determines which recipes the machine can run |
A recipe prototype is equally compact. The iron gear wheel recipe
declares its ingredients, its results and the energy required to craft
it once. When energy_required is absent the game applies a
default of 0.5 seconds, which is why the gear recipe is fast despite
the field being null in the extracted data.
| Field | Value |
|---|---|
name | iron-gear-wheel |
ingredients | 2 iron-plate |
results | 1 iron-gear-wheel |
energy_required | null (defaults to 0.5s) |
allow_productivity | true |
Every ratio on this site starts from fields like these. The production ratio calculator divides recipe energy by machine crafting speed to get crafts per second, multiplies by ingredient count, and rounds up to whole machines. Change either field in a prototype and every downstream number changes with it.
How mods override prototypes
The prototype merge follows a simple rule: definitions are loaded in
order, and a later definition with the same name and type replaces the
earlier one. This is called prototype override. A mod that wants to
make assembling machine 3 craft twice as fast does not add a new
machine; it re-declares assembling-machine-3 with a
crafting_speed of 2.5 instead of 1.25, and
the merge discards the old value.
The three-stage loading sequence exists so mods can coordinate.
data.lua runs first and is where most prototypes are
declared. data-updates.lua runs after every mod's
data.lua, giving a mod a chance to modify prototypes that
other mods introduced. data-final-fixes.lua runs last and
is intended for compatibility adjustments — for example, adding a
new recipe category to every machine that should support it. A mod that
overrides a field in data-final-fixes.lua wins over any
change made earlier, regardless of mod load order.
There is also an additive path. A mod can introduce an entirely new prototype with a name no other mod uses, and the merge adds it to the table without replacing anything. New items, recipes, machines and technologies all work this way. Overhaul mods combine both approaches: they override base-game prototypes to change balance and add hundreds of new prototypes on top.
Mod categories and their impact on game data
Overhaul mods
Overhaul mods restructure large portions of the technology tree and production chain. They routinely override recipe ingredients and energy requirements, change machine crafting speeds and module slots, introduce new crafting categories, and add new resources with their own processing chains. The effect on this site's numbers is total: ratio tables that assume vanilla recipes and machines are not merely slightly off, they are computing from a different game. A ratio solver fed vanilla data will produce machine counts that do not match what the modded factory needs.
Content mods
Content mods add new items, machines, recipes or technologies without necessarily changing existing ones. A mod that adds a new ore and a set of smelting recipes leaves the vanilla iron gear ratio intact, but introduces production lines that this site has no data for. The vanilla numbers remain valid for vanilla production chains; the new chains require their own calculations from the mod's prototype files.
Helper and compatibility mods
Helper mods provide libraries, script interfaces or compatibility
shims that other mods depend on. They rarely override gameplay
prototypes themselves, though they may add new crafting categories or
adjust machine collision masks for mod interoperability. A helper mod
that does not touch crafting_speed, recipe ingredients or
energy values leaves the site's ratio numbers unchanged.
Quality-of-life mods
QoL mods change the interface, add alerts, improve inventory management or display additional information without altering prototype balance. They do not affect crafting speeds, recipe costs, module effects or belt throughput. Numbers on this site remain fully accurate with QoL mods installed, because the prototypes the engine simulates are identical to vanilla.
| Mod type | Overrides prototypes? | Adds prototypes? | Vanilla ratios still valid? |
|---|---|---|---|
| Overhaul | Yes, extensively | Yes | No |
| Content | Sometimes | Yes | For unchanged recipes only |
| Helper | Rarely | Sometimes | Usually yes |
| QoL | No | No | Yes |
Which numbers break, and which survive
A mod that changes a single field can invalidate calculations across multiple pages. The breakdown below maps the prototype fields that this site reads to the pages that depend on them.
Crafting speed changes
The most common balance tweak is changing
crafting_speed on a machine. The gear wheel recipe takes
0.5 seconds of crafting energy; an assembling machine 3 at crafting
speed 1.25 completes it in 0.4 seconds. If a mod sets
that speed to 2.0, the same recipe takes 0.25 seconds and the machine
produces 4 gears per second instead of 2.5. Every ratio that counts
assemblers — science packs, circuits, modules — scales
inversely with crafting speed. The proportional relationships between
recipes do not change (gear wheels still need two iron plates), but
the absolute machine counts do.
Recipe ingredient and energy changes
A mod that changes a recipe's ingredients or
energy_required breaks ratios at a deeper level. If gear
wheels cost three iron plates instead of two, every downstream recipe
that consumes gears — red belts, inserters, assemblers
themselves — needs recalculation. If a mod changes the energy
required, the crafts-per-second figure shifts even if machine speed is
untouched. The production
ratios guide walks through the arithmetic; that arithmetic is
correct, but its inputs must come from the modded prototypes, not the
vanilla JSON files this site uses.
New resources and production chains
Overhaul and content mods add ores, fluids and intermediates that do not exist in the base game. These introduce entire production chains with no vanilla counterpart. A ratio solver built on the 2.1 prototype data has no entries for the new items and cannot produce machine counts for them. The site's ratio pages remain accurate for any vanilla chain the mod did not touch, but they cannot cover the new content at all.
Belt, inserter and logistics changes
Mods that add belt tiers or change belt speed affect throughput calculations. The belt balancer designs page derives items per second from belt movement speed; a mod that adds a faster belt or changes an existing tier's speed changes those figures. Inserter stack sizes and rotation speeds, if overridden, affect the throughput limits discussed on the inserters and belts page. Logistics robots that receive a modified speed or payload size change the capacity math on the robots page.
Module and beacon changes
Mods that add module tiers or change module effect values alter the productivity and quality calculations across the site. The quality mechanics page uses module effect values read from the prototype data; a mod that changes those values changes the quality probability and therefore the material cost multipliers. The fixed 1-to-10 cascade ratio is defined in the quality prototype itself and could, in principle, be overridden by a mod, though most overhaul mods leave it in place.
Combat and power changes
Mods that change turret damage, wall health, biter health or power production values invalidate the figures on the combat and power ratio pages. The solar and accumulator ratios depend on panel production and accumulator capacity as defined in the prototypes; a mod that changes either field shifts the panel-to-accumulator proportion.
When to trust this site's numbers
The numbers on SPM Atlas are computed from the unmodified prototype data for game version 2.1.12. They are accurate under the following conditions:
- You are running the base game and the Space Age expansion with no mods that override gameplay prototypes.
-
You have QoL or interface mods installed that do not touch
crafting_speed, recipe ingredients, energy values, belt speeds, module effects or machine stats. - You are calculating ratios for a production chain that a content mod left unchanged, and you are not mixing in modded intermediates.
When not to trust them
The numbers should not be relied on when:
- You are running an overhaul mod that restructures recipes, technologies or machines. Treat every ratio on the site as a structural template that shows how the arithmetic works, but recompute machine counts from the mod's own data.
- A mod has changed the crafting speed, module slots or energy usage of a machine you are counting. The ratio method is correct; the inputs are not.
- A mod has altered recipe ingredients or energy requirements for the specific chain you are planning.
- You are producing items that a mod added. This site has no prototype data for them and cannot generate ratios for chains that do not exist in vanilla.
How to verify which prototypes a mod changed
Factorio provides a prototype browser in the game's mod settings and
writes prototype data to the script output directory when requested via
the Lua API. More practically, every mod ships its
data.lua and related files in its folder inside the
game's mods directory. Searching those files for a prototype name
— for example, assembling-machine-3 —
reveals whether the mod re-declares it. If the name appears in a
data:extend call or an assignment, the mod overrides it.
The staged loading system also helps. A mod that changes a value in
data-final-fixes.lua makes its intent visible by file
name; that stage exists specifically for last-in-wins adjustments.
If you are debugging why a ratio is wrong in a modded game, checking
which mod writes to data-final-fixes.lua is often faster
than reading every mod's data.lua.
The method survives even when the numbers do not
The most useful thing this site provides for modded players is not a specific number but the calculation method. The arithmetic of production ratios — dividing recipe energy by crafting speed, multiplying by ingredient count, accounting for modules and beacons — is engine-level and does not change with mods. What changes is the prototype data fed into that arithmetic. A player who understands the method can read a mod's prototype files, extract the relevant fields, and compute correct ratios for any modded install. The production ratio calculator is a vanilla-data tool, but the steps it follows apply to any set of prototypes.
This is also why the site cites the game version on every page. Prototype data is versioned; a Wube balance patch between game updates changes it just as a mod does, and the version stamp tells you exactly which set of definitions the numbers were computed from. When the game updates, the data is re-extracted and the numbers are regenerated. A modded install is, in this sense, just a custom version of the same data.
Applies when…
- All prototype examples are read from data/2.1/ for game version 2.1.12. Mods that override the cited fields change the shown values.
- The description of the three-stage loading sequence (data.lua, data-updates.lua, data-final-fixes.lua) reflects Factorio's mod API and is not affected by game balance changes.
- Claims about which mod categories affect ratio numbers assume the mod actually overrides the relevant prototype fields. A content mod that adds items without changing recipes leaves vanilla ratios intact; an overhaul mod that changes both overrides them.
- No specific mod is named or rated on this page. The mod categories described are structural classifications, not recommendations.
- This page does not host or distribute blueprint strings. Factory layouts shown in screenshots are illustrative only.
Related
- How production ratios actually work — the arithmetic that applies to modded and vanilla prototypes alike
- Quality mechanics — module-driven probability that depends on prototype values mods can change
- Science pack ratios — a worked example of vanilla prototype data in action
Spot an error or an out-of-date figure? Contact us at [email protected].