Tonight’s episode of Doctor Who – Can You Hear Me? – is something of a mental health special. No spoilers, I promise, but it’s safe to say that different characters across time and space are struggling. The team behind the programme wanted to make sure they got it right and approached Mind to help.

Mind runs a media advisory service that works with soaps, continual series and dramas to make sure that portrayals of mental health are accurate, sensitive and actively help to break down stigma. Over the years we have worked on hundreds of scripts and in that time we have seen both an increase in the overall number of storylines relating to mental health and a huge shift in the attitudes of programme makers; overwhelmingly there is a commitment to treating the issues with care and to making sure that what they are working on is true to life.

Doctor Who has a reputation for championing diversity and acting as a vehicle for important themes, and is no stranger to mental health problems. In the 15 years since it returned to our screens in 2005, mental health has often been explored as a facet of the human condition. Grief and isolation are recurring themes and over the years the variations iterations of the Doctor, their friends and their foes have gone through more than their fair share of problems. Tonight’s episode is complex, involving various diagnoses and issues, and it was a test of our advisory service – turns out our knowledge of attitudes to mental health in Aleppo in 1380 is nowhere near good enough.

We were approached by the writers of Doctor Who around eight months ago. After an initial phone chat, we got a glimpse of the first script. I regularly work on BBC programmes, but this was a completely different experience to the likes of an EastEnders or a Casualty script. Time travel, unfamiliar settings and monsters were all a bit bewildering at first and there were a few sentences about orbs and transmitters that I just didn’t understand. But at its heart this was an episode that showed how mental health problems affect people, regardless of era or location.

The first piece of advice we always give to researchers and writers is to take the time to develop the backstory of any character experiencing a mental health problem. Really thinking through who they are, what their diagnosis might be and how living with a particular mental health problem might affect their thoughts and actions is the best way to make sure that the eventual character is authentic, even if most of that detail isn’t shown on screen. Characters in this episode have experienced loneliness, grief, troubled childhoods and trauma, which were thoroughly explored as part of working on that first draft of the script.

In addition to helping develop characters, we also comb through scripts for unsafe depictions of suicide and self harm, stigmatising language, insensitive jokes, and anything else that we think might undermine an otherwise brilliant piece of writing. Done badly, a mental health storyline will these days attract a ferocious backlash from an increasingly vocal public that cares about how the issues are portrayed. But done well, it has the power to give a voice to the one in four of us who experience a mental health problem every year, make us feel less alone, and encourage people to seek support for the first time.

As well as advising on the script, we get involved in workshops with the actors to help bring the characters to life. Appropriately enough, we had to do the Doctor Who one virtually, since we were all spread across different places and time zones, sadly without a TARDIS. These workshops, which often include people with the same experiences as the characters, give actors a real opportunity to understand what it’s like to live with a mental health problem. It was clear, as is often the case, that the actors in this episode were taking this very seriously and were keen to do the issues justice.

For me, the overall message in this episode is that mental health problems have always affected us humans, regardless of who or where we live. It’s a fundamental part of who we are and yet only now are we starting to get to grips with how to talk about it, bring it out into the open, seek support and help each other. Programmes like Doctor Who are an important part of driving that shift in attitudes. Entertainment shows bring awareness of mental health problems and other issues into people’s living rooms in a unique way that can reach and touch people in a way that the news or a documentary might not.