Procedurally generate fantasy landscape and settlement maps for tabletop RPGs, with a live preview panel and optional pinned-map export.
An Obsidian plugin that procedurally generates fantasy maps for tabletop RPGs.
From a seed and a few choices, Town Forge builds a complete map — terrain, forests, mountains, roads, and a settlement ranging from a lonely hamlet to a sprawling metropolis — in a polished cartographic style. Drop a town-forge code block into a note, or use the live preview panel to dial everything in, then insert the map as an image, save a PNG, or export it to the TTRPG Tools: Maps plugin as an interactive, pinned map.
```town-forge block; it renders inline and stays reproducible by seed.main.js, manifest.json, and versions.json from the latest release..obsidian/plugins/town-forge/ inside your vault.Click the map ribbon icon (or run Town Forge: open map preview) to open the side panel. Choose a terrain, settlement size, and options; the map regenerates as you change them. From the panel you can:
town-forge code block for the current map.Embed a map in any note. Every field is optional except that a seed makes the map reproducible:
```town-forge
terrain: river
seed: frostkey
mode: full
settlement: city
```
Full list of keys:
| Key | Values | Notes |
|---|---|---|
terrain |
river, coastal, lake, mountain, inland |
|
seed |
any text | Same seed → same map |
name |
any text | Title shown on the map |
mode |
full, landscape |
full places a settlement; landscape is terrain only |
settlement |
hamlet … metropolis |
Settlement size (full mode) |
size |
pixel size | Output image size override |
scale |
number | Real-world distance the map width represents |
unit |
text | Scale-bar unit (e.g. miles, km) |
edges |
N, E, S, W (any combination) |
Which sides have approach roads |
farms |
0–2 |
Farm density multiplier |
forest |
0–2 |
Forest density multiplier |
seaside |
N/E/S/W |
Sea direction (coastal) |
mtnedges |
N, E, S, W |
Sides a mountain range enters from |
mtnsize / peaks |
0–12 |
Mountain extent |
roughness, octaves |
numbers | Terrain noise tuning |
walls, castle, temple, market, barracks, tower |
on / off |
Force a landmark on or off |
Town Forge can hand a finished map to the TTRPG Tools: Maps community plugin (formerly Zoom Map) as an interactive, pinned map. This is off by default — turn it on in Settings → Town Forge → Enable TTRPG Tools: Maps export.
When enabled, Export to TTRPG Tools: Maps creates, inside your configured export folder:
<Town>/<Town>.png — the map image<Town>/<Town>.png.markers.json — the pin sidecar the maps plugin reads<Town>/<Town>.md — a note with a zoommap code block that renders the mapEach pin type controls a category of marker: what building it anchors to (or whether it scatters across houses), how many appear, how they're named, the note type and template they use, the icon, and the map layer. You can edit pin types in settings, add your own, or edit them all as JSON.
Names come from either built-in word lists or a custom JS hook. A hook can return a plain string (the name), or { name, subtype } to set both — useful for keeping a place's name and its kind in sync. Hooks have app, api, seed, town, type, index, and subtypes in scope.
When a place is pinned, Town Forge looks for a template note named after the place's note type (e.g. Shop.md) in your template folder and copies it as the place's note, filling {{name}}, {{type}}, {{subtype}}, and {{town}}. Any Randomness or Templater syntax in the template is left intact and resolves when the note is opened. If no template exists for a type, a simple default note is written.
For a full walkthrough of wiring up rich, self-rolling place notes with Randomness and Templater — including ready-made settlement tables — see docs/randomness-templater-setup.md.
Icons: TTRPG Tools: Maps renders icons from a user-configured library. Town Forge writes the icon key you set per pin type, but a key only renders if it exists in your maps-plugin icon library. The defaults use stock keys; customise per type once you've imported the icons you want.
Both are optional. Town Forge generates and renders maps on its own; these extend what you can do with the exported places.
npm install # one-time setup
npm run build # typecheck + bundle to main.js
npm run dev # watch build
The renderer draws to a standard DOM canvas, so the plugin runs on both desktop and mobile.
MIT — see LICENSE.
Map rendering, terrain, and settlement generation are original to this plugin. Exported maps are intended for use with the TTRPG Tools: Maps plugin; that plugin and Randomness are separate works by their respective authors.