TWENTY years of murder and mayhem. Twenty years of relationship chaos, backstabbing and betrayal. Twenty years of discovering unimagined parents, siblings – and Lorraine Kelly standing next to you in a wedding line-up.

Where does all this pandemonium take place? In the tiny hamlet of Shieldinch, of course – the fictitious world created by River City writer Stephen Greenhorn.

River City suggests a suburb of Glasgow, where its inhabitants still choose to live – despite the fact their chances of being abducted, jilted and blackmailed are greater than catching a cold. And the popularity of BBC Scotland’s drama, which has been recurring every year since September 2002, doesn’t look to be on the wane at all.

The series attracts a healthy 400,000 viewers per episode, fans who have watched voraciously since back in the day when Bob wore a shell suit and had a much thinner hair line. They’ve watched it since Malcolm and Eileen ran The Tall Ship, since Roisin was around the first time, before she came back and found herself, then – rather miraculously – found love with Bob. (Perhaps the new hair played a part.)

Which raises the question: what is there about this disaster zone that has pulled in Scots audiences over 1300-plus episodes? It’s certainly not a world of glamour; while High Road was helped by the lush Luss backdrop and Neighbours had sunshine beaches, the only hint of Sheildinch decadence appears in the form of the art deco-styled Oyster Café.

And while BBC Scotland drama Shetland features more murders than Mexico City, River City is no crime slouch either, offering more screen time to gangsters than Martin Scorsese.

How important is it to feature the darkness? We’ve had the recent death by burning, but fans of the series have witnessed death by shooting, drowning, drink driving, scaffolding dives, suffocation and pokering. (A great scene involving Raymond and Sean Kennedy.) There have been two rapes, several eating disorders and a case of self-harming.

Series producer Martin McCardie believes the crime content to be the duct tape that holds the series together. “Scots, like all soap audiences, love drama and stories with great hooks. And of course there’s lots of violence, but then people tend to recover really quickly.

“Yet, I think characters are really important. For example, Lenny Murdoch (the Shieldinch Godfather, played by Frank Gallagher) is a great character. And although he’s not the nicest of men the audiences love him because he’s their baddie. And he gets rid of the other baddies who come to town.”

Lenny Murdoch also reveals a base humanity. “Yes, it’s true. But what really makes the character work is Frank’s talent. If he were a one-dimensional gangster he would be laughed at. Frank brings the realisation that a gangster often has tough moral choices to make, sometimes when it’s not obvious in the script.”

The producer adds: “But the key [for a successful soap] is to get the dramatic storyline mixed in with humour.”

Much of this responsibility lies at the door of Johnny McKnight. The writer, already established as one of Scotland’s major playwrights and comedy talents, has brought a strong comedic content to his first work for television.

Yet, there must be a fine line when it comes to lighting up darkness? “I think that when it comes to the Scottish psyche there is always a joke in there,” he says, grinning. “When it comes to River City, if there’s a punch – there’s a punchline. Scots are big storytellers, and when it comes to tragedy we somehow find a way to process it through humour. And this humour keeps viewers engaged.

“Of course, the challenge is to find the lightness, and some soaps have gone through a rough patch when they’ve become too bleak. However, Coronation Street has managed, since the beginning of time, to get the balance right between grief and tragedy and heart and humour. I think River City is managing the mix correctly as well.”

Thinking about striking the right tone as a writer, he adds: “The best advice note I’ve been given is, ‘Remember that Shieldinch is a good place to live.’ You don’t want your characters running around saying, ‘I hate it here.’”

The Ayrshire-born writer says his task is made infinitely easier, thanks to the great characters played by great actors, such as Sally Howitt’s Scarlett. “And I love the matriarchs, like Caitlin and Maggie McLean.

“One of the first episodes I wrote was for Una McLean and Gary Lamont, which was brilliant. And I loved writing for Kelly Marie (Carmen Pieraccini) when she came back. I just love the strong, gobby, funny women.”

McKnight smiles as he reveals his inspiration for the Shieldinch divas. “These are the type of women I grew up with, and still hang around with, so you write what you know.”

He’s also had great fun writing for the likes of Darren Brownlie’s character, Mikey Duffy. “When you know the actors, as you do when you work in Scotland as an actor and a writer, it makes it so much easier to find their voice. When you know what Barbara Rafferty can do, you then have to give her brilliant zingers. What you want is the actors being excited at what they have to perform.”

How does he feel when the show comes close to “jumping the shark” – stretching the plot’s credibility, for example, when Lydia (Jacqueline Leonard) was shot stone cold dead by husband Lenny – but then came back three years later, in a move redolent of Dirty Den’s surfacing from Walford canal after years spent in the murky depths amongst the Asda shopping trolleys and old trainers?

McKnight grins: “At first you go, ‘Whit?’ But then you remember that this is soap opera, so you have to make it as big and operatic as possible. And bringing Lydia back offered the chance of some really great storylines. Also, you have to remember, when it comes to soap, no-one is gone forever. Even when they’re dead.”

McKnight has written the special anniversary edition to be screened in September. Fans will see Bob O’Hara (Stephen Purdon) and best mate Angus Lindsay (Scott Fletcher) drink a 20-year-old bottle of wine and wake up in a parallel dimension where they come face-to-face with ghosts from Shieldinch’s past. “It’s coco-bonkers,” he laughs. “It’s a sliding doors moment, a great what-if? and a nostalgia joy that allows for previous characters to come back.”

One of the reasons for River City’s longevity is that it has been able to throw a net around an array of powerful Scots acting talents. Over the years we’ve been able to wallow in the work of the likes of John Murtagh, Deirdre Davis, Gray O’Brien, Andy Clarke, Libby McArthur, Juliet Cadzow, Jo Free and the unforgettable Andy Gray.

Indeed, Barbara Rafferty’s character left for Spain one year and came back with a new name and a new personality and, thanks to the actor’s chameleonic talents, miraculously no-one noticed.

Martin McCardie believes the show to be blessed with greatness. “We are. And River City has given so many actors the chance to live and work in Scotland. There are actors like Jordan Young [he plays apprentice gangster Alex Murdoch] who are in great demand [in theatre and television] but he loves to work in the show, and having a young family it offers a great work/life balance. And River City has often reached out to the likes of Oran Mor theatre to find the upcoming talent.”

However, River City hasn’t moved abroad, in the way that High Road once travelled to South America. Is he disappointed? “It’s difficult to re-write a soap once it has begun for a foreign audience. But there’s an old-fashioned attitude that says it has to be sold abroad. I’m always saying that if you take our budget and compare it to other shows [that sell abroad], I think River City punches well above its weight. And I think the new half -hour episodes really stand out and are being given a big push on iPlayer.”

Indeed, what of the switch from one hour to half-hour shows? “As a writer I’ve written many of the one-hour shows. But I think a half-hour is better. Most of the one-hour episodes struggled to make the hour because you can’t fill in with domestic stories, you need big dramatic events, usually featuring a central character such as Lenny. Which excludes the ordinary tales, the flirtations, the fallouts. It’s now 10 scenes per episode and it means you can share those scenes with lots of actors.”

What’s the toughest part of the job? Is it working out if the arrival of Claire from Steps is a truly great idea? Or keeping the carousel going round with ever-changing faces? “Yes, that could be it. But we try to make sure that if people are moving on, we try to help them. We try to encourage actors to write if they’d like to, or direct. We try to make sure doors are always left open.”

What of the future of soaps? Neighbours has gone. Can River City go another 20 years? “I’d love to think so. But viewing habits are changing. If you watch Ozark on Netflix you will probably binge-watch, so we want to offer that option with River City.

“But I have to add that we have great writers, great overall talent here. And we’re getting the encouragement from the BBC. And whatever happens I think the show has really established its cultural base within the history of television in Scotland. It’s all looking really good.

The producer adds, laughing: “So long as we hold on to Lenny Murdoch. My mother tells me if we drop the character I’ve not to bother coming round any more.”