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.
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.