It took over a decade of creative labor and business savvy to build up the Marvel Cinematic Universe, and in the end, the hardest thing about assembling the Avengers was getting them all in one room at the same time.
The climactic sequence of Avengers: Endgame pits the movie franchise's original half-dozen heroes and a few newer additions in an all-out cosmic battle with Thanos (Josh Brolin), and once Hulk (Mark Ruffalo) is able to undo the giant purple villain's genocidal finger snap, the rest of the extended Avengers are brought back to life and able to join in the fight. It marked the first time that the heroes of all 21 MCU movies shared one scene together, and it required triumphs of both storytelling and scheduling.
The entire sequence was shot in a block of additional photography after Avengers: Infinity War and Endgame were shot back to back. The five-week block, which stretched between September and October, brought back a whole squadron of stars who had long since moved on to other projects, largely in different waves based on availability, according to Weta's Matt Aitken, who served as the visual effects supervisor on the massive sequence.
"They did an incredible job on the Avengers assemble shot where everybody's coming out the portal just before they charge," Aitken says. "Everybody's there for that shot, and that was an incredible day on set. But there were also times where it was just not possible to get everybody in place, because these are all world-class, A-list actors. There were near forty A-listers in this film."
So for the most part, the vast and complicated battle, which looked as if a cosmic war broke out during a prime-time celebrity telethon being broadcast live from Comic-Con, required a two-track production: close-ups on whichever individual actors were available at that time paired with cutting-edge visual effects technology that could create actors from (mostly) scratch.
The re-animated Avengers come to the battle, which is being waged in upstate New York, via several different portals that open up on the planets where they had died in Infinity War. The production on the moment that a portal opened on Planet Titan, Thanos' home planet, is a solid microcosm of the piecemeal way all the Avengers were assembled. Several members of the Guardians of the Galaxy, as well as Doctor Strange (Benedict Cumberbatch) and Spider-Man (Tom Holland), all hop from Titan to Tarrytown, and while it looks like they emerge together, that was far from the case.
"We've got Drax (Dave Bautista) and Mantis (Pom Klementieff) and Strange, and then we see Peter Quill (Chris Pratt) flying in, and all this fighting turns up and the crowd goes wild," Aitken says. "They were almost all shot at separate times. Drax and Mantis were able to be there at the same time, but we had stand-ins for everybody else. Quill was on his own pass. Doctor Strange was around, but he was on wires, so he was up in the air, so he was a separate pass. Tom Holland was only available for very short periods of time towards the end of that block, so we had to put him in his own pass as well."
That made for plenty of face replacement in the segment, but Weta, in this case, was at least able to use footage shot of the actors themselves, meant specifically for the moments in question. The larger shots, more epic in scope and filled to the brim with Avengers, Wakandan warriors, and various villainous aliens, were made digitally, with a 3D camera positioned high up in the field.
There's one shot in particular, with the camera drifting backward and all the portals lined up in the left side of the frame, that sees all the heroes back on earth and charging toward Thanos' hordes — and it was all done in Weta's powerful computers.
"We've got digital doubles in that one shot for pretty much any lead character who has ever appeared in any of the Avengers," Aitken says. "We've got digi-doubles for everybody, and I think there's maybe 35 or 40 lead digital doubles in that one shot."
Because the battle was so massive, the main characters were in some ways the least of Weta's worries on those huge clashes. The course of the front-line action was determined by the Russos and their team, along with the previs team at Third Floor Studios. Weta animated much of the rest of the action -- during some of the wider shots, they had tens of thousands of digitally rendered warriors on each side, created by crowd simulation software; the sheer scope of the digital armies was matched perhaps only by what Weta did for the grand finale of the Lord of the Rings trilogy.
These were not homogeneous fighting forces, but instead a number of different kinds of warriors with distinct combat styles. In order to reflect that in the film, Aitken, some stunt coordinators, and several stunt actors went to the motion capture stage and, armed with notes about how each different force — from Wakandans, Ravagers, and Sorcerers to Chitauri, Outriders, and Sakaarans — throws down on the battlefield, played out a different combination of hand-to-hand combat between the various supporting fighters.
"Let's say Wakandan warriors, and they're gonna take on a group of four Sakaaran soldiers from Thanos' side," Aitken says, describing a typical recorded vignette. "So we'll work up some specifics on how might that fight transpire them and how would we reflect the strengths of the individual fighting styles of these armies in those vignettes, and we'll record on the motion capture stage, doing different passes up there."
The team took those fighting models and used them to produce thousands of iterations of combat throughout the massive sequence, turning it into one of the biggest battles ever seen on screen — one that had Weta delivering shots down to days before the premiere date.