Rogue Exile(Procedural 2D Grid Dungeon Generator)
This project focuses on the development of a procedural dungeon generator designed to create levels that exhibit both artificial and naturalistic characteristics, while maintaining a clear gameplay-oriented structure. The generated environments ensure a coherent and logical progression to the next level, with balanced distribution of enemies and loot, and non-intersecting pathways. The generation process is driven by noise-based random number generation, ensuring full determinism and reproducibility of each dungeon configuration.
Procedural generation is a powerful technique in game development for enabling infinite replayability by algorithmically producing vast and varied level configurations. A primary challenge lies in ensuring that generated content is not only structurally diverse but also meaningful and functional from a gameplay perspective. This thesis presents a procedural dungeon generator designed to produce levels that are both visually and functionally distinct, while adhering to clear gameplay objectives. The resulting dungeon is spatially well-distributed across the map, features a path to the next level of reasonable length, and includes balanced placement of monsters and chests along the player’s traversal route.
GitHub Link: https://github.com/student-danielhe/RogueExile
Binary Space Partition:
A primary technical challenge involved ensuring even spatial distribution of dungeon chambers throughout the map while maintaining connectivity. To address this, I implemented Binary Space Partitioning (BSP), which recursively subdivided the map into discrete sections. Subsequent chambers were interconnected using a tunneling algorithm. Remaining unallocated spaces were classified as secondary pathways and subsequently linked to the nearest primary corridor network. Once the dungeon layout was finalized, rendering rooms as rectangular chambers and narrow corridors as connecting passages one would expect from early Roguelike games.
Cellular Automata:
Cellular automata with the ruleset B678/S345678 enabled consistent generation of cave-like structures; however, ensuring connectivity and even spatial distribution presented a significant constraint. Rather than employing random noise map initialization, the approach required maintaining the dungeon layout's integrity. Initial attempts to increase tile permeability near pathways resulted in excessively narrow, linear cave formations. To address this, the algorithm was modified to avoid spaces between pathways, thereby preventing unintended intersections while preserving the intended spatial distribution. The algorithm creates a path finding agent that avoids imaginary obstacles generated with Perlin noise in order to make the longer pathways looks more natural.


Gameplay Object
Procedural placement of gameplay objects, including monsters and chests, was accomplished through a customizable bias variable system that computed spawn probability at designated locations. The algorithm generated heatmaps for primary pathways, secondary pathways, and existing gameplay objects. Heatmap values were multiplied by their corresponding bias coefficients, aggregated, and stored in a weighted probability distribution. For instance, a monster configured with bias values of primary path: 1, secondary path: 0.5, monster: -1, and chest: 1 would exhibit increased spawn likelihood near primary pathways, reduced likelihood near secondary pathways, avoidance of nearby enemies, and increased likelihood adjacent to chests.
AutoTiler
The auto-tiling system performed multiple functions: segregating walls from ceilings, generating edges for both wall and ceiling elements, and blending grass transitions with ground terrain. The sprite sheet was decomposed into four-corner tile variants, with each corner mapped using bitflags to correspond to wall presence in adjacent grid cells. Wall heights were recorded at each cell and compared against horizontally adjacent cells; edges of lower-height elements were occluded to establish visual depth perception.
Biome Presets
A preset system was implemented to accommodate various biome and dungeon size configurations. Each biome preset contained associated tileset assets (walls, ground, and grass), a decoration inventory, and a room generation methodology. Natural biomes utilized cellular automata for organic room generation, while artificial biomes employed rectangular room layouts. Size presets encapsulated dungeon dimensional parameters, target room count, primary pathway traversal specifications, and gameplay object and decoration spawn thresholds.
Decorations
Many decorative elements possessed collision geometry only on their bottom grid cell, necessitating a three-layer rendering pipeline: background, characters, and foreground tiles. To prevent decorations from obstructing pathways, an adjacency-based validation system was implemented. The algorithm evaluated the status of all adjacent cells and generated a heatmap. Heat propagation was initiated from the first empty cell; if the algorithm successfully reached any secondary empty cell, the decoration placement was rejected as a potential pathway obstruction.



Gameplay
The procedural generation thesis was applied to develop a roguelike game submission for the 7 Day Roguelike challenge. A procedural equipment generation system, modeled after Diablo's approach, was implemented to dynamically create equipment instances. All enemy entities spawned with randomly assigned equipment loadouts, while treasure chests contained randomized spell inventories. As players progressed to deeper dungeon levels, both enemy difficulty scaling and equipment power levels increased proportionally, creating a coherent progression system.

