Procedural Level Generation

Overview

This is a WIP editor tool I made to easily string premade rooms together for level generation. The goal is the ability to easily create rooms of any shape and size, then arrange them into a coherent level with working lock and key progression.

Room Anatomy

Rooms have two key types of components that determine where and how they are placed. The first are overlap boxes, which are used to determine intersections between rooms so that they don’t overlap. Multiple box components are preferable to just taking the bounds of the room since bounds don’t conform to irregularly shaped rooms. The seconds are exits, which exist as the connection points between rooms. These determine the offset that a room is placed when being connected to another.

Generation

Rooms are generated in a tree structure. Beginning from a single starting root, a random room type is added to an available exit. If this room overlaps another, a different room is tried. If no room types work, then a different exit is selected.

After all rooms have been placed, doors and keys are placed. The generator checks connectivity after each door placement to ensure players can access the entire level.

The accessibility check is currently work in progress. This was originally meant to work with a small key system (Generalized keys work for any locked door) but it works perfectly well for a big key system (specified keys for doors).