If I could write the rules of DMing, chief among them would be ‘never point your PCs at something you don’t wish destroyed.’
For example, if you’re using the trope of the bad-guy-beat-down – where a major villain drops in on the party while they’re still at low level for a bit of violent sneering – you should always be prepared for the heroes pulling out an unexpected win.
Even if the maths says this is near impossible, perhaps they’ll be blessed by the dice gods and roll nothing but 20s while you struggle to break a 5. Perhaps the Wizard will remember that Wand of Polymorph you rolled up on a random loot table last month and turn your epic encounter into a discussion about how to deal with an evil koala.
What you don’t want to do in these situations is panic and fall back on DM fiat to fix everything and undo the party’s achievements. There’s nothing worse than realising that nothing you do as a player matters, because the DM is determined to get their personal story back on track.
This doesn’t mean you have to simply roll over and shred your stack of campaign notes, of course. Maybe the villain the party just killed was actually a favoured lieutenant of the actual bad guy, and rather then unravelling their foes’ plans entirely they just dealt them a major blow. Or perhaps the party is surprised to find a troop of evil reinforcements coming round the corner as they debate sticking the evil koala in a Bag of Holding – they still get captured, but they’ve humiliated their foe in front of his men.
There are many ways to have players unexpectedly shift the tone of your campaign, and though you can guard against some of them a party of inventive PCs will always seem to find a way to make their madcap plans work. If you surround the corrupt king with guards, they will drop point-bank fireballs. If you have the crime lord curse at them from the deck of a departing galleon, they will grow wings and chase him down.
A friend found this out the hard way in a recent campaign. The party came across a huge frow-built amphitheatre occupied by an orcish army, whose charismatic leader was addressing his horde. With literally thousands of foes waiting to deal with any interlopers, the villain could safely dispense some exposition and show in person what a vile monster he was.
Except that the party’s wizard had recently learned Arcane Gate, which creates a pair of linked portals up to 500 ft. apart. And the stage was 400 ft. away from their hiding place.
To cut a long story short, a well-equipped party can deal a hell of a lot of single-round damage if they have the drop on their foe and are willing to burn every resource to hand. The warlord was reduced to a smear on the ground before he even got to act.
Best of all, the DM managed to play along with it all, even as his plans crumbled into so much dust. The warlord was dead and the orcs immediately began fighting among themselves, completely derailing their plans to conquer and pillage.
D&D is a game of choices and consequences, and part of the fun comes from the fact that both of those can be so very unpredictable. If there’s a part of your campaign you want to remain exactly how you planned it, it’s best to keep players as far away from it as possible.
Even then, remember that Teleport is a thing…