Exploring dungeons is a long time staple of tabletop role-playing. Naturally, it's been a staple of D&D for decades as well. However, coming up with dungeons is a bit of an art. There are so many elements to consider in designing a good one. On top of that, sometimes things go off the rails. What do you do if your players jump into catacombs before you had expected? The first thing that comes to mind is to just make things up as we go along. However, due to the complexity of the situation, this is easier said than done. It is for this reason I hope to give my advice on the matter.
Word of Caution
What we are talking about here isn't an easy thing. The difficulty also increases the larger a dungeon that we create. Typically if you are in this situation, it's because things went off the rails. I'd say that 9/10 times, having the dungeon prepared a head of time leads to better results unless the Dungeon Master in question really knows what they are doing.
A Bit of Cheating
I'd be very hesitant making up every element of a dungeon on the fly. However, we don't have to. There are a myriad of techniques at our disposal to make things easier. This means that a large portion of the work will be done on the spot but many elements will be taken ahead of time. Sometimes a bit of cheating like this is required. One of the most effective cheats I've found is the use of dungeon tiles or 3D printed terrain. Being able to grab pieces and put them together on the fly like makes it far easier than coming up with every bit of the area. Sometimes restrictions are a good thing for creativity, and I'd argue that when doing things in a crunch like we are in this situation, they are beneficial.
I'd also recommend some pre-made room designs for common uses. Bedrooms, hallways, halls, and chapels are some very commonly used elements that can easily be reused or combined. As you go through more campaigns and gain more experience as a Dungeon Master, you also naturally build a backlog of these things. Previous maps can be a great source for old parts that can be changed for new uses. This can be done both by changing the structural features (adding columns, increasing the room size, adding balconies) or by rearranging the furnishing inside.
If I start making things up on the spot with no foundation I find myself in a kind of paralysis. Depending on how inspired I am, it can last a few moments or minutes. However, I don't want to be stuck for minutes trying to think of things when running a campaign. To make matters worse, this kind of paralysis can return later in the session when I've exhausted my previous inspiration. The thing that works best for me in these situations it to ensure I have a place to draw from. It can be a goal to work towards, a concept for an area, a fragment of a story I want to tell, or a bunch of other things.
Themes and Ideas
I mentioned how I like a starting point to work from. I've also written before about how I value themes for campaigns, and locations/dungeons are no different. When coming up with a dungeon on the spot, this is typically the hardest part for me. I want a good theme or idea to work from. Otherwise I'll get into trouble later. This is why I make myself a list just in case. That way I have a list of ideas I feel are strong enough to make things up on the spot. I typically aim for 3-5 of these on reserve at a time and sometimes I'll think of a new list as an exercise. As an example, here was my list from my last session:
- A dungeon where all of the traps have decayed into basically being useless and all of the real dangerous are coincidences caused by decay.
- A dungeon made by the followers of an insane god/demon. Probably includes many dead ends and insane things like a table attached to the ceiling.
- A dungeon heavily looted previously, but not completely. The best loot is still waiting to be discovered, though in the best hidden places.
- A castle that was the sight of a massive battle, resulting in the deaths of everyone when the wizard of the castle decided to take everyone with them. When entering parts of the battle are relived.
- An ancient dungeon expanded upon and expanded upon again over a thousand years of use.
Points of Interest
I tend to feel that every dungeon needs to have at least one point of interest. It'll be that one element that is remembered later. It could be related to a character. It could be related to an incredibly inventive trap. It could be related to the location, or what the whole dungeon implies. I also found that entire rooms work the best. This way the whole point of interest can be easily encapsulated for drop in use. I aim for between 1-3, depending on the size of the dungeon. It's an easy way to add that special element to a dungeon when being put on the spot. It also gives flexibility. If you have a moment of inspiration for a point of interest that is even better than your fall back list, you've won. If you need to use your fallback list, you are still adding something special to the dungeon. It also gives you a minimum level to fall back on for the dungeon, just in case the inspiration doesn't hit. The rest of it can be more easily thought up on the spot, though of course it will still be challenging.
Random Generation Tools
There are different tools we can use to generate dungeons randomly. From the classic use of tables to generate them (see the end of the Dungeon Master's Guide), to online software, to randomly picking up tiles, there are many ways to get the basic outline of a dungeon. In general I would recommend doing this ahead of time and tweaking things in order to refine it into a better product. When doing it off the cuff, we don't have that luxury. In this case, I find looking at the situation and choosing based on what I think best fits is my first choice. After that, that's when I go to the random options in order to not waste time and hopefully get me to the next stage where I'll have my inspiration. Even so, I'll overrule or adjust things as I see fit to fit my theme or concept from above. This is why I find having a theme or concept is so important for me. It gives me a good place to modify and create from instead of just making everything up. The upside for me is less paralysis and that it seems more consistent.