← Back to Hub

Room Separation (TinyKeep Style)

The Concept

Popularized by TinyKeep, this method uses a pseudo-physics approach to generate dungeons that feel both structured and organic.

  1. Spawn: Scatter rooms of various sizes within a circle.
  2. Separate: Use a separation steering behavior (or simple physics) to push overlapping rooms apart.
  3. Select: Choose "Main Rooms" (larger ones) to be the core of the dungeon.
  4. Connect: Use Delaunay Triangulation and a Minimum Spanning Tree (MST) to find the best paths between rooms.
  5. 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;
    }
});