dunkean/magna-urbis
About
Free, open-source procedural generator for fantasy & historical regions and cities: terrain, rivers, roads, 115 cultures, streets to roofs, in 2D & 3D. Rust/WASM + WebGPU. Imports OpenStreetMap, Watabou and Azgaar FMG.
Games & EmulationMeasured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Original
Procedural regions, towns and cities for maps and tabletop role-playing games.
Relief, rivers, roads, countryside and 115 urban cultures, from the first hill to the last roof, in 2D and 3D.
Open the V2 alpha · How it works? · Desktop downloads · macOS (Apple Silicon) · Gallery · Discussions · Français
Magna Urbis V2 is in alpha
Magna Urbis V2 is now available as an alpha, in the browser and as a desktop application for Windows, Linux and macOS on Apple Silicon. Create a region, place its settlements, grow their towns, then explore and edit the result as a map or in 3D.
- Web: magna-urbis.org. No account and no install. Generation runs in your browser (Rust compiled to WebAssembly, with WebGPU when available).
- Desktop. Download Windows x64 (installer or portable ZIP) and Linux x64 (AppImage or DEB) from GitHub Releases. The app bundles the native Rust engine and native neural relief. It runs without a separate installation of Rust, Node.js or Python.
- macOS on Apple Silicon. The experimental preview is available as a DMG starting with alpha 0.3.10. The DMG is ad hoc signed and distributed without Apple notarization. GPU inference on a physical Mac remains unverified. Download the DMG
- V1: the first version stays online at v1.magna-urbis.org.
This is an alpha. Results, settings and saved projects may still change between versions. If something breaks, a report with the share code helps a lot.
What's in the V2 alpha
- One chain from relief to roof: procedural, neural or imported relief, rivers and lakes, climate and land cover, settlements, roads, towns and buildings, in 2D and 3D.
- Credible regions: settlements placed by access to water, room and culture; a regional population that keeps even alpine, arctic, desert and Underdark maps inhabited; villages with about one dwelling per household; harbours with quays, pontoons and cranes; fields that follow the farms, rivers and roads.
- Towns on their terrain: ground, buildings, roads, bridges, quays, walls and moats sit on the drawn relief in 3D, with one shoreline shared by the 2D map and the 3D view.
- 115 cultures, villages and camps, from medieval Europe to dwarven holds, drow enclaves and myconid towns in the Underdark, mixable in hybrid style sheets.
- Edit at every level: city, quarter, block, parcel and building, with a parcel merge tool, editable place names and settlement renaming.
- Map styles (parchment, atlas, topographic, cadastre, satellite, painted satellite, minimal), day and night, through the seasons, with snow and pack ice in winter.
- Neural relief in the browser on WebGPU and natively in the desktop app, with verified model downloads reused offline.
- Projects and exports: binary
.muprojprojects, share codes, recipes, PNG, SVG and heightmaps.
What changed in each desktop version is listed in the release notes.
What it generates
One chain, from the ground up. Every stage can be rerun, tuned or edited on its own.
- Relief: procedural terrain with erosion, painted zones (plains, hills, mountains), volcanoes and calderas, or neural relief from Terrain Diffusion. You can also import a heightmap.
- Water and climate: drainage, rivers, lakes from a climate water budget, river mouths and coasts, then climate-driven vegetation and land cover. An optional Underdark layer carves caverns, tunnels and lakes into any relief.
- Settlements and roads: site choice, a rank-size hierarchy, one regional road network, farms, hamlets, chapels, inns, ferries and remote places on summits, islets or cliff ledges.
- Towns and cities: composition and growth phases, quarters and streets, walls, gates and castles, bridges, parcels, a programme of who lives and works where, then building volumes with storeys and composed roofs. Neighbouring towns share their edges. The engine scales from a lone building to a metropolis of a million inhabitants.
- Maps: parchment, atlas, topographic, cadastre, satellite and painted satellite styles, day or night, through the seasons, with names and labels as their own layer. Orbit, walk or fly in 3D.
- Edit and export: change styles per quarter, parcel or building, reroll a scope, edit roads, rivers and labels. Export PNG, SVG, heightmaps, projects and recipes. With the optional local module, turn a view into an illustration or a battlemap.
115 cultures: 79 historical, fantasy and camp traditions (medieval Europe, bastides, medinas, Chinese and Japanese plans, Maya, Inca, Swahili, dwarven, elven, drow and many more), 27 modern, 8 futuristic and 1 alien. You can blend them in hybrid style sheets. Browse them all in the architectural styles catalogue.
Gallery
All images below are unretouched V2 screenshots.
Satellite views
![]() Desert medina and its river valley |
![]() Riverside quarter, close up |
Cities
![]() Venetian lagoon town, 10,000 inhabitants |
![]() Dwarven hold behind its angular wall |
![]() Planned Chinese city, rectangular plan |
![]() Bastide, polygonal plan |
![]() Wizard city at night |
![]() Tibetan monastery town in winter |
![]() Persian round city |
![]() Drow enclave |
Villages, camps and the countryside
![]() Norse ringfort |
![]() Mongol ordu |
![]() Lagoon village |
![]() Elven village |
Map styles
![]() Parchment |
![]() Topographic |
![]() Cadastre |
![]() Satellite |
![]() 150,000-inhabitant metropolis |
![]() Persian and medina hybrid, atlas |
![]() Night |
![]() Underdark |
Many more in the V2 gallery.
How it works
- How it works? The illustrated atlas (français): follows one world from the height field to the last roof, stage by stage, with diagrams and sources. Every ? button in the app opens the matching chapter.
- Architectural styles catalogue (français): the 115 cultures in 2D and 3D.
- Technical and scientific overview: system layers, erosion, hydrology, neural terrain, settlements, references.
- Method notes: one short note per implemented technique, with its sources and limits.
- Documentation index: rendering, recipes, cultures, designs and studies.
Under the hood: a Rust engine (terrain, water, settlements, cities, buildings) compiled twice, as WebAssembly for the browser and as a native local service for the desktop app. The interface and renderers are TypeScript with WebGL2 and WebGPU. Neural relief runs in Rust too, with Burn on the desktop and a small dedicated WGSL engine in the browser.
Inspired by Watabou
Magna Urbis is inspired by Watabou (Oleg Dolya) and his Medieval Fantasy City Generator (TownGeneratorOS). The project began as a Python port of TownGeneratorOS. That prototype is long gone, but Watabou's generators remain the reference for what a generated town should feel like: legible, varied and fun to read. Thank you.
Related projects
Magna Urbis is part of a small family of worldbuilding tools.
Neural Earth
Neural Earth generates whole procedural planets, from tectonic plates to local terrain. It combines World Orogen planetary geography with the learned refinement of Terrain Diffusion (Goslin), and adds climate, hydrology, biomes, soils and seasonal rendering, with Python/CUDA or browser Rust/WASM/WebGPU paths.
Magna Urbis's neural relief comes from this work: the Rust port of the Terrain Diffusion chain and the distilled, quantised models published on Hugging Face. The long-term goal is to place Magna Urbis towns and roads into Neural Earth worlds. That integration has not been delivered yet.
Other projects
- Namebench: a sandbox for personal names and place names. Magna Urbis embeds an extract of it (about 550,000 place names and 51 name generators, linked to its cultures) to name settlements, rivers, lakes, relief and regions.
- Lineage Lab: a sandbox for population histories and genealogies.
- Chronos: a deterministic Rust history generator and chronology workshop for procedural worlds.
- AI RPG Generator: an earlier experiment in RPG content generation with language models and latent diffusion.
Run from source
Requirements: Node.js LTS and npm, Rust through rustup (the toolchain is pinned in rust/rust-toolchain.toml) and wasm-pack. On Windows, also install the Visual Studio C++ build tools.
cd web
npm ci
npm run prepare:v2 # build the Rust terrain and houses WebAssembly packages
npm run dev:v2 # open http://127.0.0.1:5174/v2.html
Other commands, from web/:
npm run build:v2 # static site in web/dist-v2
npm run app:v2:dev # desktop app in development
npm run app:v2:build # desktop app and installer for this OS
npm run test:v2 # V2 tests
To run the original standalone V1 map with the prepared WASM packages, use npm run dev:v1 from web/ and open http://127.0.0.1:5173/index.html. Use npm run build:v1 to build the static site in web/dist.
The V2 launch and packaging guide covers the native engine, browser neural relief and the optional Python modules. The Rust README describes the engine crates. Releases follow the desktop release guide; the web build follows the web publication guide.
rust/crates/terrain/ relief, erosion, hydrology, Underdark
rust/crates/core/ settlements, roads, cities and buildings (re-exports terrain)
rust/crates/local/ native local engine service
rust/crates/neural*/ neural relief: native and browser inference
rust/desktop-v2/ Tauri desktop application
web/src/v2/ V2 application
web/src/render/ shared 2D/3D renderers
docs/ documentation, method notes and the illustrated atlas
Contributing and feedback
Ideas, questions and generated maps are welcome in Discussions. For bugs, open an issue with the version, the share code or recipe, and a screenshot if you can. Read the contribution guide before a pull request.
Magna Urbis is mostly written by AI coding agents (Claude and Codex) under one human architect and reviewer. The Ko-fi devlogs tell how it is built, what broke and what worked.
License and credits
Magna Urbis is free software under the GNU Affero General Public License v3 only (AGPL-3.0-only); see LICENSE. Commercial use is allowed. If you run a modified version as a network service, you must offer its source to its users (section 13).
Third-party code, data, textures and model weights keep their own terms: see the third-party notices, the locked dependency inventory and the retained license texts. Neural relief models derive from Terrain Diffusion (MIT). Thank you to Watabou, Alexander Goslin, and every author of the papers, datasets and libraries this project builds on.
Links
- Magna Urbis V2: magna-urbis.org
- Magna Urbis V1: v1.magna-urbis.org (source)
- How it works? magna-urbis.org/scientific
- Support the project on Ko-fi: ko-fi.com/dunkean. The code stays free with no premium tier; donations help pay for the AI agents that build it.
Explore related projects
Loading…





















