The algorithm starts out by dividing the level into diagonal slices, where each phase selects modes from its possible pools. In addition, it selects corners to spawn the starting room and the boss room. The starting room gets spawned first to give the generation a starting point at the room's corner facing the center.
Next, the algorithm continues generating towards the opposite corner, with the logic for each tile that it places being changed depending on the phase of the current tile. These modes of generation provide unique spatial challenges to the player to keep gameplay varied, but still intentionally designed. The phases for the accompanying picture are as follows:
After this step, the Boss Room gets spawned in the corner opposite to the setup phase. The arena is set up such that the player has enough space to engage the boss as well as ensuring that the path to the boss is traversable. In addition to spawning the space, this step also includes spawning powerups in a hall before the boss room in order to help afford what the room is.
The algorithm does another final sweep over the generated level at this step, ensuring that the following conditions are met: 1) The player is able to navigate to and get inside the boss room, 2) Enough rooms spawn in the level in order for players to explore and engage enemies within them, and 3) Enough tiles spawn in the level in order to meet the engagement type of exploration. If one or more of these conditions are not met, the level regenerates.
In addition, power ups are added to the level in this pass to reward the player's exploration of some of the longer paths (seen by the arrows). In addition, a speed powerup is placed at the start of the first development phase to introduce powerups to the player and acts a hook as well.
Once all of the validation checks pass, the level spawns walls and enemies at appropriate tiles in the various phases. Each mode of generation has different pools of enemies that it’s able to spawn and weighting for how often that enemy spawns. For instance, sniper enemies are highly likely to spawn in the third development phase for modes that have long corridors. This is done since snipers are able to pierce through and destroy walls with their shots, opening up new paths for the player to take. It also helps introduce the wall destruction mechanic the boss and final powerup uses.
The accompanying gif is a visualization of how the dungeon generates. Some of the generations fail due to the factors specified above, but others succeed, shown by the spawning of the boss room and dungeon walls. In all, there are 8 different modes that the dungeon may generate, which vary the most in the development 2 and development 3 phases. This is done to ensure a large level span from the start as well as to keep the beginning phases more friendly for the lower power of enemies found there.
The algorithm successfully generates varied dungeon layouts with distinct phases, providing players with unique spatial challenges and intentional gameplay design. Each phase contributes to a cohesive progression, from guided exploration in the Setup Mode to intense elite combat in Big Room Mode. Validation checks ensure player navigability, engaging exploration, and balanced enemy encounters, creating replayable levels that adapt dynamically to different generation modes. Through this project, I learned how to design systems that balance procedural variation with intentional design, ensuring proper enagement for players.
©2024 All Rights Reserved By Corbyn LaMar