Movies have a lot of moving parts. Movies that involve complex scientific elements, doubly so.

It takes hundreds of people to produce the finished product that we see in the theaters, but there’s one role in the filmmaking process that often goes unheralded: the science consultant. These experts help filmmakers reconcile real world logic with the fantastical logic of our favorite films, to make the stories believable. Often brought in during the early stages of production, they are resources for the creative teams working on films.

Much of Hollywood’s science consulting comes from an organization that’s a part of the National Academy of Sciences, called the Science & Entertainment Exchange.

The Science & Entertainment Exchange was formed seven years ago in 2009, and acts as something of matchmaking service between Hollywood and the science community. When Hollywood has a question about science as it pertains to a film, the Science & Entertainment Exchange does its best to find a member of the science and engineering community to lend some expert advice.

“Our mission is effectively to inspire more and better science in feature films, TV shows and video games,” says Rick Loverd, the director of the Science & Entertainment Exchange Program.

The Science & Entertainment Exchange has consulted on over 1400 projects in the last seven years. With the exception of Deadpool, the Exchange has consulted on every Marvel film since Iron Man 2. It’s also had scientists consult for the likes of Marvel’s Agents of S.H.I.E.L.D., Fringe and Eureka!, along with Big Hero 6 and Frozen.

But what does a consult entail, exactly?

“Our philosophy is one of inspiration,” says Loverd. “We’re not trying to go in and fact check every detail in a film or video game or come in with an attitude of ‘Hollywood’s getting it wrong,’ necessarily — we’re just trying to get them excited about what the real science is and expose them to the best communicators that the science and engineering community has to offer.”

One such communicator is Professor James Kakalios, the author of The Physics of Superheroes and science consultant for Watchmen and The Amazing Spider-Man.

For Watchmen, Kakalios was brought in a few months before principal photography began. The script was complete, but the filmmakers were looking for some guidance to accurately decorate the set (for example, making sure a science lab appeared period-correct in a film that spans several decades) and learn more about the theoretical explanations behind some of the phenomena in the film.

“Basically, they were trying to get the settings right,” says Kakalios. “They wanted to understand how you could possibly make the powers work, not so much because it would directly impact the script, but that would inform them in their production design and art design choices.”

Kakalios’s involvement in The Amazing Spider-Man was a little different, though. When he began consulting for the film, the script hadn’t yet been finished and the team was in the brainstorming stage for some of the film’s major turns. Kakalios provided input and advice on the foundation and fundamentals of Spider-Man’s powers, answering questions about the strength of his web and his ability to crawl up walls. Knowing that the villain was going to be The Lizard, the writers wanted to know what kind of a surface a lizard might be able to scale that Spider-Man could not.

As it so often goes with brainstorming sessions, much of what was talked about didn’t end up in the film, but remained as part of the theory supporting the in-movie logic. One thing that did end up in the movie, though, is a complex-looking mathematical equation that Kakalios came up with.

For the film’s MacGuffin — that is, the problem that Peter Parker & Co. would be trying to resolve as the plot progressed — the team wanted something that looked complex, and possibly related to Peter Parker’s father’s work in cellular regeneration and human mortality.

After spending some quality time with longevity and mortality research, Kakalios came up with a modified version of the Gompertz equation, a mathematical model for growth. Kakalios remixed and rearranged the equation, then added some of what he calls “mathematical glitter” so that it didn’t much resemble anything existing in the real-world scientific paradigm, but would look sufficiently complex and interesting for audiences.

Though the two projects were somewhat different in their approaches and use of a science consultant, the goal remains a relative constant in all projects that make use of an expert as a resource.

“They’re trying to create a believable fake reality,” says Kakalios. “Because they know that any moment when the audience is saying, ‘That’s not what a science lab really looks like,’ or ‘That’s not the way a physicist would react,’ or ‘That’s not the way this is done,’ is a moment when they’re not paying attention to the story.”

The sole objective of science consulting is not being correct or totally scientifically accurate, though. Instead, it’s about making sure that the questions that occur to the audience are “refrigerator questions” — the kind that only occur to you once the film’s over and you’re back at home in the real world, rummaging for a snack and thinking about the movie.

A big part of what science consultants do is reconciling real world logic with in-movie logic, something that Kakalios is familiar with thanks to his work examining the physics of superheroes and teaching a class on the subject at the University of Minnesota. Kakalios says that it’s not very useful to apply the laws of nature to every aspect of a character, because the logic breaks down pretty quickly and these stunning feats prove themselves impossible.

“That’s no fun,” says Kakalios. So, rather than taking the fun out of it, Kakalios grants a one-time exemption to the laws of nature and looks for systems within that framework, that particular suspension of disbelief. Creating an exception provides a meaningful constraint that may yield, as Kakalios calls it, “a believable fake reality.”

“It’s like the constraints of any sport — there are rules and regulations,” says Kakalios. “It’s a lot easier to move a football down a field if you’re allowed to go offsides or take an Uber from one end zone to the other, but that’s not how the game is played.”

Not every suggestion makes the cut, and not every film with a science consultant is focused on creating a totally plausible fact-checked diegesis.

“At the end of the day, it’s a visual medium, they’re trying to tell a story, and if you get everything 100% scientifically accurate and it’s a lousy story, and it’s boring, no one cares,” says Kakalios. “That’s the issue with being a consultant — you have to realize at the end of the day, sometimes they’re going to say, ‘You’re absolutely right, but we decided to do it this way because we thought it would make for a more exciting scene.”

Science consultants aren’t the fact-checkers of Hollywood, but they do infuse reality into fantastical storylines, effectively ushering them into the a real-world paradigm that we can learn from and understand. In the end, it’s not important that Vibranium isn’t real or that the equation that lead to The Lizard is just a remixed Gompertz function and some “mathematical glitter.” What is important is that the work of science consultants allows us to see and reflect upon scientifically-inspired pieces of our real world within spellbinding worlds of fiction.

Photos via Sony Pictures