When sci-fi author Andy Weir went to visit mission control at NASA’s Johnson Space Center, the International Space Station was going through a crisis—an air leak, to be precise. The leak soon set off cascading failures, but the flight controllers were just totally cool. “They have procedures for everything,” said Weir. “It’s like turn to emergency manual subsection 7 procedure 234a, and start following the steps.”

If you don’t remember this particular ISS emergency, well, it was a training simulation—part of Weir’s weeklong visit to JSC that was “wall to wall VIP tours.” So...since when has NASA started pulling out all the stops for novelists? Apparently, since Weir wrote The Martian, a bestselling book slash soon-to-be Matt Damon-headlined movie that is basically a giant advertisement for NASA’s unfunded human Mars mission.

Not that it was exactly Weir’s intention. His ascent to the nerd pantheon sounds almost as unlikely as humans stepping on Mars by 2030. When I met Weir at the NewSpace conference this weekend in San Jose, California, he was attending a gala to receive an award for his book. “I’m fidgeting with everything,” he apologized, monkeying once again with the cufflinks in his too-big dress shirt. He was still giddy with newfound fame.

NASA/James Blair and Lauren Harnett

Weir is a software engineer turned writer who began typing The Martian chapter by chapter on his blog in 2009. Eventually, his audience asked that the book be available in one place, so he began selling it in the Kindle store for 99 cents because Amazon wouldn’t let him give it away for free. The story got so popular that Broadway Books came knocking. And then Fox Movies. The movie directed by Ridley Scott and starring Matt Damon will come out in October this year.

At the core of The Martian is another fictional crisis in space—but one for which there is no emergency manual and certainly no subsections and procedures to follow. A freak accident leaves astronaut Mark Watney alone and wounded on Mars. To survive, he has only ingenuity and a couple, well, non-human friends that space geeks will be very excited to see appear.

The Martian is—and I mean this in the best way possible—the most riveting math problem you’ll ever read. Mark Watney has to figure out how to make food, oxygen, and water, and Weir’s science as he describes how Watney accomplishes those feats is meticulous. He even wrote programs to calculate the orbital paths of spaceships that appear in the book. “I did all my research on Google,” he says. The early readers on his blog checked his math.

The book’s scientific accuracy is part of why it’s played so well. “NASA really likes the book” says Weir. “They see it as an opportunity to reengage the public with space travel.” And NASA sorely needs it. For a Mars mission, the agency would need an estimated $80 to $100 billion over the next 20 years, which Congress so far has refused to authorize. NASA is currently building the Orion spacecraft and launch system that will take astronauts to an asteroid and then to Mars. But that last leap is still mostly a bunch of proposals and pretty infographics.

Earlier this month, NASA sent several officials to Comic-Con to promote the movie with Weir—and, of course, that daydream of a Mars mission. At the panel, planetary science director Jim Green called The Martian “required reading” at the agency.

“It’s definitely weird,” says Weir about his role as unofficial spokesman. “I always say don’t confuse enthusiasm with expertise. I just have to fool readers into believing I’m not full of shit. NASA actually has to make things work.”

For all of the book’s scientific details, NASA’s embrace of the The Martian likely has more to do with its spot-on human characterizations. On his grand tour of JSC, Weir spent a couple hours hanging out with Ellen Ochoa, the director of JSC, who he says told him, “For every character, I can tell you someone at NASA who has that exact personality.”

And then there’s the fact the book is really a paean to human spaceflight. Never mind that things go disastrously wrong. Never mind that an astronaut is stranded on Mars. However much we anthropomorphize our Philaes and our Curiosities and our New Horizons—it’s just not quite the same when it’s a fellow human walking around on Mars. The Martian reads like a convincing argument it's possible, if not totally free of risk. Now, NASA actually has make things work.