Visualizations
093 / 500

093 · Generative art

Invented Atlas

A parchment map of a world that never was, with rivers, realms and its own language.

A continent of warped fractal noise and ridged mountain chains gets a quantile sea level, then a priority flood and flow accumulation send rivers downhill to the sea, thickening as tributaries join. Coasts are marching-squares contours ringed by waterlines from a distance transform, and mountains, hills and forests are scattered by Poisson-disc sampling and inked back to front as the sheet draws itself. Every world also invents a language: consonant and vowel inventories, syllable rules, a spelling with digraphs and accents, and a lexicon of glossed roots. Each realm grows from its capital by Dijkstra over the land, with mountains and rivers as costly frontiers, and speaks a dialect with its own sound shifts and suffix, so its towns sound related.

Try it. Drag to pan (with momentum) or use the arrow keys. Click land to found a new realm: it is named in a new dialect and the borders are redrawn. Hover a town to read what its name means. Press N or Space for a new world and language.

  • Priority-flood hydrology
  • Procedural language generation
  • Poisson-disc sampling
  • Dijkstra territories

View the source · one module, plus a small shared runtime for sizing, the animation loop and input

Build your own

Paste this into Claude Code, Codex or any coding agent to get a simple version running, then take it wherever you like.

Build a fantasy map generator with JavaScript and the HTML canvas element: an invented continent on parchment, with rivers, mountains and place names in a made-up language. Put everything in a single index.html file with no libraries or build step, so I can open it directly in a browser.

Start simple:
- Make a canvas that fills the window, stays sharp on high-DPI screens (scale by devicePixelRatio), and resizes with the window. Fill it with a parchment color and a few soft darker blotches.
- Write a small 2D noise function yourself and fill a grid of about 200 by 130 heights with a few octaves of it, minus a falloff toward the edges so the land forms an island. Pick the sea level so roughly 40 percent is land.
- Draw the coastline with marching squares in dark brown ink, with two or three fainter copies further out to sea for ripples.
- Mountains: on high cells, scatter small inverted-V glyphs with a few hatching strokes on one side, keeping them a minimum distance apart. Draw them from top to bottom so lower ones overlap higher ones.

Once that works, make it beautiful:
- Rivers: let every land cell drain to its lowest neighbor, count how much water flows through each cell, and draw rivers where that count is large, getting wider downstream.
- A naming language: pick a small set of consonants and vowels and a syllable pattern such as CV or CVC, build names of two or three syllables, and avoid ugly clusters. Name a dozen towns placed near rivers and coasts, with a small circle for each.
- Add scattered tree stamps in some lowland areas, a compass rose and a title.

Explain the key ideas in short code comments. When you're done, tell me how to open it and suggest three directions I could take it next, such as kingdoms with borders, dialects so each region's names sound related, or sea serpents in the margins.
PreviousTemperature GardenGreedy, beam, top-k, nucleus and temperature sampling grown as a botanical plate. NextFoucault PendulumA museum pendulum ploughs a rosette into sand as the Earth turns beneath it.

Related visualizations

  • Topographic SurveyGenerative art Eroded terrain printed as a survey sheet with labeled contours, streams and hillshade.
  • Plotter LandscapeGenerative art A mountain range inked stroke by stroke, with exact floating-horizon hidden lines.
  • PlanetAstronomy A procedurally generated world with oceans, clouds and a glowing atmosphere.
  • Ink Landscape ScrollGenerative art An endless ink handscroll of misty peaks, pines, pavilions and boats, unrolling.
  • Procedural CityGenerative art An isometric city that builds itself and runs through day and night.
  • Route PlannerAlgorithms Dijkstra, A*, bidirectional search and contraction hierarchies race on a printed atlas.
  • Naming GameEmergence Villagers on a hand-drawn island invent words and talk their way into dialects.
  • Map ProjectionsMath One procedural planet morphing through a dozen map projections, Tissot ellipses and all.
  • ErosionNature Raindrops carve rivers and valleys into a mountain range.

Use ← and → to move between demos. While the canvas has focus, keys go to the demo instead.

← More from Emergent Mind Labs