The prospect of dying was “an awfully big adventure” to the young, tragedy-oblivious Peter Pan. And on television’s top dramas, killing off a key character is often just that: awfully big for viewers, and an adventure for the creators going forward.

Terence Winter, who wrote the second-season finale of “Boardwalk Empire” — in which Jimmy Darmody (Michael Pitt) was killed by Nucky Thompson (Steve Buscemi) — says that while he couldn’t avoid the wide range of fan reactions to Jimmy’s death, it had been planned for since the pilot.

“I’m not in the wish-fulfillment business, to make people have happy endings,” says Winter. “It’s a gangster show. Things often don’t work out well.”

Winter counted on viewers to assume that Nucky’s and Jimmy’s antagonistic relationship would continue because, well, you just don’t axe major characters two seasons in.

“In the pilot, Jimmy says to Nicky, ‘You can’t be half a gangster anymore,’ and I knew one day Nucky would cross that line,” says Winter.

So why not turn what was inevitable into a curveball? But as proud as Winter is of the surprise, he admits it creates writing challenges.

“The easy thing would have been to figure out a way to keep Jimmy alive because he’s a fun character. But I always say to the writers, ‘Let’s make it harder on ourselves, not easier.'”

It also makes it nervewracking on actors, who unless they’re playing real-life characters with established expiration dates (Stephen Graham, rest easy, Capone’s sticking around till 1947), could go at any moment.

“That’s one of the reasons I tried to fictionalize as much as I could,” says Winter. “Just to keep an air of mystery.”

Vince Gilligan, on the other hand, kept icy cool “Breaking Bad” kingpin Gus Fring around for longer than expected after being introduced near the end of season two, because Giancarlo Esposito’s performance was so mesmerizing and inspiring to the writers.

But season four was intended to be “a 13-episode chess match,” says Gilligan, since “there can be only one man left standing, and Walter White is the main character of the series. At a certain point you say, ‘Man I love this actor and this character,’ but the town’s only big enough for one of them.”

The roundly praised demise of Gus — born of the only weakness he had — needed to be handled right, because, as Gilligan points out, “a very strong argument could be made that Gustavo Fring is a smarter character than Walter White, and that’s saying a lot.”

How to go forward, though, terrified the writers, who initially worried that they’d never be able to create a bad guy even smarter, meaner and colder than Fring.

“It didn’t take us long to realize, that’s a losing game,” says Gilligan. “In a very real sense, we already have that character on the show, and that is indeed the guy who killed Gus Fring. We ourselves sometimes forget that this guy is the central problem for all the characters on the show, whether they are friend or foe.”

On “Downton Abbey,” meanwhile, the historical reality of a brutal war which wiped out millions meant death couldn’t be avoided in season two.

“We felt to be at all truthful, we have to kill someone we loved,” says creator Julian Fellowes, whose own grandfather and great uncle died in the conflict. “In the end, it was William (the footman) who got the short straw. He was a very popular character, and that was one of the things that condemned him. It’s cheating, in a way, if the only people who die in a war that decimated Europe are people who have two lines in episode three.”

A visit from the Grim Reaper is less expected when the setting is an advertising agency, but “Mad Men” strengthened its bonafides as a drama with much on its mind when Lane Pryce (Jared Harris) — the British partner with financial difficulties and a dispirited view of his ability to adapt to American culture — took his own life in the episode “Commissions and Fees,” which earned a writing Emmy nomination for Andre and Maria Jacquemetton.

What was foremost on the writers’ minds, says creator/exec producer Matthew Weiner, was giving Lane’s downward spiral the proper storytelling momentum.

“We really wanted to tell a real story about how this desperation happens,” says Weiner. “You want to make sure that the arc of this person’s demise is used for stories along the way. It’s not my job to hide the fact that he was going to kill himself. The show is really about the milking of that tension.”

Invariably, character deaths are big deals on a television show, Weiner believes: “Unless it’s the guy in the red shirt on ‘Star Trek’ who’s obviously there to die, you’re basically committing to a change that the audience is going to find startling, because part of what you’re looking at in any TV show is a consistency from week to week. You’re breaking the fourth wall, in a weird way.”

Road to the Emmys 2012: The Drama Nominees
Death becomes a story point | Creators refuse to take one for the theme | The drama nominees: Views to their thrills are limited