← artifacts
0 m

Digging down

Noita has no room graph, no corridor solver and no level file. Its caves are herringbone Wang tiles stamped into a pixel grid — every one of them rebuilt from nothing but a seed and a coordinate. Here is that pipeline, running live.

−120 m

01A picture decides where the world is

The whole world's layout lives in one tiny image. Each pixel stands for a block of world roughly 512 pixels across, and its colour picks the biome that fills it. Walk sideways far enough and the image repeats — those repeats are the parallel worlds.

Centre column is the main world. The dimmed columns either side are the same image again — same generator, coordinates far outside its intended range.

−430 m

02Every biome is a bag of tiles

A biome ships one template image holding many small tile variants. Tiles come in two shapes: wide ones (2×1) and tall ones (1×2). What matters is the edge codes — each side carries a marker saying whether a tunnel opens there.

green = opening · grey = wall

The number under each tile is its six edge codes read as bits. 128 possible signatures per shape; a real biome ships several hand-drawn variants of each.

−980 m

03Stitched in a herringbone

Now the trick. Tiles are laid in an interlocking herringbone — wide and tall pieces offset like parquet flooring, never in a square grid. Two things fall out of that for free: no visible seam lines, because no join ever runs straight for long, and guaranteed connection, because matching edge codes means matching tunnel mouths.

0 tiles

Watch a tunnel cross a tile boundary. Neither tile knew about the other — they agreed because they read the same edge code.

Nothing here is sequential. Each edge code comes from hashing the seed with that edge's world coordinate, so any tile can be generated alone, in any order, at any time. That is why a chunk you walk back into is identical, and why a seed reproduces a wand's stats as reliably as it reproduces a cave.
−1 640 m

04Colours become matter

The stitched image is still just colours. Scaling it up and running each pixel through the biome's material table turns it into physical stuff — rock, coal, ore, water, lava. Drag the handle to compare the flat colour codes with what they expand into.

Left of the handle: raw template colours. Right: expanded material data, one entry per world pixel.

−2 310 m

05Hand-built rooms drop in

Pure noise makes caves, not places. So certain marker colours are swapped for authored chunks — a chest alcove, an altar, a shopkeeper's platform. The big landmarks aren't generated at all: Holy Mountains and the vaults sit at fixed coordinates, and the generator fills around them.

−3 050 m

06Then it all starts falling

The reason any of this is stored as pixels rather than geometry: every pixel is simulated. Pour something in and the level stops being a level.

Drag on the cave to pour. Lava meeting water turns to stone — one rule, two materials, and suddenly the map is editable by anyone holding a bucket.

−3 900 m

Where this model is thinner than the real thing

The technique itself is public: Sean Barrett's stb_hbwang.h is a single readable header, around 600 lines, and it is what Noita's generator is built on.