majidmanzarpour GitHub avatar

threejs-procedural-dungeon

majidmanzarpour

一个确定性程序化地牢生成器,可逐步可视化其整个生成流程,从单一种子生成完全连通且具有主题的地牢。

Stars

471

7 天增长

暂无数据

Fork 数

78

开放 Issue

0

开源协议

MIT

最近更新

2026-07-05

AI 仓库情报摘要
FR-AI / ANALYSIS

为什么值得关注

它结合了实时动画式生成管线、基于图结构的房间语义布局、五种精调主题、全程序化资产以及定制后期处理的Three.js渲染,全部集成在一个自包含模块中。

适合谁使用

  • 需要快速生成地牢原型的游戏开发者
  • 程序化生成爱好者及学习者
  • 希望参考实现的Three.js/WebGL开发者
  • Roguelike和地牢探险游戏设计师

典型使用场景

  • 为游戏项目快速生成多样且可复现的地牢地图
  • 通过实时可视化学习和教授程序化生成算法
  • 创建独特且可分享的地牢用于速通或挑战
  • 作为定制程序化关卡生成器的基础

项目优势

  • 完全确定性:相同种子必定生成完全相同的地牢
  • 每一步生成阶段(散布→分离→Delaunay→最小生成树→雕刻→装饰)均可实时可视化
  • 所有几何体、纹理和后期处理均为程序化生成,无需外部资源
  • 使用InstancedMesh渲染和自定义泛光/移轴后期处理,在较大规模下保持高性能

使用前须知

  • 单一大型代码文件(main.js)难以扩展或复用
  • 仅内置五种主题和固定生成算法,不支持用户自定义规则
  • 需要支持WebGL的现代浏览器;开发环境要求Node 18+

README 快速开始

🏰 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

项目描述

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.

相关仓库与替代方案

根据分类、Topic 和编程语言匹配的相似项目。

react
精选
react GitHub avatar

react

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

Web 开发前端框架
246,741
tandpfun
精选
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
精选
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 与机器学习AI 智能体
1,234