
Donjon Regen — an offline renderer + editor for donjon.bin.sh's dungeon JSON exports
[System Agnostic]
donjon.bin.sh's 5e dungeon generator is great, but once you generate and export the JSON you're locked to the map and have no way of editing it or re-viewing it. So I had AI reverse-engineered the export format and built a tool that re-renders everything locally and offline, and then lets you edit the result.
What it does:
Reads donjon's exported JSON and re-renders the GM map, player map, a clickable HTML doc, and TSV/CSV — all offline.
Maps are drawn procedurally with Pillow: rooms, corridors, polygon/circle rooms, stairs, and the full door set (arch / door / locked / trapped / secret / portcullis). Door and stair glyphs are generated as pure integer pixel art at the target cell size; no resampling, so lines stay crisp at any scale.
A desktop GUI turns it into an editor: paint corridors (with auto-door placement), create / delete / reshape / resize rooms, resize the canvas, mirror rooms, and edit room contents/monsters/treasure/doors.
The procedural-gen-relevant bits were the fun part: donjon packs everything into a 2D array of integer bitmasks (block / room / corridor / wall / aperture / room-ID / door-type / stair / label-char bits), with a symmetric padding offset between the cells array and the map coordinate space. I documented the whole encoding in the repo since I couldn't find it written down anywhere.
Repo: https://github.com/DawnGuardian/Donjon-Regen
Release: https://github.com/DawnGuardian/Donjon-Regen/releases/tag/v1.0.0
Happy to answer anything about the bitmask format or the rendering pipeline. (Full disclosure: the code was written with AI assistance but the tool's output is fully deterministic, no AI-generated content.)