Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

I think you should try and set up a simple way of testing a few methods of building maps and then viewing or playing through them. I've never released a procedurally generated dungeon game, but I've played around with making a few generators (I love old-school roguelikes).

Depending on the scale of the game, you might want more than one way of generating dungeons and also try to see if you can mix them, like doing one pass with "hooks" that the second pass (a different method) can use, or having "refinement methods" after doing an initial generation.

I know that there are tons of ways of generating dungeons, but I think they mostly come down to a set of functions with rules, refinement methods and a potential fail state, like if not enough rooms are generated; discard and try again (though once again; I haven't made a full game like this, so I could be wrong).

I'm not sure if this is helpful at all, but I made a quick animation to help describe one of the methods I've tried, which is terribly simple, but might help with some ideas?

This method starts with plotting a "room". Each room has a minimum and maximum size, with red pixels representing "open positions". Each time a room is successfully built, it is added to the room counter.
The map is scanned to find "open positions", then selects one randomly.
A path will be made. Paths have a minimum and maximum travel distance, as well as a minimum for when they can turn.
While the path travels, it will place down "open positions" on its sides (keeping a minimum spacing variable in mind) and end with an open position.
A path can intersect with another path or room, but only if it hits on a 90 degree angle, avoiding making paths and doorways over a pixel wide.
From here, we go back to scanning for open positions, but will also attempt to build rooms (if there is enough space). Loop until a condition is met.
A clean up occurs. This locates the ends of paths, then erases them until they hit a connected path or room, leaving a single open position where the last cleaned tile was erased.
Repeat the "find open position and build room or path"-step, with a clean afterwards, keeping a minimum and maximum amount for these steps to loop.
Check if the generation has made at least the minimum amount of rooms... I think I set it as 5 when I was actually playing around with my last demo... You want a number that is at least interesting, but small enough that the generator will succeed most of the time.

Though this is really simple, I think it's enough to start building a dungeon. After this, you can use it to build the fun details. In my quick animation, I then placed walls around the paths and filled open positions with wall tiles, then selected a room as the starting position, marking the room and connected paths as "1", then selecting a connected room as "2"... unfortunately all the path tiles were connected to room 1 (whoops), but I would of repeated. The idea is that you will have a logical ordering of rooms, as long as a room "6" (for example) is not blocking room "5", you can now place keys for rooms on any tile lower than the required door.

Maybe this could also be used to logically place monster and loot with higher levels.

Sorry for the rant there... I'm probably not telling you anything new, but maybe it helps with some ideas or someone else who is thinking about building some dungeons (but wants a simple place to start) might see this.

best of luck.