Dungeon Generation


Author: Adam Stagg

When developing the original dungeon generation algorithm, I decided to use the wave function collapse algorithm. This would make every aspect of the dungeons, the floorplans, the corridors, the shapes, the overall feel, all unique and organic. There was an issue with this however. The way that the algorithm would would potentially allows rooms to be in the dungeon with no connections. If this room was to be the spawn room or a quest room, or the boss exit, the dungeon would be incompletable. 



To solve this, I switched the dungeon generation algorithm. Instead of using wave function collapse, it is using a room first generation algorithm with corridor marching. The idea is generate all the rooms, then march a corridor between rooms to ensure at least one connection between rooms. This could lead to square rooms only, however, so there is a functionality called merging to the rooms. Multiple rooms might try to generate on top of each other and they merge to become one room, and will have a new organic shape to them.

The dungeon will be generated in 3 steps now:
Rooms
Corridors
Props and enemies

Leave a comment

Log in with itch.io to leave a comment.