Screenwriter Zak Penn had every reason to believe that Ernest Cline's bestseller "Ready Player One" could never become a movie.

When screenwriter Zak Penn read galleys in 2011 for Ernest Cline’s “Ready Player One,” he had a thought: “This will never get made.” The sprawling novel was wall to wall with ’80s references, everything from movies “The Adventures of Buckaroo Banzai,” “Batman” and “Back to the Future” to video games Halo, Minecraft, Tomb Raider, and Dungeons and Dragons.

“It was so enormous, the scope was so huge,” Penn said in a phone interview. “It would cost $250 million. This guy sucked every interest I have in my brain and put it into a book. It appealed on a visceral level, but as a job, ‘This isn’t going to happen.'”

Two years later, the writer of MCU movies like “X-Men: The Last Stand” and “The Avengers” reconsidered. Penn realized that his nostalgic 2014 documentary “Atari: Game Over” — in which Cline was a subject — was perfect preparation for adapting this cinematic valentine to ’80s pop culture. By now, the book was a New York Times bestseller and producer Donald De Line set up the adaptation at Warner Bros., where Cline had already submitted a few drafts of his own. (Besides, Warners owed Penn some money.)

Penn wrote a first draft in six weeks and was shocked when the studio landed fantasy directing choice Steven Spielberg; Penn had worked as a DreamWorks scribe two decades ago on “Suspect Zero,” “Antz,” and “Men in Black.” Penn’s take on “Ready Player One” sold Spielberg on the movie, and sucked up three years of the writer’s life; he was needed throughout the insanely ambitious $190-million production. Let us count the ways.

Jaap Buitendijk

1. Find a hero’s journey

The book had classic zero-to-hero architecture; cracking the script meant condensing time and keeping the audience guessing. Like James Cameron in “Terminator 2,” “you first show the liquid metal,” said Penn, “then explain it later. Once you believe it, you don’t have to spend much time talking about it. How much do you need to know about all this? It’s like how many soldiers you put onscreen in ‘Dunkirk;’ it’s just the fabric of the background.”

So Penn abandoned the book’s linear timeline and started five years later in 2045 Columbus, Ohio as orphan Wade Watts (“Mud” star Tye Sheridan), who lives with his aunt in a rickety trailer perched high in the Jenga-rigged The Stacks, fills us in on the digital alternate universe OASIS, where he becomes alter ego Parzival and the dystopian population escapes their hopeless lives via VR headsets and haptic body gear.

2. Give your hero a lively posse

While Cline’s story is narrated by Wade, the movie embraces many character perspectives. From the start, Penn pulled Cline in to brainstorm; the two men share the final screenplay credit. “We expanded it out to multiple points of view,” said Penn. “It’s not ‘Taxi Driver.'” The movie gives more screen time to Parzival’s OASIS chums the High Five, especially romantic interest Samantha/Art3mis (Olivia Cooke), who underwent the most changes from the book in order to give her a more active role in fighting against IOI CEO Nolan Sorrento (“Star Wars: Rogue One” villain Ben Mendelsohn) for control of the digital playground. Said Penn, “We can’t have her off screen, or the whole movie is not going to work.”

Jaap Buitendijk

The writers heightened the strengths and weakness of the High Five, so they weren’t all equally geeky in the same way. “We tried to mix it up,” said Penn. “Aech builds all this stuff that was not in the book.” The writers also made Samantha/Art3mis more physically capable than Wade, who “had total knowledge of Halliday, an emotional understanding. But he’s not the toughest. Art3mis comes from a different world, she is capable. She was the person who’d have the best chance inside IOI headquarters during the final battle.”

3. Make your villain attractively loathsome

Like most villains, Sorrento thinks he’s right and reasonable. “The kids and their OASIS shit drive him crazy,” said Penn. “He thinks the world is going to hell, like Cheney or Ailes. He’s cynical to a fault and saying, ‘I’ll do whatever it takes, the truth is none of these people see what the real problem is.’ That could have come off as just an unpleasant, not-so-funny guy.”

But Australian chameleon Mendelsohn ran with it. “He’s a dangerous actor,” said Penn. “Like De Niro, you feel that he’s a second away from breaking and hurting somebody. He’s got a lot of coiled-up emotion behind his eyes. He’s great at putting on a smile and a sardonic attitude above a very damaged person.”

Warner Bros. Pictures

4. Nail the licensing

Since the book relied heavily on ’80 iconography, Penn’s rewrites kept changing to match the approved licensing, even as the movie moved into production. This affected everything from the artifacts designed by the art department to the scenes cleared for motion-capture in OASIS.

Warners placed more than 1,000 properties in the movie, which puts Batman on Mount Everest, Parzival in a “Back to the Future” DeLorean DMC-12, and disguises him as Clark Kent, David Bowie, and Buckaroo Banzai before throwing him on the dance floor to “Staying Alive,” using Chucky as a lethal weapon. (Despite best efforts to slip in references to Spielberg’s movies, he insisted on cutting most of them out.)

Penn pointed out that not everything in the film was from the ’80s; “Saturday Night Fever,” “Alien” and “The Iron Giant” were from the ’70s. After all, if Aech was going to build a gigantic robot, “Why limit yourself?”

5. Listen to Spielberg

Penn has the snark, Spielberg brought the heart. “When I first saw the movie, I saw how effective the relationship was between the two main characters,” Penn said. “I’m more snarky and skeptical of love plots in movies. This is all Steven. I certainly contributed the structural stuff and sense of humor.”

Spielberg made Penn’s job more difficult by demanding more live action, less animation. “Steven really pushed me and himself, intercutting between the real world and the OASIS,” said Penn.

Collaboration became key during production, especially with the OASIS sequences storyboarded with animatics and shot with motion-capture technology. Spielberg even used his iPhone to shoot many storyboard shots, and would email them to Penn.

Penn said the effort was well worth it. “When I saw the movie, that’s what gives its lyrical quality,” he said. “You’re not just lying down in your attic with your avatar. He wanted to constantly show people moving in the real world. He had a visual sense of where it was all heading. That made it hard to construct the plot. And you can’t change the blocking much.”

The shooting schedule was only 67 days; Penn believes if anyone else directed this movie, it would have cost $250 million. “He worked his ass off,” said Penn. “So did everybody else. That’s how we were able to do it.”

But Spielberg is known for shooting on the fly, and when he did make on-set changes, he needed Penn to round off the edges. “You can’t stop Steven from improvising,” said Penn. “That’s what makes him a great director. He does not want you to see the seams. He had panicked moments at the end of the day: ‘I cut this, oh my god, how are we going to get into the next scene?'”

Even with a carefully interlocked script, Spielberg’s rigorous editing meant entire sequences came out. “That made it harder for him in editorial, but that’s part of the process,” said Penn, who even provided voiceover dialogue to help transitions.

6. Keep the sci-fi grounded in reality

Like all good sci-fi, “Ready Player One” jumps ahead into a future that reveals exactly where we are now, from video game escapism to social media role-playing. Penn has three teenagers — 13, 14, and 16. “I’m in the heart of it,” he said. “It’s not news, it’s barely a metaphor. It’s here already; the only difference is the headsets and the exciting stuff you can do. Most people already live this on Instagram or whatever as they are creating a persona online. That’s happened. The question of whether virtual reality makes that better or worse —social media is already causing a lot of the problems we’re talking about. I’ve seen a party where all the kids are on phones texting each other. At least in VR, they’re looking at each other’s avatars.”

Eric Charbonneau/REX/Shutterstock

Sign Up: Stay on top of the latest breaking film and TV news! Sign up for our Email Newsletters here.