Hattorio
Every planet is carved into cells of the hat tiling, the aperiodic
monotile found in 2023. It never repeats, so no two cells are the same
shape, and your blueprint library stops fitting.

Why does this mod exist?
I'm willing to bet that if I asked any seasoned Factorio player to sketch
me a green circuit build, I'd get roughly the same thing back: three
assemblers making copper wire feeding two making circuits, an iron plate
belt down the side, power poles placed so the whole block tiles cleanly
and marches off in one of the cardinal directions forever.
Not because we each arrived there on our own. Because at some point early
on we worked out the ratios, or looked them up, stamped the result down,
and never had a reason to think about it again.

That block isn't bad. It's correct, and that's the problem; a solved
problem stays solved, and every playthrough after the first one arrives
at the same rectangles a little faster than the last.
In 2023 four mathematicians closed a question that had been open for
fifty years: whether one shape could tile the plane and never repeat.
It can, and they called it the hat.
A floor plan that never repeats is precisely what a tileable blueprint
cannot survive, so I enforced it on the map, and built the factory on it.
What this mod does
Each hat is a buildable cell. Between the cells runs a narrow band
you cannot build on. You can walk and drive across a band, but underground
belts and pipes have to tunnel beneath it. Rails, however, do cross it, and
power and bots ignore it.

That is the whole mod. No new items, no new recipes, no new technologies;
the ratios you already know are still the ratios. The only restriction is
where you are allowed to put things.
Why your blueprints stop fitting
Let's take the obvious objection first: if this were a matter of orientation,
it would cost you a keypress. Hats occur in twelve orientation classes,
but Factorio rotates in 90° steps and 2.0 can flip, so those twelve
collapse to about three, and r cycles you between them for nothing.
What does the work is that hats sit at irrational multiples of the tile
pitch. Every cell meets the square grid at a different sub-tile offset,
so every cell rasterises into a different set of squares. Measured over
1,156 cells at the default settings: 885 distinct buildable shapes,
the most common of them covering 0.5% of the map.
So, a layout that fills a specific cell has been fitted to that cell,
and to no other cell.
Blueprints up to a certain margin still work
Anything up to 17×17 at the
default settings fits every cell on the map. That is the honest limit of the mechanism,
and it is deliberate: what dies is not your knowledge, it is the habit of
stamping a block that uses a space well, because the space is never the
same space twice.
What changes in play
Think ahead. Cells differ, and they meet each other
differently; some neighbours share a long edge, some touch at a point.
A cluster that sits well together is worth walking for, and the only
place you can see it is the map.
Cells replace the bus. A bus assumes parallel lines running as far as
you care to run them. Nothing here runs that far. Each cell ends up a
small factory with one job, and the interesting decisions move to the
connections between them.
Every crossing has to be deliberate. Belts leave a cell by underground pair,
against an edge that is never axis-aligned. Power poles ignore the ground
entirely, so power is never the problem, belts are; and they are the
thing you will build and rebuild most.
Trains get better. Rails are exempt and cross bands freely, so at any
distance they hurt far less than belts. Expect to reach for rail earlier
than you otherwise would.
Bots will lift the constraint. They fly over the whole problem, and they arrive on
normal progression. That is intended: the constraint is meant to bite
hardest in the belt era and ease as you tech up, not to follow you to the
end of the run.
Settings
Cell size and band width are set per planet, at world creation. Under
Space Age each planet gets its own pair, so Nauvis can be comfortable
while Vulcanus is not.
Cell size controls the amount of pain you're about to receive:
| Cell size | Cell area | Largest blueprint that fits every cell |
|---|---|---|
| 15 — very hard | 63 tiles | 5×5 |
| 26 — hard | 294 tiles | 10×10 |
| 41 — normal (default) | 858 tiles | 17×17 |
| 52 — easy | 1,473 tiles | 22×22 |
A smelter block runs at about 20×20 and a mall about 30×30, so every option,
"easy" included, defeats an imported blueprint. What the size decides
is how much room you get to improvise in.
Band width runs 1 to 4 tiles. Every width can be spanned by an underground
belt, so no cell is ever cut off from its neighbours.
Ore. Bands put some ore out of reach of a 3×3 drill. Richness in newly
generated chunks is raised automatically to compensate, scaled to your
cell size and band width; there is a manual multiplier if you would rather
set it yourself. /hattorio-info reports the geometry and richness
actually in force on the surface you are standing on.
Appearance
Bands are animated dark liquid by default, or
a flat void if you prefer stillness, in one of five near-black colour
configurations. What separates them is the highlight the surface catches at its edges.
Reflected cells, about one in eight, are tinted more strongly so you can
spot them. A per-player option draws a
line down the centre of each band if you want the boundaries called out
explicitly.
Before you start
Start a new world
Bands are painted as chunks generate, so adding
Hattorio to a save in progress leaves vanilla ground across everything you
have already explored, with a permanent seam at the edge of it. The mod
will tell you when you do this, and it cannot undo it.
Your settings are fixed per surface
Cell size and band width are
baked into terrain as it generates. Changing them later affects only
surfaces created afterwards, so a world in progress keeps the geometry it
was built with and never seams mid-map.
Single player, for now
The tiling
uses only correctly-rounded IEEE arithmetic and no trigonometry, so every
client computes identical cells; but it has not been verified with two
clients actually connected. If you do try this in multiplayer, and run
into issues, let me know in the comments below, or file an
issue on my github repo.
Factorio 2.0 or later
Space Age is supported, not required.
Credits & Inspiration
The hat was found in 2023 by David Smith, Joseph Samuel Myers, Craig S.
Kaplan and Chaim Goodman-Strauss. Smith found the shape; the other three
proved it does what it appears to do.
The substitution structure Hattorio uses to generate the tiling is derived
from Kaplan's hatviz, BSD-3-Clause —
see THIRD_PARTY.md.
Hextorio did this for hexagons
first and had already solved several of the same problems. Its approach to
storing geometry per surface is borrowed here.
Hattorio is MIT licensed. Source, and a write-up of how the tiling is
generated, at github.com/vetkat/hattorio.
The wiki covers the maths, how
the limiting metatiles were recovered as exact algebraic numbers, and why
plain doubles beat exact integer arithmetic by nine orders of magnitude
(in Lua 5.2 at least).
Use of GenAI and LLMs
Most of the code in this mod was written by a large language model. I set
the direction, made the design decisions, reviewed what came back and
decided what shipped, but I'm not going to claim I typed it.
I'm saying so because you're entitled to know, and because the obvious
worry is a fair one: generated code is confident about things it has not
checked. So the mod is built so that its confidence isn't what you're
relying on.
The tiling is produced by a Lua core validated against a golden fixture
exported from a separate Python pipeline. That fixture is itself checked
for overlaps, for gaps, for the correct density of reflected hats, and for
hat counts matching F(2n+3)². Every figure quoted in this description is a
measurement, and a test fails the build if the documentation and the code
stop agreeing about them. All of it is MIT licensed and on GitHub,
including a design document that records what turned out to be wrong.
None of that makes it correct. It makes it checkable, which is the most I
can honestly offer, and the one thing I haven't managed to check is
multiplayer, which is why I kindly request you do if you feel so, and if
you run into issues, please let me know.