Hello, Everyone
I am working on a random dungeon genrator that can spit out unique levels for a gauntlet style game. The question releates to the approach that is most appropriate for this style of game.
The first approach I seem to see a lot of involves taking a 2D grid and laying out a map on that 2D grid with both start and end points. The after the start and end points have been defined we travese and build the dungeon using a depth first algorithm for its creation. The down side to this method seems to be the lack of unique rooms that get built for the players to explore, although the paths work well.
The second approach I have read about involves takeing a prefabed room with a few pre built exits. And building off from each exit in the same manner. What confuses me with this method is how rooms are placed in the grid of Dungeon Cells and how to build off these pre built rooms.
Any help would be greatly appreciated. Thanks everyone.
A third alternative is to build rooms based on tile sets. So your first room is built with set 1, it has stone walls floors and random objects are strewn about the floor. The walls are similar. Lets say the room covers 10x10 and each floor unit is 2x2. We create a bound for this room. (very important for checking later) Then we want to build a door, We remove a 2x2 wall section and add a door based on the tile set. This opens to room 2.
Room 2 is a generic room, from tile set 2 and is a maximum of 30x30.
Method 1: We now test a 30x30 centered block against all the bounds of all the rooms. All we have to do is subtract the overlap and get a nice square where our room should be.
Method 2: We run a fill routine that fills the block avoiding other rooms by 2 units so that we can have walls.
This makes for an interesting room creation method, can still force pathing and progression, and because you are using different tile sets can be fairly dynamic in setup.