LOS ANGELES: Neil Armstrong went down in history as the first person on the moon, but it was the personal sacrifices and challenges along his journey that most interested the makers of movie First Man.

First Man, opening worldwide this week, places audiences inside the bone-rattling, deafening, claustrophobic cockpits inhabited by Armstrong and his fellow astronauts in the risky early days of the US space program.

Armstrong’s personal life held its own terrors, screenwriter Josh Singer discovered during three years of research, including a daughter who died at age two.

Armstrong and the early astronauts lived “with death nipping at their heels,” Singer told Reuters.

“Learning how much they sacrificed and how much harder it was than I thought only made Neil’s grace in the face of all this loss and tragedy much more remarkable.”

First Man is set between 1961-69 and covers the X-15 hypersonic flight tests, and the sometimes fatal Gemini and early Apollo missions preceding the 1969 Apollo 11 moon landing.

Director Damien Chazelle “wanted you to be on the edge of your seat. He wanted you to feel how challenging and visceral these missions were, and the fact that the personal narrative reinforces that,” Singer said.

Armstrong, played by Ryan Gosling, died in 2012 but had given his permission for a movie based on his 2005 official biography by James R Hansen.

For the screenplay, Singer needed to dig deeper. He spoke at length not only with Armstrong’s first wife Janet, but also his sons Rick and Mark, sister June, and dozens of astronauts, NASA technicians, trainers and test pilots.

“Neil was emotionally tightly-packaged. He was not a guy who was incredibly revealing,” Singer said.

Researching the mission side was even more challenging. Singer obtained pilot notes, technical manuals, transcripts and diagrams in order to envisage conditions in the cramped flight capsules and the quick decisions required in moments of danger.

The result, says Singer, produced a new spin on the space movie genre, whose roster includes theThe Right Stuff (1983) and Apollo 13 (1995).

“My appreciation not just of Neil as a hero, but of the family, only increased the more I studied him,” said Singer, who won a screenplay Oscar for 2015 Catholic Church sex abuse scandal movie Spotlight.

After a recent screening of First Man, Mark Armstrong told the audience that he was often asked what it was like to grow up the son of the first man on the moon.

"Mark pointed at the film and said, ‘This is the answer.’ To me that was somehow the most rewarding surprise of all,” Singer said.