Flying crowds of creatures feature in 'Shang-Chi's' final showdown

How Weta Digital crafted autonomous character animation for the demons and phoenixes with Massive.

The third act of Marvel's Shang-Chi and the Legend of the Ten Rings includes a dramatic confrontation played out in the land of Ta Lo. Here, the soul-consuming Dweller-in-Darkness and its minions battle the hero characters, aided by a Chinese dragon called the Great Protector.

Amidst the battle are a swathe of flying demons which manage to exit from the Dark Gate to the Dweller's world. Bringing all those creatures together, along with their interaction with live-action photography and huge virtual environments, was WetaFX (formerly Weta Digital).

For the flying demons, in particular, which often needed to form in huge swarms, the VFX studio relied on Massive crowd simulations. Innovative techniques to handle flying crowd demons, and to deal with the swarms passing through narrow holes without colliding, were part of WetaFX's approach to the final shots.

The need for Massive

Thousands of flying creatures were required for the scenes, which is why WetaFX looked to Massive. The plan was to keyframe the hero creatures and use the crowd tool to supplement the shots.

"When it gets to crowd sizes of that many, we always need a more efficient way of dealing with these things," notes WetaFX animation supervisor Karl Rapley. "There were a lot of clear, obvious advantages for jumping in and getting some Massive going. It turned out really well."

Some of the classic crowd shots would feature hero animated demons close to the camera, with many of them tailing off into the distance. "The sheer numbers meant we needed Massive," says WetaFX Massive supervisor Jon Allitt. "There were thousands of them in some shots."

Indeed, some early simulations featured up to 16,000 Massive demons, which was ultimately scaled down to around 4,000 for the swarms around the Dweller-in-Darkness and the Great Protector.

Time to fly

While Massive might be most well-known for creating crowds of bipedal characters on flat plains, like armies fighting against each other, on Shang-Chi, WetaFX instead implemented the tool for predominantly flying shots, often with large camera moves. This involved incorporating realistic flying controls into the behaviour of the demon agents.

"When you're flying," outlines Allitt, "you can either cheat or you can try and do it properly, and I always err on the side of trying to do it properly, where you've got a yaw pitch and a roll control like you would in an aircraft."

Approaching the flying this way gave a more natural feel to the demons, but it was also a more difficult aspect to control. "It's very easy for things to get bent out of shape," admits Allitt. "If you want to turn to the left, then you want to bank a little, but then you turn to the left and you end up nosing down and you can just spiral into the ground.

"So you've got to have counter-controls like a pilot would have when they're trying to manoeuvre. The pilot is not always conscious of which control input they need to use to go the direction they need to go, whether they use the joystick or the rudder pedals. If we follow the same rules, that gives a very naturalistic turning and flocking behaviour."

One of the other challenges with these flying demons was making the Massive ones match the keyframe animated versions. The animation team would devise flying cycles, which they employed for hero demons, and would feed the cycles to the Massive crew for their use.

"We would start developing these cycles, like flaps and glides and combinations of those, and dives, and create looping cycles with long variations, before handing them off to the Massive team," describes Rapley. "They would use those to create even more variations and form the agents. It was very iterative."

"Then I'd set up a camera with maybe two or three hero keyframed demons in the front. They were supposed to be the few that were leading the pack, so we could control them, but the ones in the distance needed to be much further away."

The next step was to integrate keyframed and crowd simulated demons together. "The Massive demons had to be aware of the animated demons and how fast they were moving," advises Allitt.

"So we'd place them behind the animated guys and they would have to match the speed and the orientation of the animated ones as a simulation, which is quite a bit different to key framing."

"We had a couple of angles where we were trying to keep the demons in camera behind the animated ones," Allitt adds. "I ended up putting a little pitch control in the brain that I could control with curves, I could pitch them up and pitch them down to keep them in frame, just to override the simulation a little. I guess that's sort of keyframing, but keyframing with a virtual joystick rather than actually setting absolute positions."

A new challenge: funnelling demons

At one point, the demons are seen flying out of narrow holes in the Dark Gate that contains the Dweller-in-Darkness. In order to deal with collisions for such a thin passageway, WetaFX came up with a special approach in Massive for these moments.

"There were some shots where we had almost had a funnel on the backside of the gate, funnelling the demos down into a very tight aperture and then it spread out from that," details Allitt. "This used the lanes functionality in Massive, which lets us basically draw lanes as a tube in space, rather than as a physical lane on the terrain. Here we could draw a funnel through space and have a varying width."

Massive artists would place agents inside a wider part of the funnel and then rely on the fact the agents use their own 'personal space' to autonomously jostle for position. Here it meant the demons correctly slowed down in order to exit the gaps in the gate, and then in the wider flying scenes that same principle allowed the agents to match the speed and velocity of the keyframed demons.

Says Allitt: "That's one of the things that Massive is really good at, that we can take an animated character, import it into Massive as an agent, and then the other agents can react to that as if it was part of the simulation itself. They get all the same inputs they would from a Massive agent from the animated ones."

Rise of the phoenix

Another of the creatures imagined for the third act battle was the phoenix, which has the ability to turn the demons into fire. Ultimately, the presence of the flying phoenix creatures was paired back in the final film.

WetaFX began working on Massive phoenix shots for a sequence involving Trevor (Ben Kingsley) flying into battle atop a giant version of his face-less companion Morris. The idea is that Trevor would lead the phoenixes into battle to take out the demons.

"There was a lot of Massive work there that the team was doing in terms of having these phoenixes pour into the demons and immolate them and circle around the back of the Great Protector," says Rapley.

For establishing shots of the phoenixes showing them spiralling up into a tornado shape, WetaFX relied on the Massive lanes feature again, essentially building a spiral – "We feathered them out so it didn't look like too clear of a defined line," states Rapley. "It was really successful."

Luckily, Marvel has released that Trevor moment as a 'deleted scene' on the home entertainment release for Shang-Chi, giving viewers a unique work-in-progress glimpse into a complex Massive simulation.

Jon Allitt was certainly excited to have been part of tackling those phoenix shots. "The phoenixes were actively targeting the demons," he notes. "So when they got too close to a demon, the demon would catch fire and a dynamic sim took over and it tumbled out of the sky. That would've been so cool if it had been in the film!"