Author David Nicholls's painful encounter with a school of jellyfish during a swim in a remote French cove affected him so much that he put it into his novel Us, a serialisation of which beings on BBC One begins tonight.

The best-selling writer, whose other mega literary success is One Day, thought the game was up when he was stung by the jellyfish. "It was horrific, really, really horrible and alarming. I did think 'Oh, I am going to have a heart attack and die.' " he said.

Instinctively he took a deep breath, endured as best he could the stings, and swam to safety. The incident is one of the few genuinely autobiographical moments in Us.

"The jellyfish scene is brilliantly done," Nicholls told The Independent. "The great joy of being a novelist is that when bad things happen in life, you get a chapter out of it."

The author added that he was "as unbrave and complaining" in real life as Douglas Petersen, the middle-aged protagonist of Us, who is played by Tom Hollander in the new drama.

We need your consent to load this YouTube contentWe use YouTube to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Us was longlisted for the 2014 Booker Prize and tells the story of Douglas’s bid to save his marriage to Connie (Saskia Reeves) during an expensive tour of European cities with their grumpy teenage son Albie (Tom Taylor).

The clumsy Douglas character also knocks over an entire row of bicycles in Amsterdam. In an interview with the Radio Times, Nicholls also mentioned his book tour for his previous, breakthrough novel One Day.

David Nicholls

"I mean the inspiration from the book came from a book tour I did when One Day came out, that I was seeing all these cities for the first time, and loving them - I hadn't been inter-railing.

"So I was sort of inter-railing in my forties, and having a wonderful time, and (wanted to) put that feeling on the page, when you’re in a city and you want to see everything and you’ve only got an afternoon, the kind of frenetic quality of travel as well, the joy and also the shabby hotel rooms and the bad restaurants."

Us was shot on location in Paris, Barcelona, Amsterdam and elsewhere.

Us begins on BBC One at 9.00pm  on Sunday. All four episodes will be available on BBC iPlayer after the conclusion of the four-part series.