Locomotion FAQ

The Locomotion Behavior will blend a set of motions to get the best possible animation based on the character's particle velocity and orientation. It should then be used when the motion to be played depends on these parameters (typically walk, run... but it could also be a bird flapping wings).

Contrary to the Motion Behavior, the Locomotion Behavior will not drive the particle, but follow it. It is then particularly well adapted for usage with Navigation / GoTo Behaviors or Maya fields (as the Motion Behavior would modify trajectories) but it also means that if your particles are not moving, the Locomotion Behavior will simply play a rest motion.

Each individual animation may looks nice, but once they're all in a Locomotion Set, they're going to be blended together depending on the linear and angular speeds of the character, so many things may hurt the animation's quality.

Are Animations working correctly ?

First thing first, make sure all the animations do work correctly when individually used in a Motion Behavior. Check that they are cyclic and that each motion and contain one and only one support phase / footprint per channel.

Did you follow the locomotion set creation guidelines ?

The Creating a Locomotion Set page explains how to create a working locomotion set.

Did you check if the motion footprints are correct?

The Setting Footprints on your Motions tutorial explains how to check and fine-tune them. This is crucial to the quality of the Locomotion Behavior output.

Are Animations of the same style ?

Make also sure that all animations in the locomotion set have the same style and can be correctly blended together as stated here.

Is the Locomotion Set correct ?

If using the locomotion still produce animation glitches, the problem might be a badly distributed locomotion set in terms of linear and angular speeds. To check this, it'll be needed to start the simulation and select a character to display the Visual Feedback Tool.

Look out for the Locomotion Behavior and check the Locomotion Database:


A correctly distributed locomotion database

Each of the dot in the visual feedback corresponds to one of the motions in the locomotion set, its coordinates being its angular and linear speeds.

The red dot is the desired linear and angular velocities (the control command), and the triangle in which it stands are the 3 motions that are currently blended together. When the navigation asks for different velocities, the control command will be changed accordingly, and so will the blended animation's weights.

Now when the database has very narrow triangles, it means that any slight change in the control command may bring a wide change in the blending parameters, or even change the currently blended motions ("switching between different motions"), so it's strongly advised to avoid narrow triangles in this database. When narrow triangles are identified, it's useful to also identify the motion files that produce them. This is done by putting the mouse on each point, which should bring a tooltip showing the name of the motion, as well as its angular and linear velocities:


Tooltip information for a motion in the database

Here are some examples of badly configured locomotion set:

Two animation have almost the same linear and angular velocities.
In that case, the two walk animation are different variations of the same animation. They should be configured as variations, check here.

An animation with a very little angular velocity was used together with it's mirror version. That produce a very narrow triangle and should not be done. Only animations with a high enough angular velocity should be used with their mirror version. Check the mirror configuration in the locomotion behavior documentation.

This locomotion set only uses animations that turns on left side but none turning on the right side. Check out this FAQ.

Is acceleration set correctly ?

When blending animations together, the weight of each animation changes accordingly with the maximum acceleration allowed. When the acceleration is too high, it might produce pops in the animation due to weights changing too much in one single frame.

To check if this is the case, find out the frame at which a character's animation 'pop', and select it to to display the Visual Feedback Tool. Check what are the weights of the animation at the frame before the pop, and the frame after the pop. If the difference is too big, then the pop comes from either a big linear or angular acceleration.


Exemple of an acceleration that produces a pop: at one frame, the WalkSlow_Leftfoot animation has a weight of 82%, while it has a weight of 0% at the next frame

To check if the problem is a too bug linear or angular acceleration, look out for the red dot in the locomotion database before and after the "pop":

  • if it moves a lot from left to right, the problem is the angular acceleration value;
  • if it moves a lot from up to down, the problem is the linear acceleration value.

Change the maximum acceleration value in the locomotion parameters:


The parameters to change are the "Max Linear Acceleration" and "Max Blending Angular Accel."

Is there a synchronization problem ?

Last thing to check when there is an animation pop in the locomotion is the check if there is a discontinuity in replaying the frames of a single animaiton. For this also, find out the frame at which a character's animation 'pop', and select it to to display the Visual Feedback Tool.

But this time, instead of checking the weights of the animations, check for the frame they are playing and make sure there it doesn't jump from one frame to a very different frame in the animation:


The frame currently played by an animation is displayed between the name and the weight (here WalkSlow_Leftfoot is playing frame 5.8 and the animation has a total of 53 frames)

Finally, if only legs are popping but the rest of the body is fine, it might be a Time Warping issue. Try unchecking the option in the Locomotion Attributes to check if it solves the issue.

To get better animation results, when using the Locomotion Behavior, characters are driven by their particles but not attached on it.

When the particle's speed and orientation are inside the reachable speed/orientation defined by the motions in the Locomotion Behavior, they usually keep up with their particles. However, if the provided motions do not enable the characters to match the particle's speed/orientation, the character may eventually get far from its particle and produce hectic moves.

To check what happens, click on a character an have a look at the Locomotion Behavior Visual Feedback.

For example, if you are using the Navigation Behavior to drive your characters, you will probably need to adjust the Random Min and Max speeds, as well as the Acceleration/Deceleration parameters.


Note that there are also max acceleration parameters in the Locomotion Attributes of the Locomotion Behavior.

NB: if you really need your characters to stay on their particles, you can choose to put your Locomotion Behavior in Direct Mode in the  Locomotion Attributes, however it may affect the animation quality.

Depending on the spread between the particle start direction and your characters initial orientation, you may need to add Starting Motions in your locomotion so that they can go in the right direction more quickly.

 

In some cases, your neutral motion (0 m/s, no turn) can be chosen as a starting motion. If this neutral motion is long, it may differ the departure of the character. In this case you can lower the 1st Motion Replay Ratio in the Locomotion Attributes of your Locomotion Behavior.

If they cannot turn, you probably forgot to add turning motions in your locomotion, or forgot to add mirrored motion clips for each turning motions



Locomotion Model including only turn left motions Locomotion Model with mirrored motions

For example if your set of motions include only turn left motions, you should activate the mirror motion on them, click the  yellow hemisphere icon so that it becomes a yellow ball.

 

You should also check that there is no warning in the script editor about missing mirror mapping in your character file, otherwise the mirrored motions will be ignored.

You probably did not provide a neutral motion (0m/s, no turn) in your Locomotion Behavior.

Golaem Crowd hence create one for you, based on the default pose (usually T-Pose) and mix it with your other motions when the characters are near stopping.

You should either provide a rest motion or uncheck the "create neutral animation if needed" in the Locomotion Attributes.

The continuity of the feet position when blending different motions is done by an algorithm called Synchronization.

A prerequisite of this algorithm is the fact that footprints are defined for each motion in the Locomotion Behavior and these motions only contain one and only one walk cycle (i.e. 2 footsteps for a biped, or more generally one support phase per channel). The only exceptions to this rule are the neutral / starting motions

If the motions cannot be used for synchronization,  you will experience problems like playing the same feet twice or bumps (see below)

Check Setting Footprints on your Motions for full details


Locomotion including a motion with wrong footprints


Same locomotion with correct footprints

Getting animation diversity means playing a different set of motions on each characters for the same behavior (e.g different walking styles). The choice for each character is done once at the beginning of the simulation. If what you want to achieve is more closely link to behaviors and you want to be able to dynamically change style, take a look at the related question on this page.

The first thing to do in order to increase animation diversity within the same motion style is to use increase the Randomize Start Offset.

In order to use different motion styles, you need to use  Locomotion Channels on your Motion Clips in order to avoid mixing motions from different style together.

This answer applies if you want to dynamically switch between different style of Locomotion on the same character (e.g neutral, attack, defense for a soldier... or walk, trot, galop for a horse). If you want to get diversity by applying different styles among characters without dynamical switch, see the animation diversity question on this page.

Even if your styles apply to different speed/orientation, it is never a good idea to mix them in the same Locomotion Behavior. If the character happens to be in an in-between situation it will blend back and forth between different styles which could result in the soldier frantically switching between walk and run or the horse blending trot and galop motions with an odd result.


Locomotion mixing motions from different styles, resulting in odd jumps

 

Instead you should create a separate Locomotion Behavior for each style, and switch between them using triggers (in the below example the trigger is based on current frame, but it could be linked  to the velocity of your character or whatever...)


Switching between 2 Locomotion Behaviors using triggers


Result of the above setup, playing styles one after another

 

As the characters are only driven by the particles and not directly snapped on them, you can easily understand why the Entity and Linear velocities are different from the particle's velocity (you can also see the related question on this page)

However why are the Linear velocity and Entity Velocity so different?

First, the Linear velocity is a 2D speed while the Entity Velocity is 3D. On top of this, as its name implies the Linear velocity only accounts for the Linear component of the speed (not the angular one).

However, even if your character is going perfectly straight on a flat ground, the Linear velocity and Entity Velocity WILL be different. Indeed, the Entity Velocity is the velocity of the root bone of your character, which moves independently from the position of your character. E.g. a jumping in place character will have a 0 linear velocity, while the speed of its root bone (Entity Velocity) will always be greater than 0 (going up or down).

The conclusion is that you should not rely on the Entity Velocity to control your locomotion (e.g. triggering a different style...)

As a general rule, the linear velocity of your turn motions should not be greater than the fastest of your motion, nor lesser than the slowest one.
It also seems logical that the turn motions are closer to the slowest motion, as you are supposed to slow down when you turn.
 
In extreme cases (when the slowest and fastest motions are really far), you will not get a vertical line separating your triangles.
This is a really bad configuration because it means that the blend of motions to get a "go straight motion" will mainly be done between two turn motions.
In this case, you will need to add a straight motion around the same linear speed as your turn motions in order to enhance the model.