Marvel movies are the most successful franchise in film history. Want to know how they do it?

This is the first in a series of “How to Write” articles.

Congratulations! You’ve just been hired as the writer of Marvel’s next superhero box-office smash hit. Still, as you shake Kevin Feige’s hand and sign on the dotted line, you can’t help but feel conflicted. As exciting a prospect as fulfilling your inner-child’s dream is, it’s also incredibly daunting. Your film will make millions (or even billions!) of dollars, be seen by millions of people worldwide, and thousands of toys will be made based on the characters you’re about to write. No pressure then.

Related: Ava DuVernay courted by Marvel for “diverse” superhero movie

But don’t worry! We’ll let you into a little secret: writing a Marvel movie is a walk in the park. All you have to do is follow a very simple formula that every single Marvel movie adheres to. Stick to our guide and your film will delight your bosses, critics, and superhero fans alike.

Step One: Introduce a powerful item

Start by introducing a really powerful item. This is your MacGuffin, and is essentially the device the whole plot will hang on. The bad guy is going to want to obtain this item to destroy an organization, the world, or the universe. And the good guy is going to try and stop the bad guy from using this item. It might be a mysterious, magical, ancient artifact like The Avengers‘ Tesseract.

“Doctor Zola, this will change the world.”

Or it could be an arc reactor. Or a Casket of Ancient Winters. Or The Aether. Or an Infinity Stone. It doesn’t really matter — just as long as you make it clear that it’s really powerful and can destroy the heroes home, or the home of someone they love, or the world, or the universe. Whatever, you only need to frame an entire film around it, don’t worry too much about the details.

“You think you can stop this? The Aether can not be destroyed!”

You can even have a character like Hulk or The Winter Soldier be your MacGuffin. If you’re struggling for ideas, you can always just reuse the same powerful item from the last Marvel movie. Heck, you can even just change the color of a previous powerful item and kill two birds with one (infinity) stone by having your artifact form part of the MacGuffin for the grand finale.
“Yondu! Listen to me! Ronan has something called an Infinity Stone.”

Step Two: The first battle

So, you’ve established a bad guy who wants to blow things up, and you’ve provided them with a powerful item that gives them the means to do just that. You’ve also got your hero, a recognizable comic book character who is in someway an unlikely or reluctant warrior. Again, these are just details. What you need to do now is set up the first battle. This might be a fight for the aforementioned item, though you might want to save that for the second battle. Instead, you could opt for a fun romp where the hero tries out their newly acquired abilities. If you’re writing a team-up movie, this will be the first time the superheros assemble and we get to see just how powerful or wacky they are. Or both.

“We gotta go. Come on, move with me. We got a plan, and we’re going to stick to it.”

Now the good guys never win this fight, even if it at first appears that they have. The enemy might appear to be defeated, or captured, or outsmarted. But that huge explosion didn’t kill the bad guy, and if they were captured, it was all a part of their grand plan. The key thing is that there was a really cool fight scene, and the hero comes out the other side of this battle with some personal motivation to stop the bad guy. Revenge, retrieval of the MacGuffin, realizing they work well as a team. It’s all good.

“Go get him! I can swim.”

Step Three: Inner turmoil

Now that your protagonist has fought off the bad guy, it’s time to give them a bit of depth. After all, who likes a vanilla superhero? Give them a bad-ass streak by making them battle with their own inner conflicts, or their superior’s orders, or each other. In Iron Man, Tony comes into conflict with Obadiah Stane. In Captain America, Rodgers disobeys his orders and rescues his friends. In Thor, the Norse god fights Shield. In Avengers, Age of Ultron, and Guardians of the Galaxy, the heroes turn on each other. You get the idea.

“Listen to me, that little witch is messing with your mind. You’re stronger than her, you’re smarter than her. You’re Bruce Banner!”

It’s from these scenes that Marvel will take the ominous shots of Iron Man’s damaged suit (or Captain America fighting Thor, or the Hulk in a straight jacket) and put them at the end of trailers to suggest darkness and, y’know, feeeeeeeelings. Don’t worry about resolving these inner conflicts though, because while the protagonists have been fighting among themselves, the bad guy has accelerated their plan ready to launch into…

“Do you want me to take him down, or would you rather send in more guys for him to beat up?”

Step Four: The second battle

That’s quite enough emotions for now. People don’t come to the cinema to feel things. They go to watch people punch each other and blow stuff up! And right on cue, the bad guy is back for round 2. Only this time, the stakes are higher and there’s more CGI. Loki is attacking the helicarrier! Ronan has come for the Infinity Stone! Ultron is creating the Vision! Avengers, assemble!

“These carriers can use the stone to mow down entire civilizations like wheat in a field.”

If they haven’t already got it, this is the sequence in which the bad guy secures their MacGuffin and starts work on their final, most dastardly plan. If they’ve already got the artifact, why not kill off one of the characters? You can literally pick whoever you want, because they won’t really die. They’ll be alive and okay by the end of the film, or in the post-credits sequence, or in the TV spin-off. Either way, the hero will lose this battle and experience the famous “all is lost” moment.

“Fury’s last words were not to trust anyone.”

Step Five: The final showdown

After finally overcoming their inner demons, the hero is now ready to take on the big bad. If it’s a team-up movie, they’ve all learnt to work together as said team. Now, take the total amount of enemies that appeared in the first and second fights, and times them by a thousand. Throw in as many CGI explosions and as much incoherent spectacle as you can possibly fit on screen in twenty minutes, and you have your final showdown.

“Dance off, bro. Me and you.”

In the carnage, the protagonists fight and defeat countless faceless enemies without any regard for the civilian life around them. With the hordes out of the way, the hero turns their attention to the main enemy, and they fight. It looks like the hero might lose, until they don’t. Finally, they defeat their antagonist, smugly spout a witty one-liner and go back to life as normal. Feel free to give them some character defining development here, like Iron Man giving up his suits. It really doesn’t matter, because any progression will only be ignored in the next installment.

“Puny god.”

Step Six: Cameo performances, plugs, post-credits

So, you’ve got your basic plot outline. But there are still a few missing ingredients that you need to add to the formula before you’ve got yourself the perfect Marvel movie. Throw in the obligatory Stan Lee cameo. I don’t know, give him something funny or interesting to say or do. Then you need to throw in a few references to the next three films in the franchise — these can go just about anywhere. Though you might want to save one for the post-credits scene, just so the audiences know to come back for Iron Man 17.

“Neither was Omaha Beach, blondie! Stop trying to scare us, come on!”

Congratulations! You’ve written your first Marvel movie! Fans are going to love it! Especially that bit at the end. You know, where the hero punches that guy? Classic! Oh by the way, Kevin Feige just called. He’s decided to add another six characters to the film, so you just need to completely re-write the whole script. That’s fine, right? Great. Anyway, congratulations again!

“Guess I’ll have to do it myself.”

What’s your favorite Marvel movie moment?

Related: What Joss Whedon should do next: A superfan’s wishlist