Roleplaying games have it easier. With a few exceptions, like the classic psychotic salesman, death is understandable. If you lose a fight with a dragon, it's not going to just send you on your way.

There's one problem though – resurrection. With all the fighting, characters are going to die. If they're just generic mooks – Soldier or Monk or similar, fine, they can be replaced. If they're characters in their own right, like Alistair and Morrigan from Dragon Age, or the Companions from Ultima, killing them off at the start of the game would be a problem.

Dragon age

RPGs have two basic ways to get around this. First, magic. Spells, potions, clerics, Phoenix Downs, whatever. Brings a party member back to life in seconds, or your mana back. The second approach is that while you may think you just saw the mage get run through with a sword and then his lifeless corpse fireballed into a crisp and trampled by an ogre, really, he was just 'knocked out' for a little bit. He can then get up at the end of the fight and nobody ever need mention it again. No, really. Don't.

In both cases, the problem comes when a death has to actually matter. The most famous example (spoiler for ancient game coming NOW…) is Final Fantasy VII, where one of your party, Aeris, gets killed off for real by the baddie a decent chunk of the way through the game. It doesn't matter that under normal circumstances she could survive the destruction of the entire universe (an actual spell) as long as someone threw a Phoenix Down her way – if it happens in a cut-scene, normal game rules are suspended.

Another, even more annoying case is when you have a party of characters who can be resurrected, but the game is over if your personal avatar falls dead. It's hard not to take this as the characters standing over your corpse and saying "Anyone got 5G for a cleric? Oh well…"

Any time the story and gameplay butt heads, the risk is that the game simply stops making any sense. Some games handwave it away – for instance, in Baldur's Gate, even though your character could technically be reborn, the thing that makes them special would be lost forever – but most simply ask you to ignore the obvious and glaring mechanical problem.

It's particularly painful in Japanese RPGs, where characters are capable of doing anything from summoning dragons to leaping skyscrapers if it's a cut-scene, but can't take a punch or climb over a barricade in the actual game.

Even with this, the death of Aeris stands out as one of the most emotionally charged moments in games, simply because it inverted the idea of it being cheap. Actually losing a character that you'd spent many, many hours building up and leading carefully through the world was a genuinely sobering experience.

Disconnecting people

That's when death really stings. It doesn't have to be a character in the sense of a designer-created collection of hopes and dreams, detailed backgrounds and snappy voice, just someone you've invested time and emotion into guiding.

Second, the feeling of loss is vital. When you can simply quickload, or even start the game over, it's just not the same. The classic example from the world of strategy is X-COM ( or UFO: Enemy Known as it was originally released as).

X-Com

In this, you were given cack-handed troops barely able to point a gun at an alien, and had to train them up over the course of the campaign to be expert shooters, psionics and general arse-kicking saviours of humanity. You even got to name them, and anyone who didn't immediately name the whole group after friends and turn their most hated maths teacher into the team's designated bait was clearly one of the aliens. When your best guy fell to a cack-handed move, you might not have cried, but it still hit home.

Games with permadeath – often known as 'Iron Man' mode – take this to a sadistic new level. As the name suggests, with permadeath, you don't get to reload. If the enemies get a lucky hit, or you slip as you're walking across a pit, it's back to the very start of the game you go.

The crucial thing here is that while you can certainly be unlucky, death has to be at least primarily your own fault. You moved too fast. You took on enemies you couldn't handle. You didn't pay enough attention.

The classic permadeath game is Nethack, a randomly generated dungeon crawl that may look simple – the basic version is entirely drawn with text symbols – but hides a ferocious level of depth and complexity. You never know what enemies lie behind the wall, aren't told what all the objects and potions do in each given runthrough. In the case of the latter, there are ways to find out…or you can gamble.

If you're about to be killed by a monster, that shimmering potion might save your life, or it might turn out to be concentrated poison. In a life-or-death situation, maybe that's worth the risk. If you just gulp it down on a whim, you only have yourself to blame. The worst part of all this is that when you do die, the game offers to identify all your goodies so you can see what might have been.

Iron Man mode has never been a default setting in commercial games. It's too hard, too unforgiving and the average gamer doesn't want to lose that much progress. It has been an option in a few however, including Diablo 2 and Hellgate London.

Online RPGs have dabbled with it, but only on isolated servers, or on a limited basis – Eve Online lets you lose ships, if not your character, while the original plan for Star Wars: Galaxies was that elite players who unlocked the Jedi class would have to balance the reward of being, well, Jedi with the real risk of being hunted by the baddies.

Spelunky

Indie games are in a much better position to experiment with this kind of thing, and often have. Most recently, we got hooked on Spelunky, in which your daring Indiana Jones style explorer can meet his death in a matter of seconds, in a Nethack-style randomly generated world.

Unlike many, it's okay because Spelunky is relatively short (which doesn't make it easy) and while it can have you screaming obscenities at the screen, every death teaches you more about the world. You're not supposed to finish it in one sitting and everything about the design reflects that.

Another, much more sadistic variant, is I Want To Be The Guy – a joke platform game designed specifically for evil. On the easiest mode, the scenery leaps up to attack you even as the floors vanish over the spike pit at exactly the wrong moment, but at least there are saves. In Impossible mode, you have to do the whole thing in one life. When the creator heard that people had actually done this crazy thing, his response was – and we quote – "holy crap your not serious are you".

A thousand deaths

The problem that designers have when working out how death is going to work in a game is that, with a few exceptions, dying isn't fun. It's also problematic. How much should we make them replay if they screw up? How do you prepare an ambush if the player can casually walk into a room, scope out all the enemies and walk back in with full tactical knowledge?

In narrative heavy games, death has to hurt. In action games, it needs to be the exact opposite. When we get shot in a game like Team Fortress 2, it's not an attempt to simulate a brave soldier's last stand against an implacable enemy, just a more interesting way of saying "Tag!"

Team fortress 2

TF2 does everything it can to soften the blow. It kicks off with a visual gag, pointing to bits of body parts and labelling them up as 'Your head!', and eases the pain by finding some positive spin on it, like 'You almost killed more people with that class than ever before!'

It also adds to your tactical awareness by both zooming in on the guy who killed you, sets up mini-rivalries between players that leave you burning to get back at the Sniper who keeps deadshotting you, and gives you something to watch while you wait for the respawn – letting you follow your team members around so that when you get back in the action, you can immediately get back into the game.

The most impressive thing about this is that even now, years after release, if you go into a game of TF2, nobody really cares about dying. It's an inconvenience, but no big deal. Back in Counter-Strike, where one lucky shot would put you out of the whole round, people would constantly get angry, forced to watch their diminishing team footle around the map until one side won. TF2 makes for a much more approachable game.

But what about single-player? If we can't have permadeath and we don't want to be inconvenienced, what is there? That's a massive design challenge, and one that most genres are still fighting with.

In strategy games for instance, there may not be death per-se, but there's still the same failure state. The difference is that there, at some point you know you've lost, and the rest of the game is the miserable experience of watching someone trash your army. Only a masochist wants to see that, so what generally happens is that people quit out to spoil the victor's satisfaction.

Well handled though, death can add a certain spice. It makes failure matter, and it's the one ending we can all be guaranteed of reaching at some point. Whether we get the chance to restore or restart at that point, for the moment, we'll leave to the philosophers…

-------------------------------------------------------------------------------------------------------

First published in PC Format Issue 240

Liked this? Then check out

Sign up for TechRadar's free Weird Week in Tech newsletter
Get the oddest tech stories of the week, plus the most popular news and reviews delivered straight to your inbox. Sign up at http://www.techradar.com/register

Follow TechRadar on Twitter * Find us on Facebook