Locomotion Groups

Obsolete
Locomotion Groups have been replaced by BSpaces since SDK release 3.5

Overview

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.

LMG Tips and Pitfalls

  • The assets inside an LMG do not all have to have the same number of cycles. It is possible for example to make a locomotion lmg up of 1-cycle assets in all directions and just have a forward asset that for example has 8 steps instead of 2 in it. The forward asset will need footstep markup in this case so that the blending matches. See here to see how to mark up footsteps on an asset in the Character Editor.
  • The Position params of tags in an LMG xml file have a meaning only for specific !LMG types.
  • Your character needs heel bones to play uphill/downhill motions properly in the current codebase.
    • You can check that in CAnimatedCharacter::PostProcessingUpdate().
  • The console variable, ac_debugSelectionParams is useful for debugging LMG selections
  • If an LMG doesn't work properly under the speed variation, first check whether the assets have speed attributes properly.

Currently Supported Blend Codes

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.

Example: S__1: basic features explanation

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-types used for walking and running

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-types used for idle-steps and idle-rotations

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-types for start and stops

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

These can be used for debugging

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.

STH2 Example

 <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>

S_H2 Example

<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 New LMG Types

  • A programmer (in cooperation with an animator) defines the features of an LMG.
  • The animator creates the required assets.
  • The programmer creates the template for this LMG (=the LMG file) and writes the C++ code to calculate the blend-weights for the motion-assets.
  • Once the code for one LMG-type is written, the animator can use the LMG-template for other compatible animations.

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>

Summary of LMG Types

  • IROT or TSTP: idle rotation
    • 3 assets: right, middle, left
  • M2I1: Move2Idle with 1 speed
    • 1 asset
  • I2M1: Idle2Move with 1 speed
    • 6 assets: fr, rr, br, fl, ll, bl
  • I2M2: Idle2Move with 2 speeds
    • 12 assets: fr_slow, rr_slow, br_slow, fl_slow, ll_slow, bl_slow, fr_fast, rr_fast, br_fast, fl_fast, ll_fast, bl_fast
    • ca_DrawIdle2MoveDir
    • Currently imlemented to always use the fast set... I don't know why;
  • ISTP: Idle Step
    • 7 assets: fr, rr, br, fl, ll, bl, idle
  • TRN1: Turn with 1 speed
    • 5 assets: right180, right90, forward, left90, left180
  • STF1: Strafe with 4 directions
    • 4 assets: f, l, b, r
  • STF2: Strafe with 8 assets in 2 speeds
    • 8 assets: ff, fl, fb, fr, sf, sl, sb, sr
  • SUD2: Strafe with Uphill/Downhill in 2 speeds
    • 24 assets: uff, ufl, ufb, ufr, usf, usl, usb, usr, ff, fl, fb, fr, sf, sl, sb, sr, dff, dfl, dfb, dfr, dsf, dsl, dsb, dsr
    • deprecated
  • S__1: Strafe with 6-direction assets
    • 6 assets: f, fl, l, b, br, r
    • fl, br are more important (than fr, bl) because of using 'right-foot-first' animations.
  • S__2: Strafe with 6-direction and 2 speeds assets
    • 12 assets: ff, ffl, fl, fb, fbr, fr, sf, sfl, sl, sb, sbr, sr
  • ST_2: Strafe with 6-direction / 3 forward speeds assets / 2 direction speeds / left-right turns
    • 17 assets: ff, ffl, fl, fb, fbr, fr, mf, sf, sfl, sl, sb, sbr, sr, ftl, ftr, stl, str
  • S_H2: Strafe with 6-direction / 2 direction speeds / uphill-downhill
    • 28 assets: uff, ufl, ufb, ufr, usf, usl, usb, usr, ff, ffl, fl, fb, fbr, fr, sf, sfl, sl, sb, sbr, sr, dff, dfl, dfb, dfr, fsf, dsl, dsb, dsr
  • STH2: Strafe with 6-direction / 3 forward speeds assets / 2 direction speeds / left-right turns / uphill-downhill
    • 33 assets: uff, ufl, ufb, ufr, usf, usl, usb, usr, ff, ffl, fl, fb, fbr, fr, mf, sf, sfl, sl, sb, sbr, sr, ftl, ftr, stl, str, dff, dfl, dfb, dfr, fsf, dsl, dsb, dsr
  • STHX: Strafe with 4-direction / 3 forward speeds assets / 2 direction speeds / left-right turns / uphill-downhill
    • 29 assets: uff, ufl, ufb, ufr, usf, usl, usb, usr, ff, fl, fb, fr, mf, sf, sl, sb, sr, ftl, ftr, stl, str, dff, dfl, dfb, dfr, fsf, dsl, dsb, dsr
    • deprecated
  • WFW2: Just 2 speeds
    • 2 assets
  • RFW3: Just 3 speeds
    • 3 assets
  • FLR1: Forward-Left-Right in 1 speed
    • 3 assets: l, f, r
  • FLR2: Forward-Left-Right in 2 speeds
    • 6 assets: fl, ff, fr, sl, sf, sr
  • FLR3: Forward-Left-Right in 3 speeds
    • 7 assets: fl, ff, fr, mf, sl, sf, sr
  • UDH1: A standard turn-left/turn-right and uphill/downhill with one speed
    • 9 assets: utl, uf, utr, tl, f, tr, dtl, df, dtr
  • UDH2: A standard turn-left/turn-right and uphill/downhill with two speeds
    • 18 assets: futl, fuf, futr, sutl, suf, sutr, ftl, ff, ftr, stl, sf, str, fdtl, fdf, fdtr, sdtl, sdf, sdtr
  • UDH3: A standard turn-left/turn-right and uphill/downhill with three speeds
    • 27 assets: futl, fuf, futr, mutl, muf, mutr, sutl, suf, sutr, ftl, ff, ftr, mtl, mf, mtr, stl, sf, str, fdtl, fdf, fdtr, mdtl, mdf, mdtr, sdtl, sdf, sdtr