The Concept
Popularized by TinyKeep, this method uses a pseudo-physics approach to generate dungeons that feel both structured and organic.
- Spawn: Scatter rooms of various sizes within a circle.
- Separate: Use a separation steering behavior (or simple physics) to push overlapping rooms apart.
- Select: Choose "Main Rooms" (larger ones) to be the core of the dungeon.
- Connect: Use Delaunay Triangulation and a Minimum Spanning Tree (MST) to find the best paths between rooms.
- Corridors: Create L-shaped corridors between the connected rooms.
Step: Initial Spawning
Rooms are randomly placed within a circle.
Separation Logic
// Simple separation vector
rooms.forEach(other => {
if (this === other) return;
let dx = this.x - other.x;
let dy = this.y - other.y;
let dist = Math.sqrt(dx*dx + dy*dy);
if (dist < minDistance) {
forceX += dx / dist;
forceY += dy / dist;
}
});