majidmanzarpour GitHub avatar

threejs-procedural-dungeon

majidmanzarpour

A deterministic procedural dungeon generator that visualizes its entire generation pipeline step by step, producing fully connected, themed dungeons from a single seed.

Stars

471

7-day growth

No data

Forks

78

Open issues

0

License

MIT

Last updated

2026-07-05

AI repository intelligence
FR-AI / ANALYSIS

Why it is worth attention

It combines a real-time animated pipeline, graph-based layout with room semantics, five hand-tuned themes, fully procedural assets, and a polished Three.js renderer with custom post-processing — all in a single, self-contained module.

Who it is for

  • Game developers prototyping dungeon layouts
  • Procedural generation enthusiasts and students
  • Three.js / WebGL developers seeking a reference implementation
  • Roguelike and dungeon-crawler designers

Use cases

  • Rapidly generate varied, reproducible dungeon maps for game projects
  • Learn and teach procedural generation algorithms through live visualization
  • Create unique, shareable dungeons for speedrun or challenge runs
  • Serve as a foundation for custom procedural level generators

Strengths

  • Fully deterministic: same seed always yields the exact same dungeon
  • Live visual breakdown of every generation stage (scatter → separate → Delaunay → MST → carve → decorate)
  • All geometry, textures, and post-processing are generated procedurally — no external assets
  • InstancedMesh rendering and custom bloom/tilt-shift post-processing maintain high performance at scale

Considerations

  • Single monolithic codebase (main.js) may be difficult to extend or reuse
  • Only five built-in themes and a fixed generation algorithm — no user-defined rules
  • Requires a modern WebGL-capable browser; development needs Node 18+

README quick start

🏰 Dungeon Forge

Play the live demo · by @majidmanzarpour

A deterministic procedural dungeon generator you can watch build itself, room by room. Rooms are scattered and shoved apart, triangulated, wired into a corridor graph, carved into a tile grid, and dressed with theme-specific props, liquids, lights, and particles — every stage seeded from a single number, so any seed rebuilds the exact same dungeon. Rendered live with Three.js.

Type a seed, pick a theme, drag the sliders, and watch the pipeline light up stage by stage. Every forge is reproducible and every dungeon is guaranteed fully connected.


✨ Features

  • One seed, one dungeon. A single mulberry32 stream is threaded through every stage — scatter, separation, triangulation, room roles, carving, decoration. The same seed always yields the same map, down to the last torch. Change one digit and get an entirely new floor.
  • A real generation pipeline, visualized. Watch it run: scatter → separate → Delaunay → MST + loops → semantics → carve → rasterize + BFS → decorate. Each step lights up in the HUD as it happens, and you can scrub the whole build animation or skip it.
  • Graph-based layouts. Rooms are Delaunay-triangulated, reduced to a minimum spanning tree for guaranteed connectivity, then selectively re-looped so the dungeon has shortcuts and cycles instead of a boring spanning-tree spider.
  • Room semantics. A BFS from the entrance assigns depth and difficulty, then tags rooms as entrance, combat, elite, treasure, shrine, or boss based on where they sit on the critical path — so the layout reads like a real level, not just connected boxes.
  • Five hand-tuned themes (plus AUTO, which picks one from the seed): Ancient, Molten, Frost, Grim, Verdant. Each swaps the palette, lighting rig, liquids (lava / water / miasma), props, particle system (embers / snow / spores / wisps), and torch color.
  • Procedural everything. Stone, cracks, runes, portals, and light shafts are all generated to canvas textures at load; geometry is built from primitives; nothing is loaded from disk.
  • Instanced rendering. Thousands of floor tiles, walls, props, and decorations are drawn with InstancedMesh, so an 80-room dung

Description

Real-time procedural dungeon generator in Three.js - deterministic seeds, Delaunay/MST graph layouts, room semantics, five themes, and a custom bloom/tilt-shift pipeline.

Related repositories

Similar projects matched by category, topics, and programming language.

react
Featured
react GitHub avatar

react

React is a JavaScript library for building user interfaces with declarative, component-based, and cross-platform design.

Web DevelopmentFrontend Frameworks
246,741
tandpfun
Featured
tandpfun GitHub avatar

wardrobe

A GPT‑image powered app that extracts individual garment cutouts from photos, organizes them into a digital wardrobe, and generates modeled outfit previews.

JavaScript
1,570
mshumer
Featured
mshumer GitHub avatar

Claude-of-Duty

A browser-based first-person shooter built entirely with procedural generation and orchestrated AI agents, featuring 55k lines of Three.js/WebGL2 code and no art assets.

AI & Machine LearningAI Agents
1,234