An LMG is an XML file containing a blend-code and a list with animation names in fixed order. The blend-code is used at loading time to identify the type of the LMG, to extract the features out of the root-motion, to verify the assets and to compute the blend-values at run time. The game simply specifies a parameter and the anim-system generates the desired motion. The motion features are extracted directly out of the clips.
The idea behind locomotion groups is to collect multiple variations of a motion-type and arrange them in a spatial data-structure (=blend-space). At run-time apply interpolation and extrapolation techniques to create an infinite number of motions between and around these example motions. Animating human figures can be very complex, but it is possible to describe many actions by a relatively small number of motion-parameters. For example, a locomotion cycle might be characterized by the speed, body-orientation, travel-direction, turn-radius and slope-angle. Such kinematic and physical properties can be combined with abstract properties like mood or style.
Many of these properties (style, speed, turn-radius, body-direction and travel-direction) are already captured in the motion-clips. These are the natural motion-parameters. In a game, you want to control these features on an interactive level by simply stating what these features should be. Many games use motion-clips to animate a character. Motion-clips are static pieces and by default they only allow to play back what has been recorded. Similar to a static video they just reproduce pre-stored sequences and remain the same each time they are played. Interactivity and responsiveness is hard to achieve. While a programmer is not required to use existing LMG blendcodes, programmers are needed for their creation. Fortunately, LMG blendcodes already exist for most locomotion purposes.
The LMG Editor supports LMG blendcodes for almost every situation, and can be extended to support even more. The LMG_Type.inc file lists all of the existing LMGs, along with a short description of what they do.
Following is a sample list of currently existing blendcodes, and examples of how they are used.
Strafing in six different directions at one single speed.
Direction | Animation Description |
---|---|
0, 1, 0 | forward_slow: Forward movement |
-1, 1, 0 | fLeft_slow: Forward and left movement |
1, 0, 0 | left_slow: Left movement |
0,-1, 0 | back_slow: Backwards movement |
1,-1, 0 | bRight_slow: Backwards and right movement |
+1, 0, 0 | right_slow: Right movement |
LMG type | Functionality |
---|---|
S__1 | Strafing in six different directions at one single speed. Can be used for a crouch-walk LMG. |
S__2 | Strafing in six different directions at two different speeds. |
ST_2 | Strafing in six different directions and turning left/right when running forward. |
S_H2 | Strafing in six different directions at two different speeds with uphill/downhill. |
STH2 | Strafing in six different directions at two different speeds and turning left/right when running forward and uphill/downhill. |
LMG type | Functionality |
---|---|
ISTP | When a character is standing, use this LMG for small adjustments of his current location. Allows the character to make small steps in all directions |
TSTP | When a character is standing, use this LMG for small rotations about the vertical axis. Allows the character to make small steps in a circle. |
LMG type | Functionality |
---|---|
I2M1 | Transition-assets from standing idle to locomotion. |
I2M2 | Transition-assets from standing idle to locomotion. This LMG allows to specify the target speed |
M2I1 | Transition-assets locomotion to standing idle |
LMG type | Functionality |
---|---|
FLR1 | Running forward and tuning left/right at one speed. |
FLR2 | Running forward and tuning left/right at two speeds. |
FLR3 | Running forward and tuning left/right at three speeds. |
STF1 | Strafing in four different directions at one single speed. Can be used for a crouch-walk LMG. |
STF2 | Strafing in four different directions at two speeds. |
IROT | General blending between three assets. Good for debugging. |
<LocomotionGroup>
<BLENDTYPE type="STH2" />
<CAPS code="RUN_" />
<ExampleList>
<!-- Uphill fast and slow -->
<Example Position=" 0, 1, 0" AName="combat_runUphill_mg_forward_fast_01" />
<Example Position="-1, 0, 0" AName="combat_runStrafe_mg_left_fast_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_fast_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_right_fast_01" />
<Example Position=" 0, 1, 0" AName="combat_runUphill_mg_forward_slow_01" />
<Example Position="-1, 0, 0" AName="combat_runStrafe_mg_left_slow_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_slow_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_right_slow_01" />
<!-- Move 6 directions fast (It actually has a forward 'sprint'.) -->
<Example Position=" 0, 1, 0" AName="combat_sprint_mg_forward_01" />
<Example Position="-1, 1, 0" AName="combat_runStrafeCross_mg_fLeft_fast_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_left_fast_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_fast_01" />
<Example Position=" 1,-1, 0" AName="combat_runStrafeCross_mg_bRight_fast_01" />
<Example Position="+1, 0, 0" AName="combat_runStrafe_mg_right_fast_01" />
<!-- Forward run-fast -->
<Example Position=" 0, 0, 0" AName="combat_run_mg_forward_fast_01" />
<!-- Move 6 directions slow -->
<Example Position=" 0, 1, 0" AName="combat_run_mg_forward_slow_01" />
<Example Position="-1, 1, 0" AName="combat_runStrafeCross_mg_fLeft_slow_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_left_slow_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_slow_01" />
<Example Position=" 1,-1, 0" AName="combat_runStrafeCross_mg_bRight_slow_01" />
<Example Position="+1, 0, 0" AName="combat_runStrafe_mg_right_slow_01" />
<!-- TurnLeft/Right fast and slow -->
<Example Position="-1,+1, 0" AName="combat_run_mg_left_fast_01" />
<Example Position="+1,+1, 0" AName="combat_run_mg_right_fast_01" />
<Example Position="-1,-1, 0" AName="combat_run_mg_left_slow_01" />
<Example Position="+1,-1, 0" AName="combat_run_mg_right_slow_01" />
<!-- Downhill fast and slow -->
<Example Position=" 0, 1, 0" AName="combat_runDownhill_mg_forward_fast_01" />
<Example Position="-1, 0, 0" AName="combat_runStrafe_mg_left_fast_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_fast_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_right_fast_01" />
<Example Position=" 0, 1, 0" AName="combat_runDownhill_mg_forward_slow_01" />
<Example Position="-1, 0, 0" AName="combat_runStrafe_mg_left_slow_01" />
<Example Position=" 0,-1, 0" AName="combat_run_mg_back_slow_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_mg_right_slow_01" />
</ExampleList>
</LocomotionGroup>
<LocomotionGroup>
<BLENDTYPE type="S_H2" />
<CAPS code="WALK" />
<ExampleList>
<!-- Uphill fast and slow -->
<Example Position=" 0, 1, 0" AName="relaxed_walkUphill_nw_forward_fast_01" />
<Example Position="-1, 0, 0" AName="relaxed_walkStrafe_nw_left_fast_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_fast_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_right_fast_01" />
<Example Position=" 0, 1, 0" AName="relaxed_walkUphill_nw_forward_slow_01" />
<Example Position="-1, 0, 0" AName="relaxed_walkStrafe_nw_left_slow_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_slow_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_right_slow_01" />
<!-- Move 6 directions fast -->
<Example Position=" 0, 1, 0" AName="relaxed_walk_nw_forward_fast_01" />
<Example Position="-1, 1, 0" AName="relaxed_walkStrafeCross_nw_fLeft_fast_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_left_fast_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_fast_01" />
<Example Position=" 1,-1, 0" AName="relaxed_walkStrafeCross_nw_bRight_fast_01" />
<Example Position="+1, 0, 0" AName="relaxed_walkStrafe_nw_right_fast_01" />
<!-- Move 6 directions slow -->
<Example Position=" 0, 1, 0" AName="relaxed_walk_nw_forward_slow_01" />
<Example Position="-1, 1, 0" AName="relaxed_walkStrafeCross_nw_fLeft_slow_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_left_slow_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_slow_01" />
<Example Position=" 1,-1, 0" AName="relaxed_walkStrafeCross_nw_bRight_slow_01" />
<Example Position="+1, 0, 0" AName="relaxed_walkStrafe_nw_right_slow_01" />
<!-- Downhill fast and slow -->
<Example Position=" 0, 1, 0" AName="relaxed_walkDownhill_nw_forward_fast_01" />
<Example Position="-1, 0, 0" AName="relaxed_walkStrafe_nw_left_fast_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_fast_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_right_fast_01" />
<Example Position=" 0, 1, 0" AName="relaxed_walkDownhill_nw_forward_slow_01" />
<Example Position="-1, 0, 0" AName="relaxed_walkStrafe_nw_left_slow_01" />
<Example Position=" 0,-1, 0" AName="relaxed_walk_nw_back_slow_01" />
<Example Position=" 1, 0, 0" AName="relaxed_walkStrafe_nw_right_slow_01" />
</ExampleList>
</LocomotionGroup>
Creating animations for interactive products is a process that involves very close collaboration and a tight feedback loop between programmers, animators and designers.
An LMG can be as simple or as complicated as needed. It depends mainly on the animation quality you want to achieve. All LMGs start with a Blendtype followed by a four char value. Internally the blend-type is used to connect the LMG with the C++ code to process and blend the example-animations. After the blend-type there is an example-list of animation assets. Each example has a position followed by a 3D-value. This 3d-value is the position of the animation assets in the blend-space. The variable AName is the name of the animation (not the file-path). It is necessary to have this animation-name in the CAL-file, or the validity check with mark this LMG as invalid at loading time.
The example bellow is an LMG to create a run in six directions at one single speed. In this case the game can choose the strafing-direction only.
<LocomotionGroup> <BLENDTYPE type="S__1" />
<ExampleList>
<Example Position=" 0, 1, 0" AName="combat_run_rifle_forward_slow_01" />
<Example Position="-1, 1, 0" AName="combat_runStrafeCross_rifle_fLeft_slow_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_rifle_left_slow_01" />
<Example Position=" 0,-1, 0" AName="combat_run_rifle_back_slow_01" />
<Example Position=" 1,-1, 0" AName="combat_runStrafeCross_rifle_bRight_slow_01" />
<Example Position="+1, 0, 0" AName="combat_runStrafe_rifle_right_slow_01" />
</ExampleList>
</LocomotionGroup>
The example below is an LMG to create a run in six directions at two different speeds. In this case the game can choose the strafing-direction only and the running-speed. Other features are not supported by this LMG-type.
<LocomotionGroup> <BLENDTYPE type="S__2" />
<ExampleList>
<Example Position=" 0, 1, 0" AName="combat_run_rifle_forward_slow_01" />
<Example Position="-1, 1, 0" AName="combat_runStrafeCross_rifle_fLeft_slow_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_rifle_left_slow_01" />
<Example Position=" 0,-1, 0" AName="combat_run_rifle_back_slow_01" />
<Example Position=" 1,-1, 0" AName="combat_runStrafeCross_rifle_bRight_slow_01" />
<Example Position="+1, 0, 0" AName="combat_runStrafe_rifle_right_slow_01" />
<Example Position=" 0, 1, 0" AName="combat_run_rifle_forward_fast_01" />
<Example Position="-1, 1, 0" AName="combat_runStrafeCross_rifle_fLeft_fast_01" />
<Example Position=" 1, 0, 0" AName="combat_runStrafe_rifle_left_fast_01" />
<Example Position=" 0,-1, 0" AName="combat_run_rifle_back_fast_01" />
<Example Position=" 1,-1, 0" AName="combat_runStrafeCross_rifle_bRight_fast_01" />
<Example Position="+1, 0, 0" AName="combat_runStrafe_rifle_right_fast_01" />
</ExampleList>
</LocomotionGroup>