The Martian is a movie that shouldn’t have been made.

From Red Planet to Mission to Mars to John Carter, movies about Mars have consistently flopped at the box office. As Andy Weir, the author of the novel the movie is based on, pointed out in a recent episode of The Geek’s Guide to the Galaxy podcast, it’s been decades since any movie about the red planet has been a hit. These days, Hollywood studios have come to think of films about Earth’s nearest neighbor as carrying a box office curse. Indeed, Hollywood is so afraid of this effect on audiences that it cut the words "of Mars" from John Carter’s original title, John Carter of Mars. The movie bombed anyway.

But The Martian is different. For one thing, it's estimated to have made $55 million at the box office in one of the biggest October opening weekends ever, marking it as a bona fide hit. And while the science-driven survival tale is obviously a movie about Mars, it’s also very much a Ridley Scott film — a product of its director and his consistently bleak but ultimately noble vision of human existence.

Ridley Scott makes dark movies about human survival

Throughout his nearly four-decade career as a filmmaker, Scott, now 72, has gravitated toward dark tales of human survival.

Scott’s breakout film, 1979’s Alien, was a sci-fi/horror mashup (before such cross-genre experiments were common) that pitted the small, working-class crew of a long-haul space freighter against a not-so-subtly phallic alien that had evolved into a perfect predator. Ultimately, most of the crew dies, and the movie becomes a grueling showdown between the alien and a lone survivor, Lt. Ellen Ripley (Sigourney Weaver). In the end, Ripley kills the alien and reaches safety through a combination of physical perseverance and quick, rational thinking. Sure, it’s a creepy monster movie set in a spaceship, but it’s also an intensely psychological tale about the will to live against all odds.

It’s a tale that Scott has returned to, in various forms, over and over again. His follow-up, the seminal 1982 science fiction film Blade Runner, is another grim genre crossover, a futuristic detective film about an investigator, Rick Deckard (Harrison Ford), on the trail of a small band of Replicants — exceedingly lifelike robots outlawed on Earth. It’s essentially a chase film, and like Alien, it boasts a handful of surprisingly tense action sequences. But, also like Alien, it’s also a surprisingly moving existential meditation on what it means to be human. Ultimately, the movie suggests that it matters less whether someone is man or machine, but whether there’s a will to survive.

This idea — that the essence of humanity is the fight to live, even for just another hour or minute — is present in nearly all of Scott’s films, and essential in many of them. You can see it in movies as diverse as White Squall, a sea-survival story about a deadly storm, and G.I. Jane, a boot-camp picture about the first woman to join an elite Navy special forces unit. As in Alien, both films are structured as a series of escalating tests of physical ability, will, and ingenuity.

In a different way, the same idea is at the heart of Scott’s feminist-road-trip crime movie (how’s that for genre hopping?) Thelma & Louise, which ends with a freeze frame of its protagonists careening off a cliff. Whether they live or die, the ending seems to say, is less important than whether they do so on their own terms. It’s still a movie about will and survival — just one that’s about survival of the spirit.

This makes Ridley Scott the perfect director for The Martian

All of this makes Scott an incredibly apt fit for The Martian. Weir’s best-selling novel tells the story of Mark Watney, an astronaut left alone on Mars by mistake when a near-future NASA mission goes wrong. The story is driven by Watney’s efforts to create the conditions necessary for survival, which mainly means figuring out how to ensure he has enough air, water, and food to last years until a rescue mission arrives. Meanwhile, back on Earth, NASA and the engineers at the Jet Propulsion Laboratory race to put together the rescue mission.

Most chapters in the book revolve around solving some sort of engineering challenge, and the amount of math and technical information in the text is unusual even for a sci-fi novel. Weir’s habit of walking readers through the particulars of these challenges in wonky detail is the sort of thing that could have turned the novel into a slog, but it turns out to be a huge part of the book’s appeal. It’s essentially an extended Mars mission explainer in novel form.

Like so many of Scott’s films, The Martian is a survival story about the triumph of both the human spirit and the rational mind, one that’s structured as a series of problems to be solved. Weir has said that rather than a series of random, unrelated problems, he imagined the novel as an extended cascade failure, in which each problem led to a solution, which then led to another failure, and so on.

For the most part, Scott’s movie version, which relies on a script by Drew Goddard (The Cabin in the Woods), keeps the book's structure in place. Goddard’s adaptation cuts a few major episodes (including a run-in with a massive Martian sandstorm on Watney’s final rover journey) and changes a few beats at the end to make for a more dramatic, conventionally cinematic finale. But overall, the movie is surprisingly faithful to both the events and the language of the book.

While there’s not as much math in the film as there is in Weir’s novel, Goddard’s screenplay leaves much of the technical description intact, especially in the film’s first half. It’s not quite as nerdy as the book, but it’s probably as close as Hollywood will ever get to a Mars mission explainer in movie form.

It's still obvious The Martian is a Ridley Scott film

Scott’s guiding hand, however, is still easy to detect. Weir’s book is surprisingly lighthearted for a story about a man marooned on an unlivable planet for more than a year; Watney comes across as a funny smartass who stays essentially upbeat through the entire ordeal. Even when he’s staring death in the face, he tends to do it with a wink and a joke.

Scott’s film version gives Watney’s story a decidedly darker edge. Scott was making grim-and-gritty movies before grim-and-gritty movies were a thing, and his Martian is, unsurprisingly, far bleaker and more emotionally raw than Weir’s novel (though relatively lighthearted compared with most space disaster movies).

On screen, when Watney wakes up alone, injured, and without any means of communicating with Earth, it’s an incredibly harrowing moment of human weakness. In both the book and the movie, Watney says basically the same thing when that happens: "I’m pretty much fucked." In the book (it’s the opening line), it comes off almost as gallows humor; in the movie, the same line is shot through with a deep sense of despair that’s rarely, if ever, on display in the novel.

Part of the reason the movie is so much more intense is that it’s, by nature, a much more visual experience. Weir’s prose emphasizes technical explanation much more than visual description; in an interview with Adam Savage, Weir said that when the book was published commercially, his editor had to ask him to insert basic location descriptors for several scenes, which tended to rush into the engineering challenge at hand.

Scott, on the other hand, is one of modern cinema’s great visualists; he was a painter as a young man, and has long been known for his perfectionist’s eye as a director — and in particular for his emphasis on the intricate physical details of a movie’s setting. In Paul M. Sammon’s book Future Noir: The Making of Blade Runner (one of the greatest books ever written about the making of a movie), Scott defends Alien from critics who saw it as little more than elevated schlock horror by saying that the movie’s "environment was a statement. And, I think, a great piece of artwork," and similarly says that Blade Runner’s quasi-apocalyptic urban production design was its "statement." For Scott, essentially, a movie’s design — its look and sense of place — is often its reason for being.

Scott’s chilly but beautiful visual sensibility is a big part of what makes the movie version of The Martian feel so much bleaker than its novel counterpart. Along with cinematographer Dariusz Wolski, the director emphasizes Watney’s loneliness with gorgeously rendered vistas of the Martian desert, a rocky and yet stunning place where tornadoes swirl gracefully, and dangerously, in the background. Watney is often framed as a tiny creature struggling to make his way across the planet’s surface in shots that emphasize the planet’s utter indifference to his plight.

The essential difference is that Weir is an optimist — and Scott is definitely not. Indeed, Scott recently said that he thinks humanity is probably doomed in the near future. That’s not entirely surprising from the director of some of the darkest movies ever made; it’s not an accident that his previous film, The Counselor, was a collaboration with Cormac McCarthy, another storyteller whose work evinces a deep pessimism about human nature. But it does point to a tension in his work, which is often bleak in tone but tends to end in individual triumph.

Ultimately, Scott is both a nihilist and a humanist, someone who has little hope in humanity but a surprising amount of faith in the abilities of individual humans to survive. The tension between Scott’s broad pessimism and his narrow optimism is a big part of what makes his best movies — and The Martian is one of them — so great.