A standing-room-only crowd of 600 or so heard Weir and Stephenson hold forth on the writing racket. Here are some gems from the conversation:

Start with the setting

How does Weir begin writing a novel? “It’s all about starting with the world-building, and then moving into the story,” he said. For “Artemis,” the former engineer sketched out the full design for a moon base, right down to how the domes for the habitats were built.

“I didn’t make a physical model, but I made maps,” Weir said.

For the moonbase builders out there, Artemis’ domes have two 6-centimeter-thick layers of aluminum, with a meter of ground-up lunar rock in between. The space between the aluminum layers is segmented into triangular compartments with pressure sensors. If any one compartment is breached, the sensors immediately alert Artemis’ managers to make repairs.

Keep it real

Weir tried to keep “Artemis” — and “The Martian,” for that matter — as close to real-world science as he could. He said he hates to see inconsistencies in science fiction, and “real physics is excellent at maintaining consistency.”

That carried over to occasions when “Martian” film director Ridley Scott asked his advice. He recalled telling Scott that astronaut Mark Watney, the movie’s protagonist, wouldn’t pour toxic hydrazine fuel from one open container to another — and sure enough, Watney uses a sealed hose in the film scene.

“I’m glad you set Ridley straight on that one,” Stephenson cracked. “That would have ruined the movie for me.”

Weir admits there’s usually at least one bit of physics that ends up getting bent. In “The Martian,” it had to do with making the Red Planet’s winds stronger than they are in reality. Weir said “there is one bit of science in ‘Artemis’ that doesn’t exist in the real world,” but he avoided going into detail for fear of spoiling the story.

Give characters a reality check

The main character in “Artemis” is a down-on-her-luck, irreverent lunar porter who comes from a traditional Muslim family. Weir said he took pains to ensure that the character didn’t strike a wrong cultural note. The toughest part of the job was writing from a woman’s perspective, he said.

“Aerodynamics is easy,” he said. “Thinking like a woman is harder for me.”

Weir shared his manuscript with women ranging from his mother and his girlfriend to his editor’s boss, just to make sure the author’s voice rang true. “I took their advice, and made the changes accordingly,” he said.

Give the readers a rise

When Weir was asked about his favorite part of the “Martian” movie, he went with a scene that shows the countdown to the launch of crucial relief mission, the hopeful looks on the faces of the characters managing the mission, the liftoff of the rocket … and then the explosion that destroys the rocket.

“I hope I ripped your hearts right out of your ribcage,” he joked.

That got a rise out of the audience, but one of the biggest applause lines came when a questioner asked Weir which Hogwarts house Watney would go with if he were in a “Harry Potter” movie.

Favorite authors?

In response to another question, Weir said his favorite science-fiction author was Isaac Asimov. Stephenson followed up by picking Robert Heinlein. Then Weir added Arthur C. Clarke to fill out what he called the “holy trinity” of science fiction writers.

Weir included a tribute to Heinlein and one of his best-known novels, “The Moon Is a Harsh Mistress,” by having one of the characters in “Artemis” reflect on the rough realities of lunar life.

“The moon’s a mean old bitch,” the character says on page 4. “She doesn’t care why your suit fails. She just kills you when it does.”

Spaceflight, anyone?

Stephenson has been known to hang out at Blue Origin, the Seattle-area space venture that’s backed by Amazon billionaire Jeff Bezos. So it was natural for him to ask Weir whether he’d ever want to take a ride on a spaceship.

“No, no, no,” Weir replied. “I write about brave people, I’m not one of them. I would have no interest whatsoever in going into space. I don’t even like to fly. I’m right now in the middle of a book-tour death march … so, basically, as the end result, I’m popping Valium like Pez.”