Walking through Barbican’s new science-fiction exhibition, “Into the Unknown”, is like walking through a nerd’s dream bedroom – and I say that as a nerd myself. A long, low-lit gallery, with black walls and a black floor, it’s cluttered with display cases of toys and trading cards, books and comics, film props and costumes and more. Over here is Darth Vader’s helmet, over there is Godzilla’s head. Over here is a screen flickering with film clips, over there is a mock-up of the set of “The Martian”.

Anyone who grew up reading “2000 AD ” and watching “Star Trek” will revert instantly to their 12-year-old self, but that’s not the only kind of nostalgia swirling around this Aladdin’s cave of geekery. One curious theme is that while the term “science-fiction” suggests robots and ray guns and the shape of things to come, a huge amount of it fixated on the past. This is a genre fuelled by nostalgia.

The proto-sci-fi novels of Jules Verne, Edgar Rice Burroughs and H. Ryder Haggard often sent their heroes over the sea and under the earth’s surface to discover new worlds. But these worlds, rather than being futuristic, tended to be populated by ape men and prehistoric monsters. Ever since, science fiction has been obsessed by creatures which died out 65m years, and “Into the Unknown” has terrific fun with this obsession. The first screen you see shows Laura Dern and Sam Neill gawping at a Brachiosaurus in “Jurassic Park”. Nearby is a herd of dinosaur models fashioned by the master of stop-motion animation, Ray Harryhausen. (They all have a mean look in their eyes, even the plant-eaters.) And further on you can peer at a Frank Hampson “Dan Dare” comic strip from 1957, in which Dan’s arch-enemy, the Mekon, explains his latest nefarious scheme: “Here, in New Guinea, my scientists have created a replica of the Earth, twenty million years ago, stocked with wild and prehistoric animals and plants from my Earth museum reservations on Venus.” The Mekon may have got his dates wrong by several million years, but what do you expect from a Venusian?

Poke around a few more exhibits, and you start to see science fiction less as a means of envisaging a fabulous future, and more as an excuse to throw together every schoolchild’s favourite bygone eras. A sketch drawn by Harryhausen for 1961’s “Mysterious Island” has a cowboy on horseback jabbing a Styracosaur with a lance – so you get the Wild West, jousting knights and dinosaurs in one picture. And James Gurney’s sunny “Dinotopia” paintings are set in the 19th century, but the cityscapes hark back to ancient Rome – and, yes, the citizens are riding on dinosaurs.

Prehistoric monsters aside, much of the sci-fi in “Into The Unknown” yearns for earlier, simpler times, when men were men, and women were waiting to be rescued. The helmets from “Stargate” are modelled on Egyptian gods. Kane’s spacesuit from “Alien”, with its overlapping pads and plates, is like samurai armour. And in the concept art for “Star Wars”, when it was still called “The Star Wars”, Luke Skywalker is a sword-wielding swashbuckler. Inevitably, time-travel stories are especially prone to fetishising the past. On video screens, there are clips from “Back to the Future”, released in 1985 and set in 1955, and “Donnie Darko”, released in 2001 and set in 1988.

When in Rome James Gurney’s “Dinotopia”

Where is the future in all of this? There are some technological utopias dotted around “Into The Unknown”. Posters from the 1940s and 1950s try to associate Firestone tyres and Seagram’s Canadian Whisky with the bright, clean, modernist “homes of tomorrow”. But these hopeful tableaux are far outnumbered by the dystopias. The majority of science fiction, it seems, has been inspired by a dreadful anxiety about the future rather than a desire to live in it.

The “homes of tomorrow” are usually located in hellish mega-cities: dirty, dangerous, semi-derelict and fit only for demolition. One screen has a montage of these concrete jungles being sluiced by tidal waves in various apocalyptic films, and an adjacent array of magazines has two topics: “Future Cities” and “End of the World”. (The final shot of a half-buried Statue of Liberty in 1968’s “Planet of the Apes” can be spotted on the covers of two different magazines, one published in 1953 and one in 1964.) And what happens after these overcrowded megalopolises are wiped off the face of the earth? Invariably, the survivors are depicted returning to a primitive existence of hunting with spears. Once again, the past trumps the future – although the fact that these scenarios involve lots of women in skimpy fur bikinis may account for some their appeal.

It’s true that “Into the Unknown”, with its emphasis on 20th-century pulp fiction, disregards the genre’s more optimistic and progressive works. But when I think of the sci-fi blockbusters I’ve seen recently, it’s striking how many of them fantasise about times gone by rather than what lies ahead. “Alien: Covenant” begins with its colonist heroes finding a lush wilderness where they can lead a pioneer lifestyle; “War for the Planet of the Apes” finishes with a similar image. “The Mummy” mashes up the Egypt of the pharaohs with the England of the Crusaders, and the opening scenes in “Wonder Woman” are set on an idealised Ancient Greek island. Even “Transformers: The Last Knight” has a prologue in the Dark Ages.

Maybe, then, the curators of the Barbican’s exhibition are onto something. Maybe what we crave from science fiction isn’t a journey “Into the Unknown”, but into the known. Maybe we don’t want a trip “Back to the Future”, but forward to the past.

Into the Unknown Barbican, London, until September 1st