← Back to projects
Dungeons and Danger screenshot

Dungeons and Danger

2024 · Game Programming course · 4-person team

Overview

A 3D infinite dungeon crawler built for a game programming class, with dungeons that generate and expand dynamically as the player explores, rather than conforming to a fixed grid.

The Problem

Most procedural dungeon systems constrain rooms to a grid, which makes both room placement and enemy pathfinding straightforward. Moving away from a grid, to allow rooms of arbitrary shape and orientation, meant losing those built-in guarantees and solving generation and pathfinding from scratch.

Most procedural dungeon systems conform to a grid, which makes room placement and pathfinding straightforward.

The Solution

Rooms are represented as a graph rather than grid cells, with the player's current room as the central node. The system maintains a perimeter of generated rooms around that center and prunes rooms as the player moves away from them, checking new rooms against existing geometry with bounding box collision before placing them.

For enemy navigation, Dijkstra's algorithm runs across the room graph to compute the optimal path to the player, with nav mesh links handling the actual movement between connected rooms.

Result

An infinitely generating 3D dungeon with dynamically loaded rooms and enemies that intelligently pursue the player across the graph. This project's post-process shader work was later split out into its own project: PSX Post Process Shader.

More Projects