While the Far From Home team spent countless hours hammering out how the film would address the ramifications of Endgame, the Fury line came easy, with co-writer Erik Sommers pitching it early in the process.

"It got a big laugh in the room. Everyone knew that's going to be in the trailer," Sommers' co-writer, Chris McKenna, tells The Hollywood Reporter. Adds Sommers: "That's just one of those jokes that popped up really early and just stuck with it the whole time."

It was Far From Home's mix of weighty topics and quick humor that made it such a challenge, as well as so much fun, for McKenna and Sommers to tackle. The duo, also known for comedy work on NBC's Community, have had a Marvel-filled few years. After working on Spider-Man: Homecoming (2017), they moved on to Ant-Man and the Wasp (2018) and were on set in Atlanta when they got the call to return to Los Angeles to write Far From Home.

The film opens Tuesday and sees Peter Parker head on a school trip to Europe as he tries to leave behind the stress of a superhero life in the wake of his mentor Tony Stark's (Robert Downey Jr.) death. Along the way, Fury ropes him into a mission to save the world, as he teams up with Mysterio (Jake Gyllenhaal), a hero from an alternate Earth who is battling a group of bad creatures called the Elementals.

In a conversation with THR, Sommers and McKenna look at how Holland's heartbreaking Infinity War performance informed Far From Home, react to Anthony Mackie's disappointment that Falcon didn't make it into their new movie, and discuss the long process of building a post-Endgame world.

What were your early goals with this movie as you sat down to work on it?

Chris McKenna: We had two mandates. One: coming off of Endgame, make sure we come up with a really fun Spider-Man movie. The second mandate was, yes, there are some things we have to be reacting to. Peter is coming off the events of Endgame, and that is going to inform the story. Back to mandate number one: have fun with it. We came to it with ton of ideas. ... The idea of going on a school trip came up pretty quickly, and then taking that school trip out away from New York in a Spider-Man movie finally felt like the fun, natural thing to do. From there, we started building a story around those ideas.

How early in your process did Mysterio and the Elementals come into play?

Erik Sommers: The school trip came up quite early in the process. Identifying who the exact villain was going to be didn't come up as early, but we did know that was a villain we were going to want to use, and it was just a matter of trying to find how he would fit in with that story and the themes we wanted to get across.

McKenna: He's an iconic character we could turn on his head. We were kicking around these classic villains like Hydro-Man and Molten Man and figuring out how to use those as these Elemental creatures. We were trying to figure out a way to use these iconic characters from Spider-Man comics and put a modern MCU spin on them.

We've done a few of these movies now, and some of the trickiest stuff is figuring out the villain plot of it all. That dictates so much of the plotting. We went down a lot of different roads. ... One of the early things we had was this idea of Peter getting pulled into a Nick Fury adventure. That really opened up a lot of the fun of the MCU and pairing them together. We could have, on the one hand, a fun, high school trip romp and on the other hand, have the Mission: Impossible spy storyline. It was a fun early mix from figuring out those two key ingredients.

Nobody knows Nick Fury better than Samuel L. Jackson. Is it intimidating to write for him? Do you hold your breath and see how he reacts when you give him a script?

Sommers: No, we were excited. Sure, a little nervous, but way more excited. "I get to write Nick Fury lines. This character who I love and have enjoyed in so many movies, and now I get to write those lines and I can't wait to hear him say this and I can't wait to hear him say that."

McKenna: Yeah, it would have been really scary if we were handing the pages right off to Sam Jackson. Luckily, there's a lot of people those pages go through who know Nick Fury pretty well too, and they were definitely the smell test. We definitely would have been frightened if we were dealing directly with Sam.

The line "Bitch, please. You've been to space" was a favorite from the trailer, so you clearly got Fury's voice down.

McKenna: That was one of our first jokes. I think it was Erik who pitched that one early on when we were first coming up with the storyline. It got a big laugh in the room. Everyone knew that's going to be in the trailer.

Sommers: It's funny how those work. Jokes pop up and end up in the movie at all stages. That's just one of those jokes that popped up really early and just stuck with it the whole time.

Director Jon Watts has said Michael Keaton's Vulture didn't really fit into this movie, as much as he loves the character and actor. Early on, did you consider working Vulture into Far From Home?

McKenna: I recall maybe that was floated, but I don't think there was ever any serious consideration about that for this movie.

How do you master writing dialogue for teenage characters? It seems like you are the go-to guys for that, with this and Jumanji: Welcome to the Jungle.

McKenna: I am never not on Snapchat. (Laughs) As a middle-aged man, it's nice to hear that somehow we are capturing how kids talk. If we were chasing the real patois of teenagers, it would feel kind of desperate. I'm sure [the lines] go through a little bit of a reworking. People make it their own.

Sommers: We both have little kids, but we both have nieces or nephews or cousins or whatnot who are teenagers. That helps a little. I also think the Internet and social media and stuff like that helps a couple of guys our age stay a little more aware of how people talk.

McKenna: If you try too hard to simulate, "Oh, this is how teenagers talk," then it probably will come across really forced and belabored. We'll be Steve Buscemi in 30 Rock. "What's up, fellow teenagers?"

Did seeing Tom's performance in Infinity War inform how you wrote him in this film?

McKenna: We all knew he was great, but that ending in Infinity War, it really shook me. It was an emotional, devastating moment. So much of this, we are being told plot points [as we write our films]. "Oh, this thing happens in Infinity War, and this other thing happens in Far From Home." We're not reading the scripts. We didn't even see Endgame until the premiere. But we did know that coming off of Infinity War, there's going to be an emotional bill to pay. That emotional moment [Peter's death], you know the reverse of that is going to be at the end of Endgame. It's going to be something we're going to have to deal with.

Peter just wants to have fun. As much as we're being told to have fun with it, we're like Peter. We want to avoid all that [dark] stuff, but ultimately, it's his avoiding all the darkness of Endgame that gets him into hot water in this movie.

You two had long conversations about the ramifications of Thanos' snap and of people suddenly returning in Endgame. How much world-building did you develop for the script that was ultimately cut to streamline things?

Sommers: There was an agreement among the whole creative team that we needed to address those things, but we needed to do it as efficiently and economically as possible so we could move past it and start enjoying the story of the movie. Early on, the idea was floated using the school news to do that, and that was just one of those key ideas that someone on the creative team had, and we all quickly saw how well that would work and allow us to do what we wanted, and it was really fun to do.

McKenna: There was the idea that Brad [Remy Hii] was a kid who was in elementary school and is now the school hunk and is this romantic rival, because he didn't blip and grew up while everyone else [was snapped]. It was one of those fun ideas that wove its way into where you deal with the mechanism of, "What did that look like?" This crazy thing that happens in Endgame, you don't really get a chance to see how the rest of the world reacts to that.

How many Easter eggs and references did you spell out in the script, and how much do you just know Jon and his team are going to add later?

McKenna: Jon is very cognizant of drawing from the MCU. Once we came up with the idea of that kid [Brad Davis], Jon immediately turned to one of the Marvel people and said "Can you get us the names of kids we can name this character after?" There's definitely an attempt to always draw on the Marvel universe when you can.

Anthony Mackie is jokingly upset he's not in Far From Home after it was revealed that was a possibility. What's the real story? Was there an outline where you had Mackie show up as Falcon or in his new title, Captain America?

McKenna: Not an outline, but as we were building toward the end of this movie, we were thinking about [who we could bring in]. It's always great to draw on MCU characters and bring them into the fold. Happy [Jon Favreau] and Nick Fury are such great characters. ... It could have been a day or less of going, "Hey, can we bring in someone like Falcon in to the third act?" and Peter sort of teaming up and sort of being a team leader and stepping up in that sort of way. So, it was discussed.