Skip to content

About

Browser-based Factorio blueprint viewer and rate calculator — renders blueprints with real game sprites and computes production rates, entirely client-side.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Repository files navigation

FactorioTools — Paste a blueprint. Find the bottleneck. Fix it. Export.

A browser-based Factorio blueprint editor built for optimising production lines — with a rate calculator, a tick-by-tick belt simulation and the game's own art. Plus a production planner and a live map seed viewer.

Open the editor

CI Factorio 2.0 TypeScript Node Licence: MIT

Features · Open from a URL · Planner · Seed Viewer · Quick start · Build from source · Architecture · Licence


FactorioTools showing a logistic science build with per-machine rate labels, machine status colours and the Rate Calculator panel reporting 56% efficiency

Note

Everything runs client-side. No server, no upload, no account — blueprint strings never leave the page.

✨ Features

📊 Calculates rates

Items per second across the whole blueprint, grouped by machine configuration — with module and beacon effects, quality tiers and productivity research all accounted for. Imports, exports and the share of theoretical max at a glance.
Rate table listing products, ingredients and machines for a red science build
Science packs riding a belt through a splitter, down an underground and round a curve, where an inserter lifts them onto a belt that side-loads back into the main line

A combinator counting up on a red wire while a display panel shows the value as a battery bar that fills and changes colour from red to green

⏱️ Simulates belts tick by tick

Per-lane transport lines, curves, side-loading, undergrounds and splitters — so lane imbalance and starved inputs show up the way they would in game. Run at 1×, 4× or 16×, skip ahead a minute, and toggle inserter capacity research and belt stacking.

Circuits run too: constant, arithmetic, decider and selector combinators on separate red and green networks — Each, Anything and Everything included — switch belts, inserters and machines on and off, read their contents, and light lamps and display panels.

🔍 Analyses on the map

Lane signals, machine uptime, and a ranked list of what costs output, each traced from the symptom back to its cause. Hover any machine for its recipe, modules, beacons and exact per-minute flows.
Zoomed-in assemblers with a tooltip showing recipe, modules and per-minute rates
A full space platform rendered with game sprites

🎨 Renders with the game's own art

Belts animate, poles turn to face their wires, pipes and walls pick their connection art from their neighbours, and machines show their recipe and modules in alt-mode. Space Age, quality and elevated rails included.

🛠️ Edits in place

Place, rotate and erase; configure recipes and modules; wire poles and combinators; undo and redo. Import from a string, a factorioprints.com or fprints.xyz link, then export the result back to a blueprint string. A link can also open a blueprint directly: #/blueprint-editor?bp=<string or link> (see below).
Import / Export menu with clipboard import, random example and share links
Overlay Lab with layer controls for dimming, lane signals and machine status

🧪 Overlay Lab

Tune how the analysis is drawn: dim the build, choose lane-signal and machine-status styles, and filter to just the lanes or machines you care about — flowing, backed up, starved, output full, idle.

🔗 Open a blueprint from a URL

The Blueprint Editor imports whatever is in the bp parameter of its address:

https://malte9799.github.io/FactorioTools/#/blueprint-editor?bp=<blueprint string>
https://malte9799.github.io/FactorioTools/#/blueprint-editor?bp=https://factorioprints.com/view/<id>

bp is either a blueprint string or a link to a supported site (factorioprints.com, fprints.xyz). Prefer a link for big blueprints, since strings can run to tens of kilobytes. Put bp inside the # part: the site is static and routes on the hash. Percent-encode the value when building links by hand (encodeURIComponent); a raw + is also tolerated.

The parameter is removed from the address bar once it is read, so reloading restores your edits instead of importing again. Opening such a link replaces the blueprint that was open.

🧮 Production Planner

Production Planner showing 60 chemical science packs a minute as a flow diagram from ore and oil on the left to the science pack on the right, with machine counts on every step and a summary of raw resources, power and buildings

Name what you want and how fast, and the planner works out the whole factory behind it, down to the ore: every recipe, how many machines, which modules and beacons, the power it draws, the belts it fills and the drills and pumpjacks at the bottom.

  • A flow diagram, drawn with the game's icons. Raw resources on the left, your products on the right, one card per step with its machine count, and a band per item whose width follows the rate. Hover a card to light up what feeds it and what it feeds; click it for the details.
  • Everything about a step in one panel. The recipe as the game shows it, other recipes for the same item, the machine, module slots and beacons, the speed and productivity they add, and each input and output in belts.
  • Solved, not just added up. A linear program balances recipes with several products, so heavy and light oil are cracked instead of piling up, Kovarex and other loops balance, and by-products are reused where that saves resources. What is still left over or has to be brought in is listed.
  • Nauvis and Space Age. Foundries, electromagnetic and cryogenic plants, biochambers, scrap recycling, lava, brine and fluorine vents, asteroid chunks and Gleba's plants are all in. Burner machines burn the fuel you choose, and productivity research and mining productivity apply.
  • A table view, rates per second, minute or hour, and a share link that carries the whole plan, settings and per-step choices included.

Open it at #/planner.

🌍 Seed Viewer

Seed Viewer showing the Nauvis map of seed 123 with ore patches, enemy bases, forests and cliffs, and a panel listing the nearest patches

Warning

Early prototype. The numbers behind the map are checked against the game; how the page looks next to the real map has not been.

Enter a map seed and explore the world it generates — where the ore is, how much, and where the biters are. Nothing is pre-rendered: the page runs the game's own map generation live, so every seed, preset and slider setting works.

⛏️ Finds the resources

Ore patches, oil wells, trees, cliffs and enemy bases, drawn the way the in-game map draws them. Hover a patch for its exact amount and size; the panel lists the nearest patches with distance and bearing. Pan, zoom and share the view as a link.
A hovered iron ore patch outlined in white with a tooltip reading 425k in 702 tiles, 48 tiles from spawn
The same seed on Vulcanus, Gleba, Fulgora and Aquilo

🪐 All five planets, all the settings

Nauvis, Vulcanus, Gleba, Fulgora and Aquilo, each from the seed the game gives it. The game's presets (rail world, death world, island…), the map type, frequency, size and richness for every resource, the moisture and terrain sliders, the starting area and the map size.
How close it is to the game, and where it is not

packages/mapgen reimplements Factorio 2.0 map generation in TypeScript, in single precision and in the game's order of operations. Its tests hold it to exact values recorded from the real game:

Checked bit for bit
Every tile, resource, tree and enemy expression on Nauvis two seeds, three presets, two custom settings files
Vulcanus, Gleba, Fulgora, Aquilo every tile and entity expression
Each noise function on its own basis, multi-octave, spot and all Voronoi variants
Cliffs and resource entities around spawn on Nauvis what the game actually placed

Where an entity lands is a roll, and the game rolls each chunk from one random stream that every entity in the chunk draws from in turn. The viewer replays that stream (see placement.ts), so ore tiles and oil wells are the ones the game places, with their amounts.

Known gaps

  • The game straightens shorelines after generating a chunk. That is not reproduced, and in the few chunks it touches the wells can come out wrong — about a third of them on Aquilo, which is mostly coast.
  • No cliffs are drawn where the game smooths them: the Lakes and Island presets, and Vulcanus.
  • On Fulgora about one cliff in six differs, and scrap is drawn as a filled field although the game fills only about half of its tiles.
  • On Gleba only a sixth of the stone is placed.
  • Trees are a scatter of the right density and enemy bases the area they can occupy, not individual entities.
  • Only Factorio 2.0 is supported; 1.1 uses a different noise system.

🚀 Quick start

  1. Open malte9799.github.io/FactorioTools.
  2. In game, copy a blueprint to the clipboard.
  3. Click Import / Export → Import from clipboard and paste the string or link. No blueprint handy? Load a random example picks from 170+ curated builds.
  4. Open Simulate to see what it produces, where it loses output, and why.

🧰 Build from source

Requirements

  • Node.js 22+
  • Factorio 2.0 — only if you want to regenerate the sprites and game data (Space Age, quality and elevated rails are read if present)

The generated dataset in apps/site/public/data/ is checked in, so cloning and running is enough to work on the app:

git clone https://github.com/malte9799/FactorioTools.git
cd FactorioTools
npm install
npm run dev

Commands

Command What it does
npm run dev Start the dev server
npm run build Production build into apps/site/dist
npm test Engine, simulation, renderer and map-generation test suites
npm run check Typecheck every workspace

Regenerating the game data

Rebuild sprites and prototypes from your own Factorio install

First, dump the prototype data from inside the game. This writes data-raw-dump.json into Factorio's script-output directory:

factorio --dump-data

Then run the pipeline in this order — the steps are not independent:

npm run dump-to-gamedata   --workspace=@factoriotools/data-pipeline
npm run extract-sprites    --workspace=@factoriotools/data-pipeline
npm run crop-sprite-sheets --workspace=@factoriotools/data-pipeline
Step Output
dump-to-gamedata Reads the dump and writes game-data.json and render-catalog.json.
extract-sprites Copies the referenced sheets out of the install, plus the shortcut-bar art the quickbar draws its buttons from.
crop-sprite-sheets Trims each sheet to the cells the renderer actually samples (143 MB → 10.6 MB) and rewrites the catalog's column counts to match.

[!WARNING] Running the first step alone leaves the catalog claiming uncropped column counts against cropped images, which silently breaks about 29 entities. If you regenerate, regenerate all three.

The Seed Viewer's data is a separate, independent step that reads the same dump and writes data/mapgen/<version>.json:

npm run dump-to-mapgen --workspace=@factoriotools/data-pipeline

Good to know

  • Non-standard install paths are read from FACTORIO_DATA and FACTORIO_DUMP.
  • extract-sprites is incremental: it stamps each source file's size and mtime and skips anything unchanged whose output is still present, so re-running it after a crop leaves the cropped sheets alone. Pass --force to rebuild regardless.
  • Until the shortcut art exists, the quickbar shows plain text labels.
  • The belt simulation reads belt speeds, underground lengths and splitter prototypes from game-data.json. A dataset generated before those were extracted still works — packages/sim falls back to built-in vanilla values.
Check map generation against a real Factorio install

packages/mapgen has two development scripts that run the game headless. Both use their own config and write directory, so a running game and your saves are left alone. Neither is needed to run the tests.

npm run make-fixtures   --workspace=@factoriotools/mapgen          # re-record the test fixtures
npm run compare-preview --workspace=@factoriotools/mapgen -- 123   # diff a seed against the game's map preview

FACTORIO_BIN and FACTORIO_DATA point them at a non-standard install.

🏗️ Architecture

An npm-workspaces monorepo. engine, sim, mapgen and most of renderer are DOM-free and tested directly with tsx; apps/site is the browser layer.

flowchart LR
    F[(Factorio install)] -->|data-pipeline| D[/game-data.json<br/>render-catalog.json<br/>sprites/]
    F -->|data-pipeline| N[/mapgen data/]
    D --> E[engine]
    D --> S[sim]
    D --> R[renderer]
    N --> M[mapgen]
    E --> A[apps/site]
    S --> A
    R --> A
    M --> A
Loading
Workspace What it holds
packages/engine Blueprint decode/encode, the rate calculator, the production planner's solver, prototype types. No DOM.
packages/sim Tick-by-tick belt simulation: per-lane transport lines, curves, side-loading, undergrounds, splitters; and the circuit network. No DOM.
packages/mapgen Factorio 2.0 map generation: noise expressions, spot and Voronoi noise, cliffs, entity placement. No DOM.
packages/renderer Canvas renderer: sprite atlas, neighbour classification, camera, draw passes.
packages/data-pipeline One-time scripts that turn a Factorio install into the dataset.
apps/site The page itself — panels, menus, editing, library.

Every pushed branch is built and published as a preview under https://malte9799.github.io/FactorioTools/preview/<branch>/.

📜 Licence

The code is MIT. Blueprint math is ported from Rate Calculator by raiguard, also MIT licensed.

Map generation stands on other people's reverse engineering. The algorithms behind the game's noise functions were worked out and published, with Wube's permission, in ness056/fast-factorio-seed-finder; packages/mapgen is an independent TypeScript implementation written from them, and carries that project's table of gradient values, which cannot be derived any other way. The RNG test vectors are from TOGoS/FactorioNoiseJS, by the author of the game's noise system.

Factorio, its prototype data and its sprite art are the property of Wube Software and are not covered by that licence. This project reads them from a Factorio installation at build time and is not affiliated with Wube Software.

Star History

Star History Chart

About

Browser-based Factorio blueprint viewer and rate calculator — renders blueprints with real game sprites and computes production rates, entirely client-side.

Topics

Resources

Stars

3 stars

Watchers

0 watching

Forks

Sponsor this project

Contributors

Languages