Breaking Bad
Jesse Pinkman and Walter White take a break from drug production duties.

Breaking Bad creator Vince Gilligan has shared secrets about one of the most watched TV shows during the Sydney Writers' Festival, Australia, reported.

American series Breaking Bad, the highest-rated TV show in history, according to Guinness World Records, tells the story of chemistry teacher Walter White (Bryan Cranston) who starts cooking meth with former student Jesse Pinkman (Aaron Paul), after he is diagnosed with terminal lung cancer.

His aim is to make as much money as possible for his family before he dies.

The show, first broadcast in the US in 2008, has attracted millions of viewers and won numerous awards.

Here is what the creator shared with the audience in Sidney:

Breaking Bad was inspired by a real event. Gilligan explained he first got the idea after reading a newspaper article about a meth lab in Brooklyn that had made a group of children sick.

The writer admitted he had not planned the whole story in advance. The script and characters grew as the story developed.

Famous scenes such as the one where Walter and Jesse were trapped in the caravan were not resolved at the time of writing. It took seven writers a week to come up with Walter's exit strategy from that van, Gilligan explained.

Gilligan admitted he was surprised by how many people hated Walt's wife, Skyler (Anna Gunn). "I didn't see that coming," he said. "To us, she was a really good character... I think she really and truly did what she did for her family... I never saw her character as a bitch... I saw her as someone who was kind of a tragic figure."

'Breaking Bad'
The last episode of the hit US television series \'Breaking Bad\' proved to be a milestone for the show as it attracted 10.3 million viewers. Tumblr/teamcostafree

The scene where drug lord and chicken fast-food chain owner Gus Fring (Giancarlo Esposito) dies took 19 takes to film. "We used the 19th take," Gilligan said. "We wouldn't make him fall down 19 times only to use the first one."

Gilligan considered killing off Jesse but changed his mind as the character developed and the chemistry between Jesse and Walt grew as the show progressed.

One idea that never made it into the series was for Jesse to take revenge on Walt through his son, Walt Junior. "When Jesse was very much on the out with Walt, we wanted him to get revenge by seeking Walter Junior and getting him hooked on meth," Gilligan said.

CEO of Sony America called the pitch "the single worst idea for a television show that I have heard in my whole life".

The creator wished he could see the show turned into a video game in which players drive around in a Winnebago. "I pitched that," he said. "That would be fun. I would love to see that happen."

A spin-off series, Better Call Saul, based on Breaking Bad lawyer Saul Goodman (Bob Odenkirk), will begin shooting in the US on 2 June. It will be directed by Gilligan.