In my previous post, stage 1 of creating a RPG was “A Dungeon level generator. Create rooms and link them by corridors.“. Being quite retentive, I dug out my source code from the Quest dungeon generator. It was written in Turbo Pascal back in 1989-1990 and is about 1200 lines long.
The principle was slap down a few random sized rooms (both rectangular and circular in the original) then draw corridors from fixed points in the rooms with up to eight points in a room. Something like the map shown from Paratime Design.
You can go to town in the number of ways of generating a dungeon. When I was 16 i once spent a couple of weeks of my summer off-school time drawing a dungeon on an A2 piece of paper. It had something like 2000 rooms which is quite insane. I wished I’d kept it now; my magnum opus!
Another way I’d considered is draw a grid on the area. My original dungeon area was 150 x 150 points in size. Mind you Turbo Pascal was 16-bit software and no data structure could be bigger than 65536 bytes so the limit would have been 256 x 256. If you draw a grid say at 8 x 8 intervals then when you put a rectangular room down the intersection with the grid provides door points. My original rooms were either small (6-18) or large (10-40) points.
Once the rooms were in place, corridors were drawn until all rooms were linkable. Corridors were drawn out from a door point until they hit another corridor or door point. By building up a list of rooms connected to other rooms, and removing duplicate corridors (rooms directly linked to another room more than once), a minimum dungeon level was built.
After that traps, treasures and monsters were added and an entry point in and out of each level to the one above or below. If you are feeling fancy then you can add a special room or two on each level such as temples, arenas and such like.
If you are short of imagination you could buy the D&D Dungeon Master’s Guide 5th Edition. Appendix A has a very comprehensive guide to creating a random dungeon and stocking it with traps, obstacles, furnishings and monsters.