-
Notifications
You must be signed in to change notification settings - Fork 8
Procedural level generator
Procedurally generates fully-playable liminal spaces with customisable size, rooms and monsters
Completely unique every time the "Generate" button is clicked...
- Click the PLAY button to play instantly
or
- Edit the map as you like (add/remove entities and brushes)
The generator uses a grid‑based room placement algorithm:
-
Divide the world into cells of size 64×64 units.
-
Randomly place rectangular rooms of varying sizes.
-
Connect rooms using A* pathfinding with optional waypoints and dead‑ends.
-
Build geometry brushes (walls, floors, ceilings, corner pillars) with nodraw optimisation.
-
Populate the map with:
-
Ambient lights in each room.
-
Player start point.
-
Exit portal (level changer) - (currently broken)
-
Optional monsters (flying or humanoid).
-
Optional health pickups (placed away from monsters).
-
Basic example:
python tools/procedural_map_gen.py -o my_map.json --size large --room-count 18All options:
usage: procedural_map_gen.py -o OUTPUT [options]
Required:
-o OUTPUT, --output OUTPUT Output JSON file
Map size:
--size {small,medium,large} Preset (default: medium)
--width WIDTH Custom width (ignored if --size used)
--height HEIGHT Custom height
Room generation:
--room-count N Target rooms (8-24, default: 14)
--min-room N Min room size in units (default: 256)
--max-room N Max room size in units (default: 384)
Textures:
--wall-tex NAME Wall texture file (default: default.png)
--floor-tex NAME Floor texture file (default: default.png)
Monsters:
--spawn-monsters Enable monsters (default: on)
--no-spawn-monsters Disable monsters
--monster-count N Number of monsters (default: 4)
Health pickups:
--spawn-health Enable health (default: on)
--no-spawn-health Disable health
--health-count N Number of health items (default: 6)
Random seed:
--seed N Fixed seed for reproducible maps
Full example with custom size and fixed seed:
python tools/procedural_map_gen.py -o map_seed123.json \
--width 4096 --height 4096 \
--room-count 20 \
--min-room 320 --max-room 512 \
--monster-count 8 \
--health-count 10 \
--seed 123Information on the structure of map files is available on the map format page