Tank Combat, Part 2 (Mecha 2nd Phase)
Summary
Phase 2 of the Mecha's boss fight. The weapon has been switched to dual fists and the Mecha is faster and more aggressive.
Goals:
This page has a lot more notes on design and animation theory rather than technical breakdowns.
Goals:
- Show a change of mood in the Mecha while still remaining true to the character.
- Have a large contrast from the 1st phase gameplay-wise while still being a fair and fun fight.
This page has a lot more notes on design and animation theory rather than technical breakdowns.
Video
Choose your weapon!
This part is more about game design than animation, but I figured it might still be interesting.
The first thing I had to decide was the combat style of the Mecha's 2nd phase. I started by writing down some ideas for this phase, which helped make my decisions:
An AI's weapon plays a big part in the combat cadence, so I decided to start there. I came up with 2 configurations for the Mecha's glaive - either a single giant gauntlet or two paired gauntlets.
The first thing I had to decide was the combat style of the Mecha's 2nd phase. I started by writing down some ideas for this phase, which helped make my decisions:
- I want to have a large contrast from the 1st phase.
- The Mecha's weapon is in a different configuration.
- The original idea was for the tank to break it, but I decided to have the Mecha break it instead to show that he is in control.
- While still retaining the same personality as before, the Mecha is now taking the fight more seriously.
An AI's weapon plays a big part in the combat cadence, so I decided to start there. I came up with 2 configurations for the Mecha's glaive - either a single giant gauntlet or two paired gauntlets.
These poses were not meant to be final but they started to imply the Mecha's improved agility already.
I wrote down some notes about the different configurations to help decide which weapon to use.
1 giant gauntlet
Ultimately, I decided that since the Mecha is slow and lazy in the 1st phase, the 2nd phase should have the Mecha be more agile and sharper in its movement. The dual gauntlets provided a better opportunity for that since it's better balanced, and it also has a better contrast in silhouette since it now holds two weapons instead of a single one.
1 giant gauntlet
- Implies slower and heavier attacks than 1st phase.
- Wider variance of attacks between both arms, although right arm attacks will look weak and so should generally be avoided.
- Right hand can be used for grappling more effectively.
- More difficult to pose due to size (which is good because it encourages more dynamic poses).
- Overall combat cadence will probably be more similar to 1st phase than the other option due to one-handed weapons in both phases.
- Single giant gauntlets are cool!
- Implies faster attacks than 1st phase.
- Superior agility due to improved balance allows for interesting movement options.
- Equal distribution of weapons results in very different fighting style from 1st phase.
- More striking silhouette.
- Any of the 1 giant gauntlet attacks could be performed even in this configuration, although they won't look as heavy.
Ultimately, I decided that since the Mecha is slow and lazy in the 1st phase, the 2nd phase should have the Mecha be more agile and sharper in its movement. The dual gauntlets provided a better opportunity for that since it's better balanced, and it also has a better contrast in silhouette since it now holds two weapons instead of a single one.
Same personality, different mood
The 2nd phase was a good time to show a shift in the Mecha's mood. This doesn't mean that his personality changes, but rather his attitude to how he's approaching the fight. These were some of the things I thought about when doing the 2nd phase:
These notes gave me some general guidelines to how the Mecha would approach the fight. Unlike the 1st phase, his combat actions should be focused and less unnecessarily flashy. There can be dedicated taunt actions as a more direct disrespect. He will move faster and attack more frequently, and will actively try to chase you down or otherwise get in range to attack.
Usually I start an animation set with the idle pose, but for this I started by making a sprint animation for the Mecha, which helped me understand the cadence and tone of the 2nd phase.
- He was beaten in the 1st phase while not taking the fight very seriously.
- This means he is not really in a bad position. It just means that he cannot win the fight easily, so he'll have to try at least a little if he doesn't want to lose.
- In the 1st phase, the Mecha displays arrogance by his lazy attitude towards the fight. In the 2nd phase, I want him to still be arrogant, but we can show it more directly.
- He is taking the fight more seriously now. He knows being lazy will get him nowhere, so lazy moments should be kept to a minimum.
These notes gave me some general guidelines to how the Mecha would approach the fight. Unlike the 1st phase, his combat actions should be focused and less unnecessarily flashy. There can be dedicated taunt actions as a more direct disrespect. He will move faster and attack more frequently, and will actively try to chase you down or otherwise get in range to attack.
Usually I start an animation set with the idle pose, but for this I started by making a sprint animation for the Mecha, which helped me understand the cadence and tone of the 2nd phase.
The aggressive sprint was useful to pin down the Mecha's new attitude towards the fight.
The idle is a good place to really differentiate between the 1st and 2nd phases. Whereas in the 1st phase, the Mecha's idle was very open and still, in the 2nd phase his idle is much more energetic, and he is in a defensive stance, which shows his more serious attitude to the fight while still retaining his confident and playful personality.
The movement and posture is obviously inspired by real life fighters.
His attacks are generally more direct in this phase. Also, fun fact: this specific attack is a homage to Terry's Power Dunk from Fatal Fury.
Think fast!
For the 2nd phase, I created a new system for its AI that allows it to react to events dynamically in the middle of performing other actions.
It is analogous to a player deciding whether to continue an attack combo or not depending on what's going on in gameplay, and uses a similar system, and the setup is actually based on the player Blueprint's version of the input buffer in the form of a notify I can place in any animation.
It is analogous to a player deciding whether to continue an attack combo or not depending on what's going on in gameplay, and uses a similar system, and the setup is actually based on the player Blueprint's version of the input buffer in the form of a notify I can place in any animation.
I wanted the Mecha to feel intelligent enough to react to the gameplay events so for every such one of the reaction notifies that I place, I thought about what conditions the Mecha would want to react to. For example, for the attack above, it's very possible that the player will dodge behind the Mecha since the Mecha jumps into the air and travels quite far forward. So in the window of where after the Mecha hits the ground, the notify allows the Mecha to check if the player is/gets behind him. If so, he reacts with a punch behind himself to try and catch the player.
In the same way, each notify instance in the various animations that the Mecha has has unique conditions associated with them to allow the Mecha to react dynamically to the gameplay.
Conditions for various reaction windows for the Mecha.
This was the system used for the Mecha's feint/taunt. An AI reacting to not just your attacks but also your behaviour really helps to make it feel alive, so I wanted the Mecha to perform a special reaction if the player fell for his feint. In this case, falling for his feint means that the player tried to dodge a nonexistent attack, so all I had to do was have a window of time during his feint where the Mecha would wait to see if the player dodges.
Side note: the player BP broadcasts all inputs to any actor in the vicinity. While I only have a couple use cases for the Mecha for this, being able to broadcast inputs and events allows AIs to have unique reactions to any player inputs such as dodging, attacking, jumping, etc. It can also be used for AIs to send information between each other and to the player for contextual actions. The first prototype version of this system was developed in my previous "Swordbunny" sidescroller project.
Side note: the player BP broadcasts all inputs to any actor in the vicinity. While I only have a couple use cases for the Mecha for this, being able to broadcast inputs and events allows AIs to have unique reactions to any player inputs such as dodging, attacking, jumping, etc. It can also be used for AIs to send information between each other and to the player for contextual actions. The first prototype version of this system was developed in my previous "Swordbunny" sidescroller project.
The notifies for checking if the player dodges during the Mecha's feint animation.
The Mecha reacting to the player's actions really helps him to feel alive and aware of the player, and is also a great way to show his cocky personality.
As I wanted to make the Mecha more agile in this phase, he is capable of dodging away and around the player reactively. Of course, this doesn't happen every time you attack him or it would be impossible to land a hit, but it creates a great contrast from the 1st phase and makes him feel aware of the player's actions.
Again, this uses the reactive notify system I described above for the Mecha to decide whether to dodge or not in response to the player's actions.
Again, this uses the reactive notify system I described above for the Mecha to decide whether to dodge or not in response to the player's actions.
Mirror, mirror, on the wall
Another new ability of the Mecha is the ability to mirror his stance and by extension, all his attacks and movement. While it mostly doesn't affect the combat, this adds another layer of nuance to his behaviour. However, it does greatly affect any animation where the root motion has a lot of sideways movement such as when the Mecha dashes around the player or attacks sideways.
The Mecha is able to switch his stance while standing still or moving, and attacks are also mirrored.
Attacks with a lot of side movement especially benefit from the mirroring.
Most of the mirroring was set up procedurally with Unreal Engine 5's new Mirror Data Table. I set up a system where I could have montages that would be mirrored and montages that ignored the mirroring.
There were two reasons to do it this way:
- The first reason is that the Mecha plays specific Montage animations for switching his stance. However, the Montages could not blend properly if using the mirror node directly.
- It's a little tricky to explain, but basically the reason it can't blend properly is because at some point the entire Animation Graph needs to switch the mirror. I needed a way for the stance switch animation to play without it mirroring even while the AnimGraph switches to the mirror version (or reverse). So I made an extra Montage slot at the end after the mirror nodes so that it would override any mirroring. Then I mirrored the stance switch animation in Maya and exported two versions for default>mirrored and vice versa.
- The second reason is that I found that the procedural mirroring does not mirror root motion. That meant that I could not have mirrored Yaw rotation or side motion. Obviously this was unacceptable, so again I mirrored any animation with either root rotation or side motion in Maya and exported the two versions, then played the correct one through BP instead.
Another interesting thing to note is that notifies cannot be mirrored either. I had to create custom FX notifies to be able to mirror any FX for the Mecha properly, which wasn't really difficult.
Overall, the new mirror system in UE5 is really cool, but there's still some issues I would prefer to be resolved before trying to use it extensively.