Rune Skovbo Johansen
Creative Programmer & Designer
runevision
Menu

Locomotion System

For my Master Thesis project I have created a Locomotion System that can make animated human or animal characters walk and run on any uneven terrain including arbitrary steps and slopes. The Locomotion System give animators and game programmers maximum flexibility and control while requiring a minimum of work to use. The Locomotion System is developed for the Unity game engine and is free to use with Unity game projects.
Download the Locomotion System from the Unity Asset Store:
Go to Locomotion System at Unity Asset Store

Read my Master's Thesis about the Locomotion System:
Automated Semi-Procedural Animation for Character Locomotion

Video Demos

Nov 4 2008
A video with voice-over demonstrating the capabilities of the now released Locomotion System, including the new features that enables it to be used with 4-legged animals:

An older video demonstrating the Locomotion System at a slower pace. Features related to 4-legged animals are not demonstrated.

Procedural Animation Increses Engagement

Sep 15 2010
A new study confirms that procedural animation in a game, such as the Locomotion System I developed for my Master's Thesis, can improve not only the visual impression of the game, but also increase the overall player engagement significantly.

I was contacted some some ago by Chelsea Hash, a digital media student from the Polytechnic Institute of New York University. She had just finished her own Master's Thesis Reactive Animation and the Play Experience which included a social psychology experiment on the affect of dynamic animation systems on the user experience. The semi-procedural animation system used as part of the experiment is based on the Locomotion System I developed. She told me:

The study found that given four versions of a game with the only variation being the avatar visualization and animation system, the semi-procedural animation system consistently had a positive impact on the game experience. Users consistently ranked the procedurally animated version higher and played it for longer. This effect was found to be subtle and often beneath the user's ability to consciously identify the difference.




I find this highly interesting! My Master's Thesis and many other technical papers about animation techniques simply take for granted that animation techniques that makes characters more physically situated in the game environment increases player immersion - but this study actually tests this hypothesis, and finds that players become more engaged at a general level as well.

Her Master's Thesis is part of her studies at the Social Game Lab where research is conducted that addresses the subconscious qualities in design that make quality interactions. You can read more about Chelsea's work at her website, livelydisposition.com.

For anyone interested in using this form of dynamic animation in their own games (to enhance player engagement!), the Locomotion System can be used for free in any game authored using Unity - get the Locomotion System project folder to get started.

Master's Thesis now online

Sep 6 2009
My Master's Thesis is now finally online:

Automated Semi-Procedural Animation for Character Locomotion



I would have made it available earlier, but the University took three months reviewing it, and I wanted them to be done with it first.

The 114 page thesis thoroughly discusses almost all parts of the implemented system and compares the used techniques and methods with related academic work on the subject. Here's the abstract:
This thesis presents a framework of techniques for interactive synthesis of highly ?exible character locomotion. The system uses a set of example motions primarily in the form of keyframed or motion-captured walk and run cycles. The system automatically analyzes each motion at design-time and extracts parameters such as impact and lift-off times for each foot as well as overall velocity. At runtime the system ?rst blends the motions according to the current velocity and rotational velocity of the character, it then adjusts the movements of the bones in the legs by means of inverse kinematics to ensure that the feet step correctly on the ground. The system works for both human and non-human characters with any amount of legs and in whatever style the provided example motions are in. It can adjust animations made for a speci?c speed and direction on a plain surface to any speed, direction, and curvature, on any surface, including arbitrary steps and slopes.

Notable innovations in the thesis include the introduction of the concept of a footbase, which is a single combined heel and toe constraint that can retain the important information about the alignment of a foot relative to the ground; the calculation of a supporting ground height that can be used to produce motion with a good sense of weight, regardless of the number of legs and of the gait style; the calculation of natural-looking foot alignments that works for just about any characters and gait styles, and a scattered data interpolation algorithm that has desirable properties when interpolating motions with different velocities.

The thesis has plenty of diagrams and illustrations to help presenting the new concepts and techniques. The accompanying videos also help in that regard.

Having finished my Master's Thesis doesn't change a whole lot in my life in practice. I've already been employed full time at Unity Technologies since February and I will be continuing my work there helping continuously improving the Unity game engine and authoring tool. (My blogging for Unity can be seen here by the way.)

That said, I'm very happy to finally be done with this academic endeavor. This also marks the end of the almost exclusive focus on the Locomotion System on this blog. My future blogging here will probably be centered around more broad game development related subjects, though I won't be shy of occasionally diverting even from that topic if I should feel like it.

As always, the Locomotion System itself can be downloaded here and it is free to use in any Unity game.

Fully Automated Blending, Revisited

Apr 18 2009
One of the things that makes the Locomotion System easy to setup and use is the fact that it automatically analyzes the velocities of all the input walk and run cycles and plots them into a velocity map. At runtime the system automatically assign appropriate blending weights to the animations, such that the closest neighboring animations (in terms of their velocities) get the highest blending weights.

While developing the system I tested this blending with as few as 2 sample animations (1 idle and 1 walk cycle) and with a much as 9 (1 idle, walk cycles in 4 directions, and run cycles in 4 directions).

A user in the Unity community, Chris Mansell Aka. Capnbubs, has now posted an early preview demo of a game he is developing, which utilizes the Locomotion System. In it, the avatar walks and runs with easy in a landscape with cliffs and hills.

Chris informs me about the animated character:
I've got walk and a run animations, each in 5 directions, three of them mirrored for moving backwards.
In other words, walk and run cycles in 8 directions, which makes for a total of 17 animations when also including the idle. The image above depicts a visualization of the velocities of the animations plotted into the velocity map.

I only ever tested with half that many animations myself, but the automated analysis and the runtime blending based on scattered data interpolation ensures that it still just works out of the box. Also, the built in ability to make an animation double as its backwards equivalent means that Chris effectively got 17 animations although he only made 11.

Locomotion System GDC 2009 Slides

Mar 31 2009
My lecture at GDC about my Locomotion System went really well I think. I've had some requests for the slides, and they're available here:

Dynamic Walking with Semi-Procedural Animation (PDF, 16 MB)

Note that the presentation included quite a few videos which are not in the above slides, so a few points may not come properly across if you did not see the presentation at GDC.

GDC may at some point make a recording of the slides available, complete with audio. I don't know if that would also include the videos I presented. I'm not so sure of the details. If anybody finds out, please let me know!

Locomotion System at GDC 2009 update

Mar 19 2009
The Game Developers Conference 2009 is very close now and I will be doing a 60-minute lecture in the Programming track on the subject of:

Dynamic Walking with Semi-Procedural Animation
(Follow the link to see the session description on the GDC website.)

Time: Friday (March 27, 2009), 4:00pm - 5:00pm
Location: Room 2018, West Hall

Locomotion System at GDC 2009!

Feb 16 2009
The Game Developers Conference 2009 is near and I am proud to announce that my session proposal has been approved! I will be doing a 60-minute lecture in the Programming track on the subject of:

Dynamic Walking with Semi-Procedural Animation
(Follow the link to see the session description on the GDC website.)

I am honored to be presenting my work in the company of the great minds of the game industry at such an early point in my career. This is the second time I am going to GDC and I am truly looking forward to it.

Updated Interactive Demo
Now, since I'm updating the blog anyway, I have thrown in the latest version of the uneven terrain demo that I have used as a testing bed for the Locomotion System. New in this version is a coyote, as well as lots of visualization options that you can play around with to get an idea of the inner workings of the system. This is the same version that was used for the Video Demo 2 of the Locomotion System in the previous post.

Instructions for the demo:

CommandKeyboardGamepad
Walking-directionarrow keysanalog stick 1
Walking-speedshift-
Facing-directionW, A, S, Danalog stick 2
Jumpspacebutton A
Time slow down / speed upnumpad - / +-

You can control the characters with either the keyboard or with a game pad. With a game pad, such as an XBox 360 controller, the direction and speed can be controlled precisely with ease, while independently controlling facing direction with the secondary stick.


In this demo the terrain can be dynamically controlled with the sliders at the top. You can create stairs, slopes, and various combinations. The terrain will reflect the changes once the character has walked a little distance to the left or right. Enable manual mode to control the character yourself, as described above. This demo uses four animations for walking (forward, backwards, and sideways) and also four for running.

In other news
Besides having my session at GDC accepted, a few other notable things have happened recently:
  • I have moved from Aarhus to Copenhagen (both are cities in Denmark; Copenhagen is the capital) together with my girlfriend.
  • I have started working at Unity Technologies, a company making an extremely cool game engine and authoring tool called Unity.
  • I am still working on finishing my Master thesis about the locomotion system ... it will hopefully be done soon!
That's it for now. I hope to see you at GDC!

Video Demo 2 of Locomotion System

Nov 1 2008
I've made a new video with voice-over demonstrating the capabilities of the now released Locomotion System, including the new features that enables it to be used with 4-legged animals:



In the video I explain the features of the system step by step in a straightforward manner while demonstrating the effects.

Locomotion System Released Now

Oct 27 2008
The Locomotion System has been officially released last Friday concurrent with my presentation of it at Unite 2008. It is available for download at the Unity website:

Go To Locomotion System

From the website:
About
Take a look at how semi-procedural animation can dramatically improve the realism of animated humans and animals.

Full Control of Style
Animators are experts in creating motions with specific styles and personalities. The Locomotion System uses keyframed or motion-captured animations as input and only adjusts them minimally to move the feet correctly in a dynamic and detailed environment.

Full Control of Behavior
Move your character around by any means you desire, be it a CharacterController, a RigidBody, or your own custom movement logic. The Locomotion System simply observes the position, alignment, velocity and rotational velocity of your character and deduces everything from that, along with some raycasts onto the ground.

Details
The Locomotion System automatically blends your keyframed or motion-captured walk and run cycles and then adjusts the movements of the bones in the legs to ensure that the feet step correctly on the ground. The system can adjust animations made for a specific speed and direction on a plain surface to any speed, direction, and curvature, on any surface, including arbitrary steps and slopes.

License
The Locomotion System is available for free commercial and non-commercial use when used in a Unity game.

The full license is included in the package.

Note
The Locomotion System is developed by Rune Skovbo Johansen in collaboration with Unity Technologies.

The presentation of the Locomotion System at Unite 2008 was received very well judging from the number of times the audience burst spontaneously into applause, and this Gamasutra article refers to the presentation as a "crowd favorite". I'll let you know when the video of the presentation is online.

If you are a Unity user and have any technical questions regarding the Locomotion System, please ask them on the Unity forums so more people can benefit from the questions and answers (and maybe notify me by email of your forum post if you want to be sure I see it quickly).

Locomotion System at Unite 2008

Oct 15 2008
In a few weeks I'll be presenting the Locomotion System in a technical session at the Unite 2008 conference held at the Tycho Brahe Planetarium in Copenhagen, Denmark, October 22-24, 2008. My session will be held 13:30 on Friday, October 24th:
Walking and Running on Uneven Terrain
Speaker: Rune Skovbo Johansen
This session will present the free Locomotion System developed by Rune. The session will discuss how to let the system solve the complex tasks of blending multiple walk and run cycles and perform dynamic foot placement on uneven terrain while keeping animators and game programmers firmly in control of style and behavior.

See the Unite 2008 conference info and agenda.

The Locomotion System that I'm developing is for the Unity game engine, and Unite is the yearly Unity developer conference packed with presentations, technical sessions and special events.

Video Demo 1 of Locomotion System

Aug 8 2008
I've made a video with voice-over demonstrating the capabilities of the Locomotion System I'm developing. The video is based on one of the interactive demos in the previous post.

You can look at this high-res Quicktime video (106 MB) or at the lower quality YouTube video embedded below:



In the video I explain the features of the system step by step in a straightforward manner while demonstrating the effects.

3 Demos and New Blending Feature

Jul 20 2008
Lots of demos you can try this time - yay! Tip: For better performance, unload one demo before you view the next.

Instructions for all demos below:

CommandKeyboardGamepad
Walking-directionarrow keysanalog stick 1
Walking-speedshift-
Facing-directionW, A, S, Danalog stick 2
Jumpspacebutton A
Time slow down / speed upnumpad - / +-

You can control the characters with either the keyboard or with a game pad. With a game pad, such as an XBox 360 controller, the direction and speed can be controlled precisely with ease, while independently controlling facing direction with the secondary stick.


Climb the crates and boards. Use shift to run; default is walking. Note that this demo only uses one animation for walking and one for running.



In this demo the terrain can be dynamically controlled with the sliders at the top. You can create stairs, slopes, and various combinations. The terrain will reflect the changes once the character has walked a little distance to the left or right. Enable manual mode to control the character yourself, as described above. This demo uses four animations for walking (forward, backwards, and sideways) and also four for running.



Walk around this structure in space with crazy gravity! (Nobody said anything about Mario Galaxy...)

Animation groups
I have worked hard on finding a way of making the Locomotion System easy to integrate with an existing animation framework in a game while keeping it flexible.

I have now implemented a feature where animations used by the Locomotion System are grouped together in animation groups. For example, animations for walking and running in different directions could be put in a single animation group.

The group as a whole can be controlled manually the same way as regular animations are controlled in Unity, while the blending of the individual animations in a group are automatically controlled by the Locomotion System. Furthermore, the system supports using multiple animation groups, so e.g. one group can be used for normal walking and running (in all directions), and another group for sneaking (in all directions).

The new feature can be seen in the demos above in two ways:
  • When the character jumps, an animation is cross-faded in that is not controlled by the Locomotion System. This way the feet do not attempt to stay on the ground while the character is jumping.
  • When the character is standing still for a little while, an "waiting" animation is cross-faded in. Since this animation is also controlled by the Locomotion System, the feet stay properly grounded.

Testing the Locomotion System
I make the Locomotion System as my Master Thesis in collaboration with Unity Technologies. It will be available for free for users of Unity once it is finished.

As a part of my thesis, I want to test the usability of the system. If you are a Unity user and would like to try out the system and help me by evaluating it, please let me know! The Locomotion System is by no means finished yet, but it is now almost at a stage where it is ready for preliminary testing.

Also, comments are much appreciated!

Locomotion System Overview

Jul 20 2008
When people see the Locomotion System in action, they sometimes get incorrect ideas about what the system can and cannot. Here is a brief description that can hopefully make things a bit more clear.

The Locomotion System for Unity automatically blends your keyframed or motion-captured walk and run cycles and then adjusts the movements of the bones in the legs to ensure that the feet step correctly on the ground. The system can adjust animations made for a specific speed and direction on a plain surface to any speed, direction, and curvature, on any surface, including arbitrary steps and slopes.

The Locomotion System does not enforce any high level control scheme but rather lets you move your character around by any means you desire. The Locomotion System silently observes the position, alignment, velocity and rotational velocity of your character and deduces everything from that, along with some raycasts onto the ground.

This flexibility means that you can use a CharacterController, a RigidBody (those are standard components in Unity) or something else entirely to move your character around in the world, exactly as you would normally do.

The Locomotion System is not:
  • A physics-based system or active animated ragdoll system.
    The system has no integration with the physics simulation. It is purely kinematic, though it does base the kinematics on some raycasts onto the geometry of the ground.
  • A behavior-based system.
    The system cannot make the character react instinctively to external forces such as being punched, tripping and falling, or being shot. The system only blends and slightly adjusts your existing animations.
  • A unified system that can be used for all animation of a character.
    The system only controls the legs. (The whole body is typically implicitly controlled since the system blends together multiple full body animations. However, this can be overridden by the user with specific animations for the upper body, using the usual means available in Unity.)

3 New Features

Jun 22 2008
I have just improved the system with three new features:
  • Support for using walk cycles backwards. So for example a forward walk cycle can be used as a backwards walk cycle too (in lack of something better).
  • Auto-synchronization. All walk and run cycles are now synchronized so you don't have to tell your animators "all animations must start on the left foot" or similar.
  • Slightly more intelligent foot placement. It attempts to avoid ledges. The system now traces two rays per foot per frame in order to make this possible.
(More details below.) These improvements have been of benefit for the Soldier guy in particular, that only use 3 animations: idle, walk, and run. He now walks much more fluidly in all directions, though still not nearly as well as the Hero guy, with 9 animations. Click the image below to view the demo.


Instructions repeated for your convenience:
When manual control is turned on, you can control with either the keyboard (arrow keys for walking direction, and optionally WASD keys for facing direction) or with an analog controller, which I highly recommend. With an analog controller, such as an XBox 360 controller, the direction and speed can be controlled precisely with ease, while independently controlling facing direction with the secondary stick.

The terrain can be dynamically controlled with the sliders at the top. You can create stairs, slopes, and various combinations. The terrain will reflect the changes once the character has walked a little distance to the left or right. The sliders will also be changed at random while not in manual mode.

Support for using walk cycles backwards
Since one of the goals of the system is to make great animation available to even small developers with limited resources, the ability to use the same walk cycle for two things is very handy. Not only can a forward walking animation be used as a backwards walking animation too, but the system can also use a blend of the forward and backward animations for walking sideways. The forward-backward blend results in a sort of neutral stepping on the spot motion, which is better suited for adapting to side-stepping than either the forward or backward animations alone.

Auto-synchronization
This one solves a whole host of problems. If animations are not properly synchronized before they are blended, it results in all kinds of weird motions, quirks, and problems. The traditional approach is to make sure the animators animate the cycles synchronized, so that for example all walk and run cycles starts with the left foot being on the ground, approximately under the character. However, this manual synchronization doesn't always work out very well. Also, when considering the backwards support feature mentioned above, the restrictions are even tighter.

This is why I have implemented auto-synchronization. The system now calculates an offset for each walk and run cycle that makes it match the other cycles as well as possible. At runtime in each frame, these offsets are applied individually to each motion prior to blending them.

The auto-synchronization works by comparing the stance times of each leg in each cycle with the stance times in the other cycles. (The stance time is the time in the cycle when the foot is standing most firmly on the ground.) The offsets are calculated by applying a kind of spring system to the stance times in each cycle, so that each stance time is attracted towards the stance times of the same leg in the other cycles. Over a few iterations (less than 20 in my tests) the stance times get increasingly closer until they are practically overlaid. Each iteration is O(N^2) where N is the number of cycles, because each cycle is compared to each of the other cycles. However, since this calculation can be done once at pre-compile time, it doesn't have any speed penalty at run-time.

More intelligent foot placement
The feet now land on the ground a bit more intelligently. For each foot two rays are cast towards the ground; one from the heel and one from the toe-tip. Depending on whether one of them or both hit a usable spot, the foot is placed either between the two points or on one or the other. This prevents the most glaring intersections with geometry. However, a more sophisticated system might still be implemented at a later time.

Help me test the system
I make the Locomotion System as my Master Thesis in collaboration with Unity Technologies. It will be available for free for users of Unity once it is finished.

As a part of my thesis, I want to test the usability of the system. If you are a Unity user and would like to try out the system and help me by evaluating it, please let me know! The system is not ready for testing yet, but it won't be long now.

Also, comments are much appreciated!

Adaptive Walking Preview II

Jun 10 2008
I have not been good at updating the blog lately, but here's a new preview of the Locomotion System! Now characters can walk in any direction (forwards, backwards, sideways, and anything in between) with any speed. Characters can also start and stop walking with proper transitions. Click the image below to view the demo.


When manual control is turned on, you can control with either the keyboard (arrow keys for walking direction, and optionally WASD keys for facing direction) or with an analog controller, which I highly recommend. With an analog controller, such as an XBox 360 controller, the direction and speed can be controlled precisely with ease, while independently controlling facing direction with the secondary stick.

The terrain can be dynamically controlled with the sliders at the top. You can create stairs, slopes, and various combinations. The terrain will reflect the changes once the character has walked a little distance to the left or right. The sliders will also be changed at random while manual mode is not enabled.

Models and animations
The demo shows off three characters, all kindly provided by Unity Technologies. Press ENTER to switch between them, or press the switch button.
  • The HERO character has 9 animation: 1 idle, 4 walking, and 4 running. The system automatically blends between the relevant animations based on direction and speed.
  • The SOLDIER character only has 2 animations: 1 idle and 1 walking (forward). The walking is extrapolated by the inverse kinematics in the Locomotion System to also work for sideways and backwards motion, but it doesn't look as good as when animations are provided for those directions.
  • The HERON character also only has an idle and a walking animation. (Note that the Heron model is facing in the -Z direction, so it's a bit odd to control.)

Features
A lot of the features I set out to implement are done by now. Still missing are:
  • More intelligent foot placement mechanism that avoids ledges. The current system simply traces a ray from the heel of the foot.
  • Some way to avoid feet and legs intersecting when walking in certain directions (usually sideways). Regular blending inevitably leads to this glitch, so special logic is required to handle this.
I will post more details on the technical details later.

Request for models!
I have tested the system with several biped (two-legged) characters but i am in DIRE NEED of animated models with more than two legs to test with! If you have any characters I may use as test data for this project, it would help me a lot. Models will only be used for testing and not in public demos unless explicit permission is given. Also, I will put a thanks in the Master Thesis.

The models can be anything really: animals, aliens, robots, or whatever, as long as they use legs to move around with! I can import models up to Maya 8.5 and in .fbx format. Animations work best with the system if:
  1. There is at least one idle animation and one walk or run animation. But the more, the better!
  2. The feet don't intersect too much with the ground (though a little don't hurt).
  3. The feet move backwards (for e.g. a forward walk) at a somewhat constant speed while on the ground (though the system can fix small variations).
If you are in doubt, just send away! Even animations that don't work still show me something valuable about the limitations of the system.

Help me test the system
I make the Locomotion System as my Master Thesis in collaboration with Unity Technologies. It will be available for free for users of Unity once it is finished.

As a part of my thesis, I want to test the usability of the system. If you are a Unity user and would like to try out the system and help me by evaluating it, please let me know! The system is not ready for testing yet, but it won't be long now.

Also, comments are much appreciated!

First Preview of Adaptive Walking

Mar 27 2008
I just finished the first presentable demo. It is just one character with a fixed animation for now, and the foot step placement doesn't yet attempt to avoid intersecting geometry, but as an appetizer of what is to come, it will do. Click the image below to view the demo.


The demo above is made from just one animation that was made for walking straight ahead on a plain surface. There are two primary techniques that were used here to make the animation look quite acceptable when the character walk up or down steps:
  1. The system maintains the original ankle local rotation while the foot is in the air, and only enforces a re-alignment of the foot while it is on the ground. While landing on the ground and while leaving the ground, a blending between these two modes of operation is used.
  2. The system keeps track on when to use the heel and when to use the toe as the point of reference relative to the ground. This is based on which one is closer to the ground at any given point in time.
The features to be implemented next are:
  • Blending between several animations.
  • Support for walking on sloped surfaces.
  • More sophisticated step length / step frequency mechanism.
  • More intelligent foot placement mechanism that avoids ledges.
Anyway, I'm glad to finally have something to show, even if it isn't much for now. Comments are much appreciated!

My Old Walking System

Mar 19 2008
Creating a system for adaptive animation for character locomotion in computer games is not only a very exciting master thesis project, it is also my opportunity to work with an idea I have had for a long time.

Back in 2001, when I was 18, I made rendered 3D animations in my spare time with the freeware raytracer POV-Ray. POV-Ray doesn't have a graphical front-end like 3Ds Max etc; instead you make your images and animations with a scripting language.

Among many other things, I made a walking system for POV-Ray. Here are some of the things it could do:


Making the system was a rather big challenge. POV-Ray has no support for keyframe animation so I had to make all animation 100% procedural and animate it by scripting! This was a very slow process and I never got as far with the system as I had in mind.

Now, using the Unity game engine, I am creating a walking system again. This one is different. In the system for POV-Ray (that was made for offline rendering) every step was calculated in advance. With the new system, characters need to respond dynamically from input from the player or from AI. Also, this time I have keyframe animation, skeletal animation, animation blending, and many other features at my disposal, which makes it easier to do more advanced things, but which also bring new challenges.

Although the new walking system for Unity will be very different from the old walking system for POV-Ray, I still think the video here will help make it easier to grasp what the system will be all about.

Walk and Run Cycle Analysis 2

Mar 18 2008
In the past week I have been continuing my work on a script to analyze the movements of the feet in walk and run cycles. The primary new result is the analysis of foot lifting and landing times. By analysis the script finds these times for each foot:
  • Lift time: When the foot begins to lift from the ground.
  • Liftoff time: When the foot lifts off completely from the ground.
  • Strike time: When the foot first touches the ground again.
  • Landing time: When the foot has fully landed on the ground.
These times can be seen in the bottom graph in the interactive analysis visualization here. Click to activate it.


Note that the graphs refer to the ankle and toe of each foot. What they really measure is the ankle and foot positions projected onto the ground at the stance pose, i.e. points on the underside of the foot. Since these projected positions are approximately at the heel and toe, I will be referring to heel and toe positions below.

Previous work
Automatically finding the foot lifting and landing times can be tricky, especially if the animations that are being analyzed are not of the highest quality.

In the paper Adapting motion capture data using weighted real-time inverse kinematics by Michael Meredith and Steve Maddock, foot flight paths are extracted from motion capture data using a curve gradient analysis technique:
Our approach for retrieving the flight path from the motion capture data is based primarily on a gradient analysis technique where, over the course of the original motion, we analyze the height value of one of the character’s feet. The first target we look for is a switch from a negative to a positive gradient on a frame that is within 10% of the global minimum height for the foot. This gives us the start of the foot flight where the foot is just about to leave the ground.

From the first target, we progress along the original flight path until we meet a second gradient change from positive to negative, which is on a frame whose height value is within 10% of the global maximum. This second target is the peak of our flight height. Continuing along the original path, we locate the third and final target via one last gradient switch from negative to positive, whose frame height is again within 10% of the global minimum. This technique is demonstrated pictorially in Figure 2.


I have been inspired by this technique by Meredith and Maddock. However, in my own tests I have found their procedure insufficient to properly handle the very varied animations I have used as test cases for my system.

Tricky animations
In my test animations, the feet don't always actually lift up from the ground when the legs starts to swing forward, but rather sort of drags along the ground. Also, the feet sometimes intersect with the ground, which also makes the analysis non-trivial.

In order to make the analysis error-tolerant in these kinds of scenarios, I have used several rules in combination to find the foot lifting and landing times.

New rules for the analysis
The new rules are highly dependent on the stance time which was described in the previous post. The stance time is the time where the foot is standing most firmly on the ground. Starting from this, the new rules are used to find the lifting and landing times fo the feet. The same rules are applied both for finding lifting and landing times, and they are used on both the heel and toe Y movement curves (i.e. vertical movements). They are as follows:
  1. Start following the Y movement curve from the stance time and forward (/backwards) until the height curve reaches 10% of the maximum height of the curve. The lifting (/landing) must come before this point.
  2. Inside this span of the curve, find the point with the maximum curvature (the maximum second derived of the curve, i.e. the most sudden rise in the curve).
  3. Disregard points on the curve that are below the ground level.
  4. Disregard points on the curve where the first derived (i.e. the slope) is below zero (or above zero when searching backwards).
These rules combined will almost surely find the point on the curve that intuitively looks like the point where the curve starts to rise from the ground. However, another check has to be made. This check is made for the foot Z movement curve (i.e. the swinging back and forth of the foot).
  1. Start following the Z movement curve from the stance time and forward (/backwards) untill the slope is more than 50% different than the slope at the stance time. Since the speed at the stance time is the point of reference for the ground, a speed that deviates more than 50% must mean that the foot is no longer following the ground, and thus no longer standing on the ground. If this time occur before the lifting time (/landing time) found by the other rules, then this time is used as the lifting time (/landing time) instead.
The 50% value here has been chosen by trial and error from the test animations. For a completely accurately animated character, the feet should be moving with a completely constant speed while they are on the ground since the ground is moving backwards with a constant speed relative to the character. However, this is not always the case in actual keyframed animations, and the speeds of the feet can be quite inconsistent. Thus a large tolerance value has to be used.

Motion synthesis next
The next step is to use the motion analysis data to synthesize adaptive walking and running animations. Using the lifting and landing times, the foot flight paths and the analyzed speed of each animation, new paths for each foot can be generated in accordance with the environment and variable movement of the character.

Walk and Run Cycle Analysis

Mar 11 2008
I have been working on a script to analyze the movements of the feet in walk and run cycle animations. From this analysis the speed of the character can be determined, as well as when and where the feet touch the ground. Click to see the analysis in action here:


3 graphs
There are three graphs shown in the view.
  1. The bottom graph show the vertical movements of the ankle (red curve) and toe (green curve).
  2. The middle graph show the horizontal movements of the ankle (red curve) and toe (green curve). It also shows a black curve that is a weighted average between the ankle and toe curves.
  3. The top graph shows the balance of importance between the ankle and the toe, based on which is closer to the ground. This curve is used as the weighing factor for the black cuve in the middle graph.
Stance time and speed
Also, the analysis finds a "stance time" for each foot. This is the time when the foot is most firmly standing on the ground. The graphs are shown such that the stance time is always at the left side of the graph for all feet. This way, is is easy to compare the curves of the different legs and the different animations.

The stance time of a foot is determined by finding the point in time when the ankle height and toe height are as low as possible. It is important that they are both low, so rather than using the average of ankle and toe height, the maximum of the two is used.

By sampling the horisontal movement of the foot at points in time around the stance time, the overall speed that the character is moving with can be concluded. It is important to determine the movement of the foot from the part of the foot that is currently closer to the ground, thus the black curve from the middle graph is used. Using just the ankle movement or just the toe movement would give incorrect results.

Test data
I have tried to design the analysis such that it makes as few assumptions as possible. There are a few though:

  • The character must be aligned with Y = up and Z = forward.
  • The animation must contain only one cycle, i.e. one step with each foot. For that reason, skipping is currently not supported. There doesn't have to be any symmetry in the steps though, so e.g. a gallopping horse should work fine.
Currently the analysis method has been tested with a soldier character with a walk cycle and two run cycles as well as a robot character with a run cycle. I would like to test the system with many more characters and animations, including creatures with more than two legs, so I am currently looking into ways to get more material to test with. The goal is to create a robust analysis that can correctly interpret most animations that are thrown at it.

Adaptive Animation for Character Locomotion

Mar 4 2008
I have just begun working on my Master Thesis, which I will be making in collaboration with the company Unity Technologies that make the awesome Unity game engine.

The Master thesis will be about "Adaptive Animation for Character Locomotion", which basically means creating a system for adapting walking, running, and crawling keyframed animations to a dynamic environment. The system will take curved paths, uneven terrain, and variable speed into account all the while ensuring graceful footsteps without slipping feet and motions that stay as faithful as possible to the original keyframed animations under the given restraints. Inverse kinematics is one of many techniques that will be involved in this.

Goals and perspectives
The system is meant to be generic in nature, working not just for biped characters (with two legs) but also for example for dogs, bugs, and spiders and, say, robots and aliens, provided that they move around using a limited number of legs. This list of features is the ideal case - time will tell how far I get within the timeframe of my Master Thesis. Hopefully I can continue working on the project after my graduation, if necessary.

In the end, the result of my work will be made available to all users of Unity free of charge, for any use. I hope to get people from the Unity user community involved in testing the system as it is developed, since one important success criteria is the usefulness and usability as perceived by the developers using the system. It will take some time before the first prototype is ready though, as I've only just begun.

The project up until now
My original "pitch" of the project to Unity was a presentation based on this slideshow:
See PowerPoint slidehow

A few ideas have already changed since that. For one thing, the idea that animators must enrich the animation cycles with additional data has been abandoned. The data needed is for example information about when exactly each foot leaves the ground and land on the ground again. The new plan is that this will be automatically analyzed and calculated by the system. More on that in a later post.

In order to quickly get my feet wet, I've made this little demo, where I have modified the Goober guy that comes with one of the Unity tutorials, and made his legs use some very simple inverse kinematics:


Click the image to make the demo run in the browser. Just click yes to install the Unity browser plug-in. Note that in this simple demo I simply adjusted the altitudes of the feet, so feet slippage etc. are not prevented. The actual system will work in a completely different way.

I have already gotten some interest and positive feedback in the Unity forums. Stay tuned!

runevision blog online

Mar 3 2008
My website runevision.com has been online since 1998. Now, ten years later, runevision blog is started to make it simpler for me to communicate developments in ongoing projects and other things in my life.

For a start, the blog will mainly be centered around my master thesis project on Adaptive Animation for Character Locomotion, which I have just begun working on. For the next half a year, this blog will be a place for myself and others to track the progress of the project, see the ongoing results, read about the thoughts behind the technical details, and roll eyes at the occasional silly remarks.

The master thesis marks the end of my education in Multimedia with specialization in Games Programming at the University of Aarhus, Denmark. After my graduation, I am looking forward to a carreer in the game industry as a games programmer. Well, enough background - you can always go to runevision.com for more. The blog is now officially open. (Note: Post appearing before this one have been migrated retroactively from my own news entry system.)