THERE’S a Dalek on the loose and someone’s just asked it for a selfie. It stops and surveys the puny human. Its ray gun twitches like it’s thinking what to do next and whether to exterminate. “Proceed with your photo opportunity,” it says and then, once the picture’s been taken, it starts to move forward again, pushing its way through the crowd. “Move aside,” it says. “Move aside for the superior species!”

To be fair, most of the people round the Dalek just step aside without giving it a second glance because they’re used to this kind of thing: aliens mixing with humans, the fictional with the real, the famous with the non-famous. Somewhere in the room, a man dressed as the seventh Doctor Who is meeting the actual seventh Doctor Who. There are also several Harry Potters on the go, a Superman, and some of the walking dead as well as lots and lots of fans who have come dressed as themselves. And in the background, played by a live band, are the theme tunes of their loves: Star Wars, Star Trek, Doctor Who and Indiana Jones.

On the surface, what’s happening is this: a group of science fiction fans is holding a convention at the Corn Exchange in Edinburgh to raise money for the children’s hospice charity CHAS. They are dressing up, they’re playing around, they’re buying merchandise and getting autographs, they’re having a great time. But, under the surface, something different and more profound is happening: a powerful emotional effect is at work, a kind of therapy, or cure, a forcefield, and as a Doctor Who fan myself, I can feel it. Thousands of people have come to this room to be as close to themselves as possible; some of them are putting on make-up and latex and plastic not to hide who they are but to reveal it.

Of course, the convention is about plenty of other things too, like money. The profits that the organisers make will go to CHAS (last year it was £70,000), but everyone knows there’s a lot of money to be made at science-fiction events – by the traders who sell merchandise and by the actors who sell their autographs and pictures for around £20 a pop. I speak to one of them, the 82-year-old actor Julian Glover who’s been in everything, sometimes several times (Doctor Who, Indiana Jones and the Last Crusade, Star Wars, and Blake’s Seven) and he’s pretty honest about why he comes to events like these. “Because I make money out of them,” he says. “That’s the point of coming.”

But money is obviously only one of the motivators for this big, excitable event, and not the most important either. Almost as soon as science-fiction was invented, fans started to get together in groups to talk about it and that’s when people realised, as they do, that there was cash to be made. But today I’m going to wander through the hall to try to get a sense of what is really happening: why people come, and what it means to them.

At the back of the room I meet a group of fans who’ve all come dressed as various Doctor Whos and companions. Kyle Edgecomb, who’s 22, looks splendid as Tom Baker complete with scarf, curly wig and sonic screwdriver; 22-year-old James Hodge is brandishing a question-mark umbrella as Sylvester McCoy; and 17-year-old Phoenix Sibbald is the Doctor’s companion Rose, as played by Billie Piper.

One of the group, 25-year-old Megan Meikle, who’s come as the most recent Doctor and the first female one, says she has only just met the rest of the group, but they have already bonded over their love for Doctor Who. This is how fandom works, says Megan - fans find a common ground, a common comfort.

“A lot of people come from backgrounds where they’ve been bullied because they’re different, geeky or there’s depression or anxiety,” says Megan. “They’ve been bullied because of that and here it doesn’t matter – you could be anything under the sun and people would say yeah that’s cool.” Geeks are also no longer the despised minority they once were, says Megan. “Geeks have inherited the earth!” she says.

I carry on round the hall, past the life-size landspeeder from Star Wars and the pocket-size display of the characters from Thunderbirds and get talking to 25-year-old Bee Parkinson from Kirkcaldy. Bee has painted her face yellow and has a pair of giant tentacles sprouting from her head. She tells me that she is a combination of two characters: Rapunzel and the alien Twi’lek from Star Wars; this is her own creation, she says, and no-one does cosplay like it (cosplay means costume play or dressing up as your favourite characters).

Bee, who does careers advice as a day job but also writes and performs, has two powerful reasons for doing what she does. She tells me how she first got into science fiction, watching Star Trek with her dad when she was five years old, and, 20 years on, watching the show and others like it is a way for her to time-travel in a way, back to the warm childhood feeling.

“If you’re a creative person,” she says, “you’re always going to be in touch with your inner child because when you’re a child anything is possible. There could be fairies, there could be trolls, there could be gnomes, there could be anything. And then you become an adult and people tell you ‘no this is the way you behave’, it takes that away from you. But you’ve got to keep that because it opens your mind.”

Science-fiction, and cosplaying, have also helped Bee deal with personal problems in her life. For a time, she was in an abusive relationship, and after she escaped cosplay was a way for her to take on a character and find strength that she didn’t necessarily have as herself.

“I was living by myself,” she says, “I was vulnerable, I was being stalked, so it was very difficult for me and I was struggling with mental health issues so going and doing the cosplay, it gave me the opportunity to be somebody else and get back to where I wanted to be.”

It’s a perfect example of the effect of science fiction, the fan’s forcefield – the protective shield that their favourite programmes, comics and characters offer – but there is one technical hitch with the forcefield: it does not work everywhere. Step outside the protective confines of a convention and not everyone is quite so understanding.

“We’ve had a lot of people laughing at us and pointing at us in the street but depending on the character you are, you have to be really careful how you act. You have to keep going. It certainly tests you because most of the time if you have an entire train carriage of people laughing at you, you could get angry, but you can’t afford to do that.”

And the good news is things aren’t as bad as they used to be. Near a giant replica of Jabba the Hutt, the giant slug from Star Wars, I meet Keith Armour, the Edinburgh man who has organised the convention for the last three years, and he tells me how geek culture has become increasingly mainstream – thanks in large part, he thinks, to Netflix and all the science-fiction channels. A teenager I get talking to near the autograph queues, 17-year-old Bethan Dow, says the same thing. “It’s sort of a big thing now,” she says, although she’s careful to add a warning: “there is always that stigma of ‘don’t take it too far’.

What Armour has done with his convention is tap into this change to attract some 7000 people to the event over the weekend. And Armour is pretty much just like any of the other fans who have come to the convention: his first experience of science fiction was being taken to see The Empire Strikes Back by his uncles and that was it: hooked. He now builds costumes, collects memorabilia and has a Star Wars room in his house.

Armour also understands the idea of the fan forcefield: science fiction as emotional enrichment, support and protection. For a time, he was struggling to cope with a series of bereavements – he lost his mother, then his grandmother, then his uncle – and he was made redundant. “I’ve suffered from anxiety and depression,” he says. “and I care for my daughter who’s a type one diabetic. So, for me this is my only way of doing something positive to try and pick me up.”

I carry on touring the hall and reach the meet-and-greet zone, where the stars sit at little tables and sign autographs, and it’s here that I talk to the actor and Doctor Who star Julian Glover. He says he has grown to understand what is happening at conventions like this one and how much the fans get out of it.

“When I started out, I used to scoff ‘oh, how pathetic all these people in these costumes’,” he says, “But it’s not at all pathetic – a lot of work goes into it and they really care. And I’ve grown to like them very much. Outsiders might think it’s rather weird but in fact all these people have a hobby, and this is it.” It can still be bewildering sometimes though – people can get fixated, says Glover, and he has a few people who follow him round the country, getting the same autograph over and over again. “I say ‘you don’t want another photograph, do you?’ and they do, and it costs them £20. Oh all right, thankyou very much.”

The truth is that work of this kind offers a bit of income when work of other kinds is not forthcoming, even for those you’ve probably never heard of, like stunt doubles or walk-ons – they too can sell their images and signatures for a couple of tenners. Some might see it as a little exploitative. Some might even look at actors selling their autographs and think it’s just as sad as fans wanting to buy them. But all the actors are doing is making a little bit of money out of something that is hugely positive: for a time, negative stuff in the fans’ lives doesn’t matter or is forgotten. They are behind the forcefield: happy, together and protected.