Google Maps for a Fantasy World, and Why I Did Not Build That
Infinite zoom from a continent down to a single room sounds like a tile pyramid. For a procedurally generated world it is a trap, and nested documents are the better answer.
I was building a D&D character creator and it turned into a world engine, which I will write about separately. This post is about one decision inside it that I got right by first understanding why the obvious version was wrong.
The ask was easy to state. Zoom from a world map, through regions, down to a settlement, down to individual buildings. "Google Maps for a fantasy world."
Two things that phrase can mean
The first reading is continuous semantic zoom. One infinite coordinate space, a multi-resolution tile pyramid, layers fading in as you zoom. This is how Google actually works.
The second is nested documents. The world map is one document. A settlement is a separate document with its own coordinate space and its own generator. Zooming is navigation between linked documents, and a transition animation sells the continuity.
The first one is what people picture, and it is the trap.
Why the obvious version fails here
Google Maps works because the real world already exists and has been pre-rendered into tiles on a server. Nobody is generating Ohio on demand while you pan across it, and nobody has to make sure Ohio stays consistent with the street you zoomed into last week.
A procedural fantasy world has neither of those advantages. Every scale has to be generated, coherently, in relation to every other scale, on demand, in a browser. If a settlement sits at a particular spot on the continent, its street layout has to agree with the terrain, the coastline, the river, and the political border that the world map drew. Change the world map and every settlement generated from it is now potentially wrong.
That is the coherence problem, and it is genuinely hard. Then there is the performance problem sitting on top of it, which is that continuous zoom means the browser is holding some representation of everything, everywhere, at once.
I could have spent months on a tile pyramid and a coherence pass and shipped something that melts a phone.
What nested documents buy you
The structural advantage is one sentence: only one document is ever rendered.
The browser holds the continent, or it holds one town, or it holds the inside of one building. Never all three. The thing that kills the tile-pyramid approach simply does not exist, because there is nothing to keep in sync in memory and nothing to render at multiple scales simultaneously.
Coherence becomes a generation-time problem rather than a render-time one. A settlement is generated once from the world cell it sits in, and stored as a snapshot. It only needs to agree with the world at the moment it was made, and when the world changes underneath it, that becomes an explicit remap step instead of a continuous consistency obligation.
And the infrastructure cost is zero. No tile server, no raster pyramid, no new services. Every document is a JSON snapshot in the same table family as everything else.
The part I want to argue with people about
Nested documents are not a watered-down version of continuous zoom. They are better suited to this problem.
"Infinite detail" stops being a rendering load and becomes an authoring depth: how many places has the DM bothered to expand into their own map? That is the right variable. A world where three towns are fully realized and forty are pins is not a degraded world, it is exactly how a real campaign setting works. The compromise the architecture forces on you happens to be the compromise the domain wanted anyway.
The animation does the rest. When clicking a settlement pin plays a zoom transition into its map, nobody thinks about documents. They think they zoomed in. The illusion is cheap and total.
The lesson I keep relearning
The first version of a hard requirement is usually a description of a solution, not a problem. "Google Maps for a fantasy world" is a solution. The problem was "I want to move fluidly between scales without losing the sense that it is one place."
Those have very different best answers, and I only found the good one by asking which of the two the phrase actually meant.