# Risk of a TPK vs realistic NPCs

I am a novice DM running a game for an even more novice group of players and I beginning to think that my next session may result in a TPK (total party kill, for the uninitiated). Is this something I should try and avoid by giving the PCs some unlikely strokes of luck or just roll with and see if they can work a way out of?

In the previous session the players (a party of 5 at level 2) entered the underground hideout of an evil wizard. They had interrogated one of his henchmen before arriving and had forced them to make a rough map of the base. Given this information they decided to make a beeline straight for the wizard. Unfortunately, they were spotted by his familiar, and with the party spending time searching his lab, the wizard had time to escape through a secret door in his room. When they finally entered his room I dropped some heavy hints that he'd just been there - a quill dripping ink on loose parchment and a cup of tea still steaming. Given this, they quickly found the secret door and gave chase, but at the first fork they found no obvious sign of his path and instead they decided to head back and plunder his room for any shiny things they could add to the pile. The party has continued onward slowly, searching every room they come to and taking the general attitude that they'll track down the wizard later. This would have presumably given the wizard a lot of time to do whatever he wanted.

In my mind the evil wizard was at first intending to escape, but quickly discovered that his men are still alive elsewhere in the base, chastising them for letting the adventurers slip by he decided to assemble a posse to ambush the party. I also decided that the evil wizard would have grabbed the scroll of fireball from his room before leaving. Now with the scroll and a group of 8 henchmen (including 3 bugbears), if I were the wizard I'd set up an ambush - close off all exits except one and funnel the party into a massacre. With other enemies I would often assume they were too stupid to come up with a good plan, but this kind of overwhelming trap gels with the particular NPC.

My question is, is this too brutal? Should I just wait and see how it plays out? Should I contrive some divine stroke of luck to save the party if it looks dire? I could probably come up with a narrative reason for the wizard to capture them as opposed to killing them outright, I suppose. Maybe this would serve as a good lesson in taking on enemies more tactically? What are the pros and cons of taking a hardcore "this is what would realistically happen" approach?

There's no "right" answer, there are major playstyles that hit the two extremes and then there's compromises in the middle. The ENWorld post Combat as Sport vs Combat As War illustrates two different end state playstyles - in "combat as sport" the GM never makes "level inappropriate" encounters (no matter how hard you have to twist logic to get there), with each combat being specifically a "fair" setpiece, and in "combat as war" whatever happens happens, whether that means the PCs win without even fighting by poisoning the enemies' water supply or whether it's a TPK because they're dunderheads.

Now, these are two extremes which usually people don't do a pure version of. 4e tended toward Combat as Sport and earlier versions tended toward Combat as War. Given D&D 5e's inheritance of all those playstyles, I think you should think about where you want to fall on that spectrum and then be consistent, and communicate to your players what your approach is so they have aligned expectations.

Most people I have gamed with would let the chips fall where they may, but would make sure and telegraph that it's coming. See How can DMs effectively telegraph specific dangers in D&D? for a question entirely about that. In this case I personally would have them come across various other "hastily abandoned" rooms, maybe run across a messenger or group sending or responding to the "everyone gather up in the main hall to kill intruders!" summons, etc. I often find that doubling down on in-game reality helps - all the bad guys don't just immediately know the wizard wants them and teleport to his side, right, there's a fair amount of alarm generation, people running to and fro, etc. to make it happen. Heck, there's probably one or two folks who are aware of but don't respond to the summons (are sick, or cowardly, or just don't like the wizard that much) that the PCs could find and interrogate. The wizard may have powerful allies he doesn't exactly trust to fight in the same room as him (evil folks are always out to advance themselves with a dagger in the back of their boss) so maybe he deliberately sends some out on a reconnaissance in force. All these can be ways for the PCs to learn that an ambush of overwhelming force might await them. The solution to that, however, is their problem. Smart tactics? Wait them out? Cloudkill scroll? Heavy buffing including fire resistance? There's a lot of options for smart players.

But if they ignore all that and eschew intel gathering to go with a "LEEEEEEEROY JENKINS!!!!" approach then it's OK to kill all the PCs to make their players smarter. As others have noted, you could also opt to capture them or "leave one alive to spread the word of your infamy" but in my experience players hate these as much as just getting wiped out, so I'm not sure if there's value there - depends on how epic of a campaign you're running and how much work you're losing with a new set of PCs. They're only level 2, so it's on the low investment side, once they've been playing a while they'll have had a lot of characters die. The first time needs more hugs but it's going to happen, may as well happen now.

Keep in mind that ambush doesn't have to be the NPC's reaction, it could be escape or something else, depending on their motivations. So don't feel forced into that as a decision, but if you want to make that decision it's a legitimate one.

• The combat as sport vs combat as war is an awesome article. I am glad you linked it. I have used that analogy for a while now because of this article. – Aviose Nov 30 '15 at 16:19
• +1, also, for giving players the information they need to draw smart conclusions. It's a major pet peeve for me as a player when I'm told "there's a guard" and nothing else and I, the player, assume too much. It's fixable at both ends of the table, but it's a big relief when the DM is more descriptive than "here's a guy, and there's a guy here, and you see a big guy here" – Premier Bromanov Nov 30 '15 at 21:54
• Thank you, this was a great answer. With some extra foreshadowing they ended up defeating the ambush. They encountered a guard who revealed that the wizard had been using a scroll of fireball as a threat of fiery death for insubordination. The wizard also gave them a chance to surrender, leaving the base weaponless with their hands in the air. The players ended up giving a potion of invisibility and a small arsenal of weapons to the rogue. Who sneaked up, pick-pocketed the wizard and replaced the scroll of fireball with a scroll of augury whilst the others were parleying. – Dovetailed Dec 1 '15 at 13:04
• The rogue palmed off the scroll to the party's own wizard as a huge fight kicked off and dropped the party's weapons all over the floor. The evil wizard wasted an action reaching for his scroll of fireball only to discover it was illegible to him. A fighter in the party got utterly squished by the bugbears. The party's wizard pretty much exploded everything with fireball upon successfully rolling the DC check, leaving only 2 bugbears and the evil wizard standing. After a turn of mostly picking up weapons and the cleric being KOed the party wizard finished everything that was left with sleep. – Dovetailed Dec 1 '15 at 13:15
• @Dovetailed And now that fight will likely be remembered forever. Glad it turned out the way it did. That sounds pretty epic. – Aviose Dec 7 '15 at 15:11

The Wizard doesn't know how dangerous those adventurers are. There is no implicit "I will only face people who I am able to defeat, yet find challenging" agreement the wizard can rely upon. In a typical D&D world, there is a huge power range, and it isn't easy to tell if a given bunch of people are weak or strong.

All she knows is that her base was invaded and her guards were bypassed. They have proven more competent than her guards already.

An intelligent actor will arrange for layered defences. The outer defences attempt to alert himself of the danger, and in the event of danger escape becomes the priority. If the outer defences defeat the danger, then escape isn't required; if the outer defences are penetrated, victory is less important than escape.

The outer defences can also be designed to diagnose how dangerous foes are. The easiest (and most reliable) way to measure this is to try to defeat them; other measures (in a military example, scouting their army and determining its size and composition, for example) can be used. These are less reliable, and should be less trusted.

Presuming her goal is not victory, but rather not-defeat, the wizard should respond to this penetration with more layered defences. Some part of her guard (the lesser half) should be deployed to ambush and defeat the party. The greater part of her guard should go with her and guard her retreat.

The greater part of her guard should be deployed if the party manages to defeat the first "retreat guard" layer, and are continuing to chase successfully.

If the ambush party defeats the invaders, they will be well rewarded. If they don't, they have failed, and will buy time/distraction for the wizard to retreat safely. Their means of communicating/meeting up afterwards shouldn't lead the party to follow where the wizard is fleeing (at least directly), as the wizard should presume they will be captured and interrogated.

After the wizard manages to flee, then, another base of operations can be set up with new layered defences, with whatever exploit the party used sealed. Again, the outer layers should be set up to assess or defeat anything weak enough that the inner layers may be endangered, and the inner layers should be designed so that if the outer layers are penetrated that the wizard can flee.

This is a rational set of actions for someone for whom the base (the place they live) is far less important than their life. If the base is highly important (say, a settlement and source of nourishment for a town), they may choose to risk themselves, or more of their guards, to defeat the invaders. This is the maxim that you should always leave a means for your foe to flee, because cornered foes are more dangerous: they will turn with all of their strength, instead of just with the strength required to protect themselves.

Now, suppose the base is of high value and the wizard is willing to risk his life, and most of his henchmen, to defend it. Or the wizard thinks that the party is not that dangerous, so he can mop them up, and doesn't shy away from personally exposing himself to attack (remember, in D&D as in real life, line of sight plus a failed save/lucky crit can kill you: even if you win, you can die.)

So the wizard is going to set up an ambush.

Ambushes are hard to get right. Unless you are a highly practiced elite military unit, your ability to do distributed tactics flawlessly and reasonably quickly is going to suck. As a DM, you can just move the units around -- but instead, you have a wizard talking to a bunch of dumber creatures and detailing exactly what steps to take, and not take.

If you have centralized control (the wizard), then extra hands don't help speed much (basically, the wizard has to do everything themselves), and the cognitive load on the planner is extremely high.

Have you ever run a MMORPG raid of modest size? How about doing it without any cheat descriptions of what the fight is going to be, or maps beyond in-game scouting and knowledge?

Now, do it silently, without being able to communicate in-game beyond a local /say style communication (no yelling! You are setting up an ambush. And no global chat).

Plans that rely on complexity fail in practice. Modern militaries can do some amazing things with complex plans, but that is because they have ridiculous levels of training and radio communications.

If you don't have centralized control (the wizard does it all!), you rely on each person knowing their role and doing it consistently with everyone else's role. This requires lots of practice, and (in practice) is the way you pull off decent sized ambushes. Everyone has practiced the ambush together, and knows what to do without having to communicate; variations are described, and everyone knows how to adapt.

The wizard's underlings -- are they brutes, or an elite military unit?

Your complex ambush, with doors being locked jammed and a funnel and the like, is not something you are doing to pull off successfully in the heat of the moment, unless they have practiced for exactly that many times.

If you try, things will go wrong. Or, more importantly, it is reasonable for things to go wrong. As a DM, your goal is to create a reasonable world. Having everything go right for the bad guys may also be reasonable, but if it leads to TPK, it is also reasonable for not everything to go right for the bad guys.

What will go wrong? Here are some ideas: you'll lock a door and someone will be on the wrong side. You'll leave tools out where the PCs can see them. Or someone will cut themselves and splash blood, and maybe cry out. Or someone will go the wrong way or do the wrong thing. Or you'll forget to lock a door. Or the retreat-covering team will engage before the primary team does. Or the retreat-covering team won't engage in time. Or you'll be half way through prep when the party arrives. Or the team watching for the party approach will get ambushed by the party. Or a door they play to jam doesn't want to get jammed. Or someone will speak too loudly at the wrong time. Or they will open up the side-ambush doors too soon, too late, or the cross fire will hit each other, or the fire-bomb trap will go off before the party gets there, or...

You can say "but they are too competent to fail that way!", but they in real life people doing something new for the first time screw it up pretty reliably.

A perfect ambush requires everything to go right. A failed ambush requires one thing to go wrong. Having something go wrong when the ambush is set up after an unforeseen penetration of your defences, followed by a surprising amount of time to recover, is very reasonable.

• Wow. I wish I could upvote this answer more than once; this is genuinely awesome in terms of explaining how to play a smart NPC opponent. – Zeiss Ikon Dec 1 '15 at 12:16
• The +1 was for a lot of things, but in particular for showing how "realistic" and "reasonable" fit together very well. – KorvinStarmast Dec 3 '15 at 14:55
• This answer is quite good, but you may want to address the methods a high-level 5e wizard has of eliminating the obstacles to clear, non-interceptable, easy-to-use communication as well as the obstacles to perfect coordination (i.e. magic, e.g. telepathic bonds, directly controlled minions, etc) – Please stop being evil Oct 2 '17 at 22:11

You shouldn't do something just to conform to what you think is realistic, if it's detrimental to the game.

I'm not saying that having the wizard find out that the minions are alive is unrealistic, just that it's not the only realistic outcome. It seems (to me) more likely that the wizard would know that the minions are alive before leaving - but it doesn't matter. What matters is that it is realistic enough to have the wizard leave and not realise that the minions are alive until it's very late. To be fair, it's far more realistic than having the wizard to sit in his room while his minions are slaughtered!

Therefore, you don't have to sacrifice realism to avoid the encounter, and you should decide on whether to have the encounter solely based on whether it be fun/suitable/whatever you try to maximise.

• @KorvinStarmast I don't quite see how the DM's role of figuring out how a NPC should behave is that different from a player's role to figure out what the PC should do: in both cases there's the danger of focusing too much on what the character would do, given the existing background, instead of expanding the background or thinking ways that the game-breaking action wouldn't occur. – falsedot Dec 1 '15 at 17:09
• I think "my guy syndrome as a GM" is both insightful and useful. It's the justification of an NPC's actions on the grounds of realism, regardless that the players signed on for a different style of game entirely (e.g. balanced tactical combats / lighthearted power fantasy). That's a GNS way of looking at it, anyway (en.wikipedia.org/wiki/GNS_theory). – Sebkha Dec 2 '15 at 11:00
• @KorvinStarmast makes sense - while there can be parallels to be drawn I think that the term would be overloaded and (evidently) be a distraction; so I've removed it. Thanks for the feedback! – falsedot Dec 3 '15 at 17:20
• up vote added, comments retracted. – KorvinStarmast Dec 3 '15 at 17:29

The last paragraph of section 12. Glassstaff's Quarters, provides you the out.

The Wizards interests are limited, and survival is his ultimate goal. If he escapes, he runs to retrieve his bug out bag, and leaves the hide out. If he is delayed by the players, he uses the Potion of Invisibility, and leaves the hide out.

He was tasked with managing the waylaying of a town of villagers and delaying things; engaging in an drawn out battle with a party of adventurers is a step above that.

While it might be brutal I think it is appropriate. They chose their course of action and failed to kill all of his henchfolk. I would subdue the party rather than kill them. This opens up new RP and adventure options:

• Maybe the Wizard needs them to do something for him or wants to know how they found him, giving them a chance to escape and come back later.

• This could create a real Big Bad for the game -- maybe this Wizard is far more powerful then they thought.

As it is I think it's a very good move as a DM to go the route you are thinking. I've been DMing for a long time and I might not have thought of this course of action. Sometimes PCs die. Its not always fun but it happens. I always have my players make two characters, one as a backup, to establish from the start that I won't be pulling punches.

Instead of a simply putting them in an ambush battle that will ultimately end in a t.p.k., is to use other 'avenues of attack'.

## Examples:

You can have the wizard ambush them and finish them quickly, but leave them alive, having 'learned their lesson'. All damage can subdue (on the last hit) instead of kill in 5e, so you don't have to kill them outright to prove a point. You could even have him attempt to recruit them while they are near dead, or have them locked up in a torture chamber of some sort.

You can have the wizard convince (through magic or money) the local law enforcement to detain the player characters for looting through his home. This has the potential of making the wizard look more resourceful and dangerous because he has some of the 'good guys' on his side.

You can decide he doesn't want to risk a close quarters combat when he wasn't expecting one, so he runs off, but will come after them later.

## The Point:

Any of these things leaves him to be dealt with later, and turns him in to an ongoing antagonist, able to influence more of the storyline. There are an infinite number of ways of dealing with the problem that don't result in a T.P.K. yet can still fit a villain, depending on their mindset.

If you want him to be flat out lethal, than do so. It is not necessarily wrong to do that. If you are questioning whether it is too brutal to do so, however, then it comes across as you not wanting to do this and want to see if a story-appropriate alternative can be found. Think of the character's motivation and personality, and base the response on that.

If you do decide to have him set up an ambush, drop hints that he is flat out dangerous... Something for the players to see that reflect his capability such as material components for the fireball spell in a small pouch on the ground or in his home and notes about the damage it can do (in in-character terms, not dice) or something similar.

It's a subjective question, but here's how I would handle it, based on decades of GM'ing and almost always using a fair-but-dangerous "realistic sandbox" style:

First, I like how you've handled it so far. Like I do, you're keeping track of what's happening outside the PC's immediate area, and thinking about what the NPC's are doing with their time and resources. I am thrilled to see a new GM doing this, because I think that is the approach that makes the most interesting games, to me, because they tend to make sense and invite players to engage the world in ways that make sense.

My question is, is this too brutal?

No, not if you're going to play it out fairly, but I would think about the full situation and be open to other possibilities besides deadly ambush combat to the death.

Should I just wait and see how it plays out?

Yes and no. I would think about the situation carefully, and then play it out fairly and considerately, and see how that turns out.

Should I contrive some divine stroke of luck to save the party if it looks dire?

I wouldn't. (There are players who want part of the contract to be "the PC's should never die" or something in that direction, and I find that agreement undermines my interest in the supposed danger. So my advice isn't for those folks.)

Any time I find myself thinking something like, "oh the PC's will get in a bad situation and probably die from this", I try to give it more thought so they can get fair clues and opportunities to not just die. I don't warp reality to give them extra chances, but I do give it attention to see what I might not have thought about.

I could probably come up with a narrative reason for the wizard to capture them as opposed to killing them outright, I suppose.

I wouldn't force it, but even without knowing the details, I can think of several ideas why this might naturally be the case. And in general, I like to have most characters not kill others needlessly, and so accept surrenders, take prisoners, hostages, etc., when it makes sense. The main thing that comes to mind from your description, is that the players may have several of the wizard's possessions, which he would like to get back without them being destroyed. So he might prefer to negotiate for taken stuff to be given back, and whatever other terms he might feel safe or profitable about, rather than just have his minions attack and possibly break precious things.

Maybe this would serve as a good lesson in taking on enemies more tactically?

Yes. And this is why I like your approach in general, as opposed to scripting and forcing things to go in certain ways. When you set up situations and then play them out in ways that make sense, it invites your players to do smart and interesting things in ways that make sense. You can then enjoy watching them get smarter and more clever, and pretty soon you won't expect to be able to ambush them at all, maybe.

What are the pros and cons of taking a hardcore "this is what would realistically happen" approach?

The pros have to do with the world making sense and so there arising an actual game world for players to interact with in ways that make sense, and actual dangers to face and overcome in ways that make sense, actual lessons to learn about how all that works. Players can become engaged in different ways than when the game is really about a scripted set of possibilities, or about having things seem cool, or about having the players be heroes and not die or have setbacks no matter how foolish they are.

The cons can be that the players may get outmatched and / or be expecting to be able to win no matter what and may become very upset and dislike losing. The GM may make mistakes about predicting what will be fair or interesting or a bunch of bad luck or by no one's fault liked characters or the whole party could die.

The main pitfall I find is when you as the GM are wrong, and end up punishing the players when you yourself don't think of what they can do, and don't give them the opportunity. It's no fun when the GM just tells you you're doomed, or leaves out chances you might have had to avoid the situation. So first I'd make sure I'm not doing that. Check all their abilities and see if they deserve any kinds of clues or warnings or if they have any recourses besides what you expect will happen. Also check any NPC allies they have - if the players are doing something foolish, and the NPCs are not that foolish, roll a chance to have the NPCs mention the reasonable concerns you feel someone would notice. If the PCs have relevant training, you can also roll and then mention that "Sir Thurgood (a PC) feels a bit uncomfortable that the group is starting to take time and make noise looting the tower without having dealt with whatever other foes might be nearby, and with the wizard loose somewhere". You can also give such clues when there isn't actually something about to come get them.

I also find that I prefer when only the worst people in the world are the ones who would kill defeated opponents just out of convenience. Even for somewhat evil NPCs, I think it's more interesting if they aren't too bloodthirsty. In the first place, it makes for more interesting situations and often there are uses for people who owe you their lives. In the second place, it's good to be able to defeat the PC's and have that lead to even more interesting situations, rather than game over. In the third place, I like players to think about life and death and mercy and not become bloodthirsty killers themselves. I think it all makes the game more human and real and interesting and humane and likable. I don't tend to like people who don't grant mercy and kill other helpless people out of convenience. If there's an unspoken understanding that people almost always kill everyone they defeat, then it's kind of horrible to think about the reality of that when it sinks in, and it can be an invitation to tuning down one's own aversion to killing, which I don't recommend. Finally, even if the evil NPC is meaning to kill off the PC's, he might not do it immediately. He might want to question them, find out who sent them, see if any of them can be ransomed, or use them for experiments or in some scheme, any of which can give them some chance to see if they can escape or negotiate their release or something.

Unless the group agrees that the campaign needs to be wrapped up quickly and they want a fresh start, a total party kill is usually a very frustrating and anticlimtical event which should be avoided when possible.

So when you notice that the group is having fun with the campaign but is heading right into a deadly trap, you should try your best to defuse it. Options are:

• Actively help them win. Have the NPC act irrationally stupid, forget about any henchmen and gear of the NPC the players don't know about yet, arrange external circumstances to put the NPC at a disadvantage or organize a deus ex machina to rescue them. Remember, it's your world and you have control over it. Nobody forces you to follow your notes to the letter and you can cheat as much as you feel is beneficial to the game experience of everyone.
• Warn them. Give them hints that they are walking into their doom. Preferably in-character but for inexperienced group an out-of-character warning "guys, there is no way you can win that" can sometimes be necessary.
• Replace death with humiliation. If you want to punish the players for being reckless but a TPK is too harsh, the evil NPC could decide that they would rather like to have some fun with the PCs instead of just killing them. A wizard has quite a large arsenal of spells which are useful for that.

• Polymorph them into animals
• Teleport them into a manure pit
• Turn them into stone, sell them as lawn ornaments and when the spell wears off confront them with the angry buyer
• ...whatever you can come up with

The players learned their lesson, but there are no actual long-term consequences and the campaign can go on.

• The character levels are 2, so a wizard with bugbears and fifth level spells is a bit higher CR than that party is ready for. Your suggestion probably needs to suggest lower level spells to fit the wizard they are confronted with. – KorvinStarmast Nov 30 '15 at 17:21
• I don't think you necessarily need to have a 'level appropriate' thing going on. In some ways, it's better if it isn't - it makes quite clear to the players at a meta level that this guy outclasses them. (And sets up a role potentially as a recurring nemesis). Does Geas still exist in 5e? that was always a good way of stitching up players, in a somewhat plausible way - more expendable, but also more competent than henchmen. So send them on a mcguffin fetch quest which might get them killed. – Sobrique Dec 2 '15 at 11:11
• @Sobrique I don't recall seeing Geas on the PHB, but I'd have to look again. There is a memory that there is a HP penalty when the Geas'd character doesn't keep going on the assigned quest, but right now I can't link it to 5e. (AFB at the moment). Yes, that was a great tool back in the day for taking on a Magic User who obviously outclassed a party. – KorvinStarmast Dec 3 '15 at 15:00
• Using mind control effects on player characters is often very bad DM style, because it is pretty much the laziest and most extreme way of railroading imagineable. See also: How to DM mind control effects without angering my friends? – Philipp Dec 3 '15 at 15:12
• It needn't be mind control. Just a way of coercion. If you don't like magic bit, a delayed action poison for which the antidote needs completion of this mission would work (with the added "fun" of not being certain that they'll get it anyway). I don't know about current, but Geas wasn't so much mind control as a 'if you don't do something, you'll suffer' sort of curse. I'd be inclined to houserule it to something like that if it wasn't. – Sobrique Dec 3 '15 at 15:19

It is indeed logical for the wizard to do this, but risking a TPK is unnecessary. There is an easy way out, which is simply making the ambush slightly easier, if you deem it necessary.

I understand your conflict between realism and the meta, and I personally have experienced that respecting the meta gives the most favourable results. Simply ask yourself, What is more fun for the players? Would they rather have a TPK, or a wizard who is a bit of a coward?
However, in this specific case, you don't need to completely neglect your realistic scenario. You can have the ambush happen, and have a smaller risk of a TPK by simply making the ambush easier on them. He might have a scroll with a weaker spell, or there were less men in the tower as you had planned at first. The players don't know, so inconsistency won't be a problem.

But the wizard was able to estimate their strength and wouldn't ambush them if he'd lose!
I can hear you thinking. And while this might be the case, this doesn't have to be a problem. Completely neglecting mechanics and things like levels and CR, the situation would be:

A party of five adventures broke into the wizard's tower, but failed to kill all of his henchmen, which include a few of his strongest. His familiar alarmed him timely, and he managed to grab a powerful scroll. He (presumably) has an advantage in numbers, strength and the element of surprise!

Does this sound like an opportunity you would pass up?
The wizard is still human. It is as realistic for him to make a faulty estimation in the party's strength as it is for him to come up with an ambush.

You don't have to kill them.

Let the wizard and his henchman ambush the party and make it clear they are outnumbered. Give them one or more chances to surrender. If they don't surrender, continue the fight and give them a second option to surrender if the first player is dead and probably another is the last one is standing.

If they surrender, drain them of all valuables. Let them suffer some torture (you can use your worst imagination on this). And give the party a chance for escape.

In the end, the party is (mostly) still alive. They really hate the wizard but they know they can't beat him yet. So they have their first arch enemy. They need to lick their wounds and get some new equipment. And finally, if they have gained enough levels, they can return and kill the evil bastard.

This way, you give them some chances and you keep the reality level.

For the escape part. If there are dead player characters, you can introduce new players as other slaves or prisoners. Or one of the henchmen is frustrated with his evil boss and he helps the prisoners to escape and joins them. (This way they can even regain some of their belongings)

Morale, sometimes, a TPK happens. But it is better if you can avoid it.

• Geas 'em or similar. Send them on a really sticky fetch-quest for the Wizard, that'll make him more powerful if they actually complete it. Maybe even have the wizard (try to) recruit them - offers of pay, power, etc. – Sobrique Dec 2 '15 at 11:24

The solution to this is something every GM must learn for themselves, treading the line between the Rule of Fun and punishing foolish (or simply ill-informed) actions. However, there are a few suggestions that can work effectively with this:

1) Enable Get-Out-of-Jail-Free Cards. Provide story hooks that allow for the party to establish relationships with powerful allies they can call on in times of need --- for a price. A paladin ghost may be able to be summoned with the invocation of a religious artifact, but his protection comes at the cost of a dangerous quest for his deity. A master rogue/assassin might get a signal from swallowing a coin, then will liberate the imprisoned party; criminals of her caliber, however, might require assistance in a crime that puts the party on the wrong side of the law. This way, you can arrange it so the TPK can be avoided while still providing consequences for failure and driving the story along. This is a good option for games with looser plots, as the party likely may find themselves being derailed by their debts.

2) Take a cue from Fantasy Flight's Star Wars RPGs, Destiny Points. These points act as a currency that allows players (or a malicious GM) to make otherwise-unlikely situations possible through the manipulation of destiny, or luck, or divine grace, whatever the characters believe. Key to this system, however, is the balance. If the heroes luckily stumble upon a tool that can help their efforts (such as a lockpick in a prison cell, or a key in a chest of drawers), they later might find that their progress is being halted by some strange occurrence (like a wagon wheel coming loose mid-chase). This is a good choice for heroic rather than realistic campaigns, as destiny is paving a path for the party, at a cost.

3) Establish logical Deus Ex Machinas. This may be the best option overall, as it combines the roleplaying potential of the first option without constant security. If the party is investigating a vampire infestation for the local law enforcement, maybe the sheriff gives them 24 hours before he gathers a posse. If the party discusses its plan of attack against a heretical cult with a cleric within riding distance of his monastery, maybe he considers the plan foolish and declares he is going to gather a minor crusade. The only limit to this is the back-up must be established either through discussion (a sadistic GM might even require the players to actually beg) or declarations by the NPCs, but the party must reasonably know about the possibility of rescue. This is a good choice for realistic games, as even a child knows the utility of having a few friends to come in after him if he takes too long. This choice also combos well with the debt aspect of the first choice. Maybe the party arranges for a band of archers to ambush a pursuing enemy host, the rangers probably aren't risking their lives for free (unless the party has put the band in debt to them).

4) Roleplay the Deus. An unexpected interruption provides a rather intriguing problem for the party. Say a ghost deflects an otherwise-lethal attack and releases a powerful spell upon the enemies; why did he do so? Is the ghost an ally? An enemy of the enemy? Does he want something from the party? Ham the RP up, make the party fear the benevolent entity, and make them work to resolve it. Returning to the ghost, he might save the party from certain death, but suddenly things appear to be moving of their own accord. A wizard might find that a mysterious specter (an adventuring chef) has moved his basic spell components from their pouches into the party cooking pot. A party that hears a spirit murmuring "So cold..." might find the druid's staff or the ranger's arrows being used as kindling when the party looks elsewhere. Of course, this doesn't just have to apply to ghosts. Consider Gollum of Tolkien fame: maybe a dreadful goblin or some such harasses the party constantly, but intercedes on their behalf at dangerous times.

The common theme behind every option I've suggested is retaining consequences for failure. Either the Deus or fate conspire to punish parties who rely on chance, and the party might well find themselves facing a TPK while repaying the last one they were saved from. After all, what better way to dissuade a party from foolish choices than a fate worse than death!!

• You may want to use headings and break up those large paragraphs a bit. – doppelgreener Dec 19 '15 at 17:41

I can think of three options for you to avoid a TPK, if you choose so, and you can mix them as you see fit:

• Rely on your party's controller.

This role is meant to be able to counter the DM's plans. If your player has any tactical option available, you could formulate an ambush that your player is able to counter, or make it manageable. This can be coupled with the previous suggestion that the ambush has many ways to go wrong, some of which may enable your party's strengths.

This has the advantage of allowing your own players to shine, rather than relying on external factors, but still requires your players to adopt tactics they haven't developed yet. You may also need to give him somethig to boost his powers during the ambush, such as rods and scrolls found in the hideout.

• Have a party character figure out the ambush himself.

Just because your players haven't figured out yet that the wizard may return for an ambush doesn't mean their characters can't. Remember that the character and the player are two different entities and don't necessarily think and perceive the same things (see posts as How do I roleplay a character more intelligent than I am?).

Parties tend to have characters from multiple backgrounds to cover each one's weaknesses, so it's likely that one of them will figure out the ambush possibility just as well as the evil wizard himself. It could be the military tactician, who just recognize it from experience; it could be the intellectual wizard that just imagined the drawbacks of living in that place; it could be the rogue whose intuition is itching at how vulnerable he is for capture.

This can put off the timing of the ambush, since the wizard may not have enough time to set it up as he was expecting.

• Have allies hindering the wizard at the time of the ambush.

Whoever sent your players to hunt the wizard is likely to want some assurances that the wizard will be captured or killed. He may have a group patrolling the area or following your players. If they were spotted, the wizard may give up the ambush simply because the danger is higher than he expected, or because he suspects an ambush on himself. The third group may also be one of the reasons the ambush fails, as they may prevent some exits from being blocked.

The hideout may also have prisoners that could help, unintentionally even. It's not unreasonable for your evil wizard to have prisoners for his experiments. They may provide some tactical possibilities (even replenish your party's controller) against the ambush, or simply alert your party as they try to escape themselves and stumble with the wizard's group, throwing off the timing of the ambush. Some may even fight the wizard's group as they try to get out of the hideout, or join the players as they are their best shot at surviving.