Character movement, animation, and footsteps

I am still working on basic combat in AOS.  One of the areas that I have just completed is driving the biped characters based on the movement stat.  This stat is the first of my action stats which is in feet per second and because it is a stat will allow buffs and debuffs to automatically impact the movement rate of the character.

So in a combat scenario I want the character animation and footstep sounds to properly adjust from a standstill, to walking, and to running, and all at different rates, driven entirely from the movement stats current value.  So for example, things like slowdowns from cold spells would apply a percentage or absolute debuff causing the movement rate to adjust to a lower value and the character movement would be reduced along with the animation slowing, possibly fading from running to walking, and the footstep sounds would following that.

The same movement rate also applies to rotation speed which currently is a relative value that is driven by the ratio of movement to its maximum allowed value.  This just makes rotation relative to movement so if my movement stat is debuffed close to zero, my rotations would also become very slow.  Rotation is used both in character movement and turning while standing still.  During movement as the character changes direction, rotation speed impacts how fast the character turns toward that new direction as they are walking or running.

The character movement is going to be driven by path-finding combined with dynamic obstacle avoidance and crowd control which ultimately drives the character controller.  I have only achieved path-finding so far, such that the enemy characters are not intelligent and will walk into each other and into dynamic objects like barrels, crates, etc that can be pushed around and are controlled by the physics engine.  I plan on tackling these more complex movement issues with the updated NavMesh solution in Unity 4 or Aron Granberg’s updated solution, possibly combining this with Unity Steer.  At the moment however the basic path-finding is sufficient for implementing simple combat scenarios.  

I have put together an initial implementation that does the movement and syncs the animation and footstep sounds for bipeds that have standard walk and run animations.  First, I adjust the speed of the walk and run animations to sync them properly with the actual ground covered based on the movement rate.  This makes them “look” correct as you don’t want any sliding/moonwalking.  As the movement rate goes to the maximum the character is of course looking hyper as the animations don’t change and the stride stays the same but is just sped up.  This however does not look too out of place in a game and the shift between walk and run covers this mostly.

I am sure some of you remember the hyperwalk in Diablo II where the character would go really fast in walk mode.  I am trying to prevent this and have a nice shift between walk and run over the range of the movement stat.  In Diablo III they simplified things and made the characters just do a nice long stride jog as the main movement, which looks better and probably better adjusts to changes in actual movements from spells and enhancements etc.  Also, ARPGs are supposed to be fast, the character should always be running.  This is what I am doing for AOS as well.  The player is always in a slow run, unless debuffed to walking, and the NPCs have a variety of movement shifting between walking on patrols, and then running when in pursuit of something.

I hopefully will have some video in the coming month so that all this cool behavior can be witnessed by anyone interested in it.  I am still working on many aspects of the system, and the visuals in terms of all the special effects in combat are not in place, so a video would be rather underwhelming right now.  Stay tuned though, cool things are on the way!

Bookmark the permalink.

2 Comments

  1. I stopover this blog so many period, because every time something different, and I read all article your blog, very attractive.

  2. Thank you for the positive words. I am always busy working on the framework and the game so I don't write as many posts as I wish. Have many more on the way though! Keep coming back and thanks for following my progress.

Leave a Reply

Your email address will not be published. Required fields are marked *