Today we are going to talk about animations. I have to mention, that we don’t have a person who creates actual animations for now. We tried to find animator recently, but it appeared that it’s very expensive and way out of our budget. As a result, we decided to buy a huge package of animations and edit them.
Yoji – is our first character. It’s a small creature, which controls the fire element.
We use mecanim for animations in game, and that’s how animation controller looks like:
Lets start from the beginning. Idle – is the main animation when you do nothing. Your character just stands and repeats the same actions over and over. As you can see on the picture, this animations are connected with all other animations. Usually, there are two types of connections :
1) Animations like Idle and Run are connected via character’s speed. If the speed is zero, we play the Idle animation. If it’s not zero, we play the Run animation. Sounds simple.
2) Other animations use triggers. It means that something in the game creates an event, which causes the animation to play. When the current animation is done playing, we switch back to the Idle animation. The Death animation stands separately in this case. The condition to change back to the Idle animation is the resurrection of the character.
I would like to mention the Hit animation independently, cause this animation is very important. It doesn’t matter what the character is doing at the moment of receiving damage: standing, dancing, casting spell, we have to play the Hit animation anyway to show that event. As you can see from the graphic, the Hit animation can be played from any other animations.
Now let’s take a closer look at our spells’ animations.
Each of our spells makes one of these animations to play. All animations are different, cause we want to maintain the diversity of the spells for each character. Everything is pretty simple here, and the only one spell I wanted to make an accent on is FireBall. When the fire character makes a punch, a fireball appears in front of his fist. We didn’t want to play the same animation all the time, so we’ve created two animations: one for each hand. When the spell is created, the random animation is played. I’ll show you the video, where you can actually see it.
We have animations of Dancing, Eating, Stunned and Dying here. All these animations are pretty different and have nothing in common with each other. First of all they all are much longer, and second the particular animation will not be changed to Idle, cause it’s looped. The game engine has to call both enter and exit events, either to start these animations or prevent them from playing.
We’ve added these animations just to make our players more happy. There is no logic attached to these animations. The goal is just to extend the variety of movements in the game. Here we have different types of animations: yawing, jumping, checking equipment or laughing. We have a special script, which is responsible for applying these animations. The is only one rule. These animations can only be called when characters does nothing (the Idle animations). You can notice it on the first picture.
Before showing you the video, I would like to share with you one more interesting problem we had with two spells: FireBall and FireWave. We wanted the fire to be created in front of the character’s fist after the animation is done. The problem was that the magic spells are the part of the game logic, meanwhile animations are just visual stuff, so we couldn’t create dependence between the animations and the spells. Moreover there are no animations on the server, which is responsible for all logic.
And that’s how we solved that problem. We’ve created all our spells using Particle system, so we just added a small delay for those spells. At the moment when a player is launching a Fireball the animation is played along with the creation of an invisible ball. And only at the moment we need, Particle system starts to work. It means that during the first milliseconds FireBall actually exists, and you just don’t see it.
We will tell you more about our spells in one of the next articles, and now, finally, you can watch the video for animations we’ve got.