Locomotion
Creation
- Behavior Editor / Behavior Library:
- Golaem Menu: Crowd Behaviors / Behaviors / CrowdBe Locomotion Node
- MEL command: glmCrowdBeLocomotionCmd;
Best practices
As the Locomotion Behavior may blend any pair of Motion Clip in its set, it is recommended to only use Motion Clips with the same style. For instance, if there is one motion with arms up and another with arms down, the character will constantly move arms up and down as a side effect of the locomotion, which is usually not expected.
In such a case, two different Locomotion Behavior (one for arms up, the other one for arms down) should be created, and the switch between the two made when desired by using a trigger.
Best practices for the creation of the motion set are described here.
Configuration
Motion Attributes
Motion Files (.gmo file) |
Motions Clips to use in the Locomotion System. Notice that the provided Motion Clips need to define a root translation and/or delta orientation (used to compute the original velocity of the motion). See the Motion Tab of the Character Maker or the Motion Clip attributes to see how to ensure Motions are correct and edit them.
|
Compute Mirror | Check each Motion File loaded and if it corresponds to a turn, enable Motion mirroring on it |
Motion Mapping Attributes
Motion Mapping Mode / Motion Mapping File |
This attribute allows a choice of four motion mapping modes :
|
Starting / Stopping Duration Attributes
Starting / Stopping Duration Mode |
This attribute allows a choice of two modes :
The Starting / Stopping Duration value is in seconds. |
Starting / Stopping Duration Min | See Random option of the Starting / Stopping Duration Mode above Available only when the Starting / Stopping Duration Mode is set to "Random" |
Starting / Stopping Duration Max | See Random option of the Starting / Stopping Duration Mode above Available only when the Starting / Stopping Duration Mode is set to "Random" |
Starting / Stopping Durationpp Name | Name of the float per-particle field of the relative particle system, containing the Starting / Stopping Duration Mode value which will be used (for more explanation about how to use ppAttributes, see ppAttributes Handling) Starting / Stopping Duration value is set to 0 if the ppAttribute name is empty or invalid Available only when the Starting / Stopping Duration Mode is set to "Per-Particle Attribute" |
Body Mask Attributes
By default, a motion is played on the entire body (as specified in the Motion Mapping File). But the Motion Mapping File configuration can be filtered by the body mask to replay the animation only on specified channels.
Body Mask Attributes of a Motion Behavior
Pelvis | If this box is checked, the pelvis part of the motion will be played. The pelvis part includes the global position and orientation of the animation. If not checked, the animation will be played "in place" |
Spines | List of the spines nodes to play on the entity. Use the button to open a window with the name of all the available spines for the Character Files loaded in the scene. Those names can also be found in the Motion Mapping Panel of the Character Maker. Star ( * ) wildcard is authorized at the beginning or/and end of names (i.e. spine*, *spine, etc.). Separate the channel names by comma ( , ), leading and trailing spaces will be ignored. Use the * wild card to use all limbs. Names are NOT case sensitive (compared as lowercase). |
Limb Channels |
List of the limbs channels to play on the entity. Use the button to open a window with the name of all the available Limbs for the Character Files loaded in the scene. Those names can also be found in the Motion Mapping Panel of the Character Maker. |
Effector Channels | List of the effectors channels to play on the entity. Use the button to open a window with the name of all the available Effectors for the Character Files loaded in the scene. Those names can also be found in the Motion Mapping Panel of the Character Maker. Star ( * ) wildcard is authorized at the beginning or/and end of names (i.e. left*, *arm, etc.). Separate the channel names by comma ( , ), leading and trailing spaces will be ignored. Use the * wild card to use all effectors. If an effector channel is selected, the corresponding limb channel is automatically added also. Names are NOT case sensitive (compared as lowercase). |
Blind Data Groups |
List of Blind Data Nodes or Blend Shape Groups to play on the character. Use the button to open a window with the name of all the available Blind Data Nodes and Blend Shape Groups for the Character Files loaded in the scene. Those names can also be found in the Skeleton Mapping panel of the Character Maker. |
Blind Data | List of Blind Data or Blend Shape to play on the character. Use the button to open a window with the name of all the available Blind Data and Blend Shape for the Character Files loaded in the scene. Those names can also be found in the Skeleton Mapping panel of the Character Maker. Star ( * ) wildcard is authorized at the beginning or/and end of names (i.e. mouth*, *eye, etc.). Separate the Blind Data / Blend Shape names by comma ( , ), leading and trailing spaces will be ignored. Use the * wild card to use all Blind Data / Blend Shape. Names are NOT case sensitive (compared as lowercase). |
Start Percent Attributes
Start Percent Mode | This attribute allows a choice of two Start Percent modes :
Start Percent mode of a Locomotion Behavior
|
Start Percent Random Min | See Random option of the Start Percent Mode above Available only when the Start Percent Mode is set to "Random" |
Start Percent Random Max | See Random option of the Start Percent Mode above Available only when the Start Percent Mode is set to "Random" |
Start Percentpp Name |
Name of the float per-particle field of the relative particle system, containing the Start Percent value which will be used on the Motion (for more explanation about how to use ppAttributes, see ppAttributes Handling) |
Priority/Weight Attributes
If several Motion or Locomotion behaviors are played at the same time on the same part of the body, only the behaviors with the highest priority will be played. If several behaviors share the same priority, they will be blended together according to their weight normalized value (for instance, if two Motion behaviors share the same priority with a weight value of 1, they will be blended each at 50%).
See the Body Mask attribute to know how to apply a behavior on specific parts of the body
Priority |
Priority to affect to Locomotion Behavior |
Weight Mode | This attribute allows a choice of two Weight modes :
Weight mode of a Locomotion Behavior
|
Weight Random Min | See Random option of the Weight Mode above Available only when the Weight Mode is set to "Random" |
Weight Random Max | See Random option of the Weight Mode above Available only when the Weight Mode is set to "Random" |
Weightpp Name | Name of the float per-particle field of the relative particle system, containing the Weight value which will be used on the Motion (for more explanation about how to use ppAttributes, see ppAttributes Handling) Weight value is set to 0.5 if the ppAttribute name is empty or invalid Available only when the Weight Mode is set to "Per-Particle Attribute" |
Locomotion Attributes
Control Mode |
|
Reactivity |
In Follow Mode, this factor that determine how much an entity will try to correct the position error with its particle instead of following the particle's velocity. If set to 0, the entity will not try to correct its position at all (and will just use the particle's velocity), if set to 1, the entity will compromise between the position error correction and the particle's velocity. |
Max Linear Acceleration | In Follow Mode, this attribute determines the max change of linear velocity when new velocities are computed. Higher value will allow a better reactivity but with the risk of glitches in the animation (unit: meters/second²) |
Max Blending Angular Acceleration | In Follow Mode, cap the acceleration that can be produced by the blending to avoid too abrupt changes in chosen animations. In case the Delaunay triangulation, produced by locomotion database, has some very flat triangles, this may help having some fluid blending. Note that the preferred solution would be to have a coherent locomotion animation set that does not produce flat triangles. |
Max Angular Velocity Correction |
In Follow Mode, once the locomotion blending has occurred, the additional angular velocity correction which helps to catch up requested angular speed cannot exceed this value (in degrees, per frame). |
Frames to Mean Angular Velocity | In Direct Mode, the angular velocity will be a mean of x last frames. This is used to damp oscillations of input velocity direction. |
Target Reached Threshold | When the distance between the particle and the entity is smaller than this threshold, the target is considered reached (unit: meters) |
Moving Entity Velocity Threshold | When the entity's speed is under this threshold, the locomotion considers it's not moving anymore |
Min Update Period | In Follow Mode, this attribute determines the minimum interval at which new velocities are computed (unit: seconds) |
Max Update Period | In Follow Mode, this attribute determines the maximum interval at which new velocities are computed (unit: seconds) |
Max Delta Position | In Follow Mode, this attribute determines the maximum position difference (between the particle and the entity) before new velocities are computed (unit: meters) |
Max Delta Velocity | In Follow Mode, this attribute determines the maximum velocity difference (between the particle and the entity) before new velocities are computed (unit: meters/second) |
First Motion Attributes
Replay Ratio | In Follow Mode, this attribute determines the ratio of the first motion to play before using the follow mode (1 means it will be played at 100%, 0.5 means only the first half will be played). See the first motion part for more explanations. |
Starting Duration | In Follow Mode, this attribute determines the starting duration of the first motion to play (works as explained in the Motion Attributes, but for the first motion). See the first motion part for more explanations. |
Stopping Duration | In Follow Mode, this attribute determines the stopping duration of the first motion to play (works as explained in the Motion Attributes, but for the first motion) See the first motion part for more explanations. |
Starting Velocity Attributes
Starting Linear Velocity | The linear velocity that is considered when starting the behavior (taken into account for accelerations) |
Starting Angular Velocity | The angular velocity that is considered when starting the behavior (taken into account for accelerations) |
Enable Time Warping |
If checked, the motion will be blended with time warping on limbs. Time warping is a technique that allows to locally change the speed ratio of a motion to ensure better synchronization with other motions. |
Create Neutral Animation If Needed | If checked, an empty animation will be added in the Motion Clips set to ensure there is a motion for null linear and angular velocities. |
Check collision with navmesh | In Direct Mode controlled by animation, checking this option will prevent the animated skeleton from getting out of the navmesh by projecting it on its last known position on the navmesh. |
Advanced Attributes
Interpolate Between Frames |
If checked, the motions will interpolate postures between frames of the animation. This usually gives better results, but if your motions have a framerate superior to the Maya framerate, this option can be unchecked for performances purposes. |
IK plane roll from animation | This option should be checked when some specific animation produce a bad knee/elbow position on characters |
Motions sync mode |
This option specify how the animations in the locomotion set are synchronized together:
|
Visual Feedback Attributes
Defines the Locomotion Behavior Visual Feedback displayed in the Crowd Visual Feedback. For common Visual Feedback attributes see Behavior Common Attributes.
Notice that these attributes can also be configured in the Crowd Visual Feedback
Locomotion Model |
Show the locomotion model relative to the set of motions added to the Locomotion Behavior inside the Crowd Visual Feedback. Locomotion Model in the Crowd Visual Feedback
Some info on the locomotion database are written on the upper left corner (for instance, you can check whether the database is 1d or 2d, or check the triangle count to ensure there are no flat triangles in the database)
There are four dots displayed on the base:
A tooltip with the detail of the relative Motion Clip is available upon each intersections.
It's possible to zoom (mouse wheel) and drag (hold left mouse button + move) in the locomotion model view.
|
Motions |
Show motions and their current weight inside the Crowd Visual Feedback according to the Motions mode:
|
Depending on the animation set, a one-dimension locomotion database might be detected as a two-dimension one, inducing some wrong blending between the motions at the extremity of the database. If such a thing occurs, the way to fix it is to increase the Delaunay Databse Epsilon parameter located in the extra attributes of the Locomotion Behavior.
Algorithm
Blending Weights in Direct Mode
In direct mode, the entity's position is locked on the particle's position. The velocity or the particle is used directly to drive the blend weights of the Motion Clips.
Blending Weights in Follow Mode
In follow mode, the entity's position is not locked on the particle's position. The position/velocity error between the entity and the particle is used to drive the blend weights of the Motion Clips.
At runtime, the behavior computes the difference between the particule's position/velocity and the entity's position/velocity | and find the best linear/angular velocities to correct this error | Finally, the behavior uses the two-dimensional parametric space to find the three nearest motions of this desired linear and angular velocities to blend together |
Blending Weights in Direct Mode Controlled by Animation
In direct mode controlled by animation, the particle is locked on the entity, but the navigation do not drive it's position. Instead, it just issue commands on linear and angular velocity that the locomotion is trying to follow, which then drives the position/orientation of the entity.
To check out the command issued by the navigation, and how well the locomotion do respond to it, you can open the Crowd Visual Feedback:
Particle's velocity (right) is the issued command while Entity's velocity (left) is what the locomotion managed to do with it's given set of animations
First Motion
When the particles starts moving, a specific process takes place to ensure the best starting animation as possible:
with first motion |
without first motion |
Here is how it works:
- When the particles starts moving, the behavior computes the difference between the new moving direction and the current entity's orientation
- Then the behavior checks the changes of direction in all the motions in set:
45° left | 180° left | 180° right |
- And the best motion (in this case: 180° left) is played once before the follow mode starts.
The first motion is not synchronized with other motions in the locomotion set.