I’ve animated on all kinds of projects, including film, television, web series, and games. Of all the ways animation is used to entertain today, I enjoy animating for games the most! There is a level of empathy that a player has with a game character that cannot be matched in film or on a television show. In a game, YOU are controlling what the character is doing. While you may watch your favorite film three or four times, adding up to maybe 6 or 8 hours for a 2 hour movie, players will be spending many more hours with a game character. As an animator, I want to do the best work possible and make sure the characters are entertaining and I’m not wasting the players’ time.
When animating for a game, aside from the needs of the character, you also have to consider the needs of the game. The first thing I do is talk with Design to find out what kinds of things the player will need to be doing with a specific animation or movement. What is the character all about? What will they be doing? What kind of personality do they have? Are they confident, scared, silly, etc?
The Robot needs to look adventurous and active, but also needs to walk and run at a very specific pace. He has some very mechanical features, and should look heavy yet athletic when he moves around. He's strong, but can hustle if he needs to. With all that in mind, I can start to flesh out our Robot character.
I usually start animating characters by beginning with a stand animation. Robot_loc_stand was the first game animation created for this game. The file name starts with the character's name, then the type of animation (a locomotion in this case), then the name of the action. File naming is important for all kinds of reasons, most importantly for the game's code to know what animations to call for what actions. If a file is named wrong or placed in the wrong directory, the game cannot see it and therefore cannot use it. Keeping consistent filenames and directory structures across all characters helps to keep development going smoothly.
A stand animation is perhaps the most iconic animation a character has. The player will see it a lot, so it needs to look great. For the Robot's stand, I wanted him to look powerful and ready to move. Even though he's just standing there, he's got to keep moving. I have his eye looking around a bit, and added a blink to help keep him alive.
Design wants the Robot to run at a rate of 9 units per second. Now that I know how far the Robot should be able to travel in one second, I can start animating a run. I start my animation by keying the Robot at the origin on frame 0. I then slide the Robot forward on frame 30 to a distance of 9 units. When I play, I see the Robot moving forward at the speed requested by the designers. Now I need to animate the character running at that pace.
All animation in the game happens at the character's origin. The root of the character is then moved through the game world by code. As a result, the animations where the character moves through space have to be counter animated so that the character doesn't actually move. Think of a person running on a treadmill. They are running at a specific speed, but aren't really moving through space. This is what we need to make in order for the engine to have what it needs.
The Robot walks at a rate of 6 units per second. The walk was animated after the run. Yes, we literally ran before we walked on this project. The walk is important because sometimes the player may want to approach something slowly. Maybe they are inching forward on a ledge, or creeping up on an enemy? A run wouldn't really be what the player wants in these situations. It also helps make a nicer blend between not moving and the speed of a run.
There is more to it than that though. The animations have to blend together in a way that makes sense.
In Unity, we have complete control over how long it takes for one animation to transition into another animation. We can also control what part of one animation blends into what part of another. We need to make sure that we don’t get any stutter steps or awkward movement when we go from a walk cycle to a run cycle. The way we do this is to get the legs to match up. If a left leg is moving forward in the walk cycle, we want the blend to happen when left leg is coming forward in the run.
Hopefully you’ve learned a little bit about how some basic game animations are used, and understand how one animation is blended into another in order to make a seamless experience for the player.
One of the hardest parts of working on a game is not being able to talk about all the cool and exciting stuff you get to see on a daily basis. I look forward to being able to show off more animation as more of the game gets shown to the public. I’m anxious to meet you at upcoming events and of course, when you get a chance to play the finished game.
Thanks for reading!