In Weir’s Project Hail Mary (Ballantine, May.), amnesiac astronaut Ryland Grace must piece together his past in order to save humanity from an impending crisis.

What inspired Project Hail Mary?

I had a book I was working on for quite some time before deciding it just wasn’t working. But there were a couple of storytelling elements there that I thought were really cool; one of them was a character who had an unbelievable amount of secret authority. She could say the word, and any government would obey her. So I took that and also the idea of a mass-conversion spacecraft fuel, a fuel that is the most efficient possible. Then I had an unrelated idea, just bouncing around in my head, of a guy who wakes up with amnesia, and he’s aboard a spaceship. So it was like I had a bunch of spare parts in my workshop, and I put them together into something that worked.

How did writing this differ from writing The Martian?

I was very conscious that I didn’t want to repeat story lines from The Martian. Grace is a scientist by himself on a big expensive space mission; the stakes are very different, but it’s still a similar story. So, first off I tried to make sure he didn’t have any of the same problems as The Martian’s hero. His equipment always works; he never has any problem with food. I also tried to make his personality very different. Grace is a scientist, a researcher, kind of a high-minded guy. He’s also a Boy Scout in a lot of ways, maybe a little naive in a lot of ways, too.

How did you decide on the level of humor?

I’m a smartass myself, so smartass comments come naturally to me. For me, humor is like the secret weapon of exposition. If you make exposition funny, the reader will forgive any amount of it. And in science fiction—especially with my self-imposed restriction that I want to be as scientifically accurate as possible—you end up spending a lot of time doing exposition.

The novel feels fundamentally optimistic. Where does that optimism come from for you?

It’s weird. Now things are great, but I’ve at times had a difficult life; I struggled with depression and at times was very poor, but I’ve always had this high faith in humanity. You never read in the news, “Oh, some guy broke his leg, and some guy who doesn’t know him called 911,” because it’s absolutely normal for humans to go out of their way to help each other. I also think the future’s always going to be better than the past. It’s easy to look at localized events and say, “We’re going to hell in a handbasket,” but if you take a broader view and ask yourself whether you’d rather live today or any multiple of a 100 years ago, you’re probably going to pick today. We as species continually make our collective lives better.