DEV Community

dev game
dev game

Posted on

Why Factorio Bet on a Custom Deterministic Engine: The Unfashionable Lockstep Behind 3.5 Million Factories

The short answer

Factorio was not built in Unity or Unreal. Czech studio Wube Software built it on its own deterministic simulation engine with Lua for modding, so that hundreds of thousands of belts, inserters, trains and biters can stay perfectly in sync in multiplayer by sending only player inputs, not the world state.

That unfashionable choice explains both the magic and the pain: Factorio is described by Wube as very stable and optimized for building massive factories, with over 3,500,000 people having bought the game after development from spring 2012 to early 2021. It also explains why multiplayer took years to stabilize, why a tiny floating-point difference can cause a dreaded desync, and why the game still gets polished updates like stable 2.0.77 and experimental 2.1.22 in 2026.

This article is for indie developers and technical players asking: what did Wube actually gain and lose by owning time itself, and what can you steal without rewriting your own engine?

Facts first: what Factorio is and when it shipped

Factorio is a factory simulation developed and published by Czech studio Wube Software, where a crash-landed engineer must harvest resources and automate industry to build a rocket, with single-player, cooperative multiplayer and extra scenarios.

Key dates and scope for this analysis:

  • Announced via Indiegogo in 2013, early access on 25 February 2016, full release for Windows, macOS and Linux on 14 August 2020, Switch on 28 October 2022.
  • Paid expansion Space Age released 21 October 2024, adding four planets, space platforms and interplanetary logistics.
  • Current version tracked on the official wiki is stable 2.0.77 and experimental 2.1.22, with 5,212 documented articles maintained by the community.
  • Mods are a first-class feature: mods are written in Lua and distributed through an official portal and in-game manager.

The core loop is mining drills, robotic arms, furnaces, assembling machines and conveyor belts everywhere, plus electricity, oil refining, trains, logistic robots, blueprints with construction drones, a Turing-complete circuit network, pollution and biter defense, nuclear power and finally a rocket launch. Multiplayer is cooperative freeplay by default, with dedicated headless servers, PvP forces and shared blueprints.

What the custom stack actually is

Wube does not list Unity or Unreal anywhere. What it lists is ownership:

In other words: hard core owned by Wube, soft edges opened to players. Unity gives you the opposite — open core you rent, closed edges you fight.

How lockstep works, in plain English

In Friday Facts #76 Wube explains it uses lockstep simulation: each peer runs the full simulation of everything, and when you act only that action is sent to others. No central server simulates the world for you.

Why that fits factories:

  • Bandwidth stays tiny. Keyboards generate a few hundred bytes per second, so the game plays the same with a hundred objects or a million. That is why Wube says it could support hundreds of thousands of active entities over the internet without major hacks.
  • There is no state to correct you. If one peer calculates enemy health 0.0001% differently or a rocket explodes slightly left, there is no authority snapshot to merge. Errors accumulate until players see completely different games. Factorio players know that as desync.
  • Speed is limited by the slowest player. To finish a tick you need inputs from everyone. Wube adds a latency buffer that lets peers wait without stuttering, but it also delays your local actions by that buffer.

Friday Facts #99 shows the follow-up cost: pure peer-to-peer breaks when one group is on LAN and another is outside NAT. Wube had to add server-forwarded messages as an option in 0.12.4, trading a little extra latency for connectivity that actually works. The multiplayer wiki still lists those three technical posts as the canonical explanation: lockstep architecture, client-server connections and NAT punching.

If you come from shooters, this is backwards. Shooters use client-server with prediction and smooth merging. Factorio cannot merge. A belt either has 106 gears or it does not.

What the custom engine gained

  1. Scale without server bills. Sending inputs instead of snapshots means huge public servers and hundred-player streamer events are feasible without Wube paying for simulation servers. The hard player limit is 65,535 in config, with practical limits far lower but still over a hundred in the wild.

  2. Determinism as a feature, not just netcode. Replays, save files that load in single and multiplayer, shared blueprint libraries and automatic mod sync all fall out of one property: same inputs plus same tick equals same factory. That is why blueprints feel like code.

  3. Performance ownership. When your game is belts plus inserters plus fluids, you need to optimize exactly those. Rseding91 is credited for loving performance optimizations, Posila for engine and rendering internals. You cannot profile Unity's black box that precisely. The payoff is visible in Space Age: four planets plus moving space platforms are only shippable because Wube owns the tick loop.

  4. Modding without forking the engine. The modding wiki documents in-game and web portals, dependency handling and automatic sync of exact mod versions for saves and servers. By the 1.0 post Wube thanked creators for 5,603 mods, 18,855 bug reports and community tools like calculators and blueprint databases after 8.5 years of work. Lua absorbs the creativity that would otherwise become engine feature requests.

What it cost

  • Eight and a half years to 1.0. Friday Facts #360 frames 1.0 as the end of an incredible ride, with around 150 forum bugs and 80 internal tasks still deferred to 1.1. Owning determinism means owning every floating-point nondeterminism, every desync report and every renderer bug yourself.
  • No asset store to borrow from. Trains, fluids, circuit networks, elevated rails and quality tiers all had to be built and balanced in-house. Unity teams buy a controller; Wube wrote inserters.
  • Networking that punishes casuals. Port 34197 UDP forwarding, no randomized source ports, identical game and mod versions on all peers, firewall exceptions — the multiplayer setup guide reads like server admin docs, not matchmaking. That filters the audience to people who enjoy reading wikis.
  • No price elasticity. Steam notes Wube has no plans for sales or price cuts. When you sell stability and thousands of hours per player, discounting would cheapen the promise. It works at 3.5 million copies, but it is not a template for a short narrative game.

My take: Factorio renders time, not pixels — and that is the real niche

Most engine comparisons obsess over graphics. That misses the point. Here are three contrarian ideas I have not seen in the usual Unity-vs-custom debates:

1. Unity optimizes frames, Factorio optimizes ticks.

A shooter can drop a frame and interpolate. A factory cannot drop a tick and pretend the iron still arrived. Wube's engine is a clock that happens to draw factories. Once you see it as a distributed clock, the hated latency buffer makes sense: it is not lag, it is agreed-upon time. My unrigorous rule: if your core fantasy is accumulation over hundreds of hours, rent a renderer but own your clock. If your fantasy is 10 hours of spectacle, do the opposite.

2. Desync is a design tax that became a moat.

Everyone calls desync a bug. I think it acted as a filter. Because any nondeterminism breaks multiplayer, Wube was forced to ban sloppy randomness, enforce strict simulation discipline and build replay-grade tooling early. That discipline later made Space Age possible. Competitors who start with Unity's forgiving state sync can prototype faster, but they hit a wall at 50,000 entities where Wube keeps going. Pain early, monopoly late.

3. Closed core plus open edges beats open core plus closed edges.

Unity is open in the middle — you can build anything until you hit the engine wall, then you are stuck. Factorio is closed in the middle — you cannot change the tick — but radically open at the edges with Lua prototypes, runtime events, map editor scripts and a content system that explicitly invites custom scenarios like Transport Belt Madness, Tight Spot and Wave Defense. Players do not want a new engine; they want new problems inside a trusted clock. Wube understood that modders are level designers with code.

Put together, the custom engine was not machismo. It was market positioning: be the only game where megabase builders, speedrunners and modders all trust the same tick for a decade.

What indie devs can steal without writing an engine

  • Decide what must be deterministic. Even in Unity, isolate simulation from presentation. If belts, economy or combat math live in a fixed-tick, input-driven module, you get replays and netcode options for free.
  • Send intents, not states, where counts explode. If your entity count can exceed 10,000, prototype lockstep for co-op before assuming snapshot sync will scale.
  • Budget for the slowest player. Lockstep means performance is multiplayer design. Profile worst-case factories, not empty maps.
  • Give Lua-like edges early. Settings, prototypes and runtime hooks, as documented in the Lua API lifecycle, let players extend content while you stabilize the core. That reduces feature pressure more than any roadmap.
  • Write Friday Facts, even for five readers. Wube's weekly posts created accountability, bug reports and a diary of tradeoffs. The habit matters more than the audience size.

Where to practice the same thinking in a browser

You do not need a 500-hour save to train factory brain. Two free browser games drill adjacent skills in short sessions:

If you want to feel the early Factorio loop of punching trees, hand-mining ore and deciding what to automate first, try Mine Clone, a blocky sandbox where you gather wood and stone, craft tools and expand from a hut to a functioning base. Its Creative versus Survival choice mirrors Factorio's peaceful versus biter tradeoff on a tiny scale — scarcity first, creativity second.

If you want to practice the late-game skill of blueprint planning and layered layouts, try Craft World, a builder with over 300 blocks where planning outlines, layering textures and using vertical space turn flat walls into intentional factories. Treat each room as a Factorio sub-factory with one purpose, keep backup materials like you keep iron plates buffered, and you will recognize why Factorio veterans sketch before they build.

Neither replaces Factorio's tick-perfect simulation, but both teach the habit Factorio rewards: think in flows, not objects.

Open questions and limits

  • Will 2.1 be the last major update as announced for June 2026, and does Space Age mark the ceiling of what one deterministic tick can simulate?
  • Can Wube keep Switch and Switch 2 ports in lockstep with PC without fragmenting the mod ecosystem?
  • For your game, is determinism worth 8.5 years? For most 2D roguelikes and narrative games, the answer is no — use Godot or GameMaker and ship. Factorio's lesson is conditional: own time only if time is your gameplay.

Bottom line

Factorio bet that factory players care more about a trustworthy clock than shiny graphics or quick matchmaking. With 3.5 million buyers, a Lua mod universe and a lockstep netcode that still teaches networking lessons a decade later, that bet paid. The contrarian insight is simple: in simulation games, networking is gameplay. Own it, or it will own you.

Top comments (0)