Hi guys!
I created a RPG game and released it, one of the critiques about it is that the animation is not "smooth".
After lots of questioning the players, what I understood is the walk animation and the actual movement are not synchronized, so the player seems to slide.
Basically the pseudo code for walking is this:
if (key_pressed(up))
{
player->walking = true;
player->walktime = GetTime();
player->animation->play('walk');
}
if (player->walking == true)
{
player->position.y += time_elapsed() * WALK_SPEED;
if (GetTime() - player->walktime> WALK_DURATION)
{
player->walking = false;
player->animation->play('idle');
}
}
But this is kinda amateurish, the results are not good...
How professional games do it?
My character walk cycle animation is done "in place". I've heard about having animations with actual translations, I guess that would be the easy way to do it. But sadly I cannot change my animation, it would require lots of money that I dont have anymore.
Now what I ask, it is possible to avoid having the character "sliding" without having actual translations in the animation data, but instead, doing the movement programatically?
Any ideas how can I improve this situation?
My engine allows to specify callbacks for specific animation frames, so I guess I could make use of that, but I am not having a clue what to do with it, ideas?