Legacy Reference

Working with Blend Spaces (Bspaces)

Lumberyard supports blend spaces, also known as locomotion groups or LMGs, which are related motion parameters that you use to create motion clips. Specifically, an asset's kinematic, physical, and other high-level motion-related parameters are mapped onto corresponding features that are stored in the animation clips. By storing such motion as parameters, you can create controllable interactive animations.

With blend spaces, animation blending is treated as geometry. The structure of a blend space is similar to a character mesh with a vertex buffer and index buffer. Each animation clip represents a point on a coordinate system. Specifically, each animation is associated with a 1D, 2D, or 3D location in a blend space. You can play blend spaces on any layer, and they can contain additive or partial body animation.

Blend spaces (.bspace file format) in Lumberyard are XML-based file maps of animation blends that the Mannequin system uses. A .comb file represents a multidimensional blend space. Geppetto supports hot-loading of these XML files. This means you can change the XML file with a text editor, and Lumberyard updates it automatically and renders the result. This makes it ideal for prototyping and experimentation. Almost all parameters are identical for 1D, 2D, and 3D blend spaces.

Lumberyard supports blend space control of the following parameters:

  • Move Speed

  • Turn Speed

  • Travel Angle

  • Slope

  • Turn Angle

  • Travel Distance

  • Blend Weight

Displaying Blend Spaces

The best way to get a feeling how blend spaces work internally, is to start a simple 2D-BSpaces, visualize it in Geppetto and a play around with the different debug options.

To display blend spaces

  1. Open Geppetto and load a character that has a blend space file.

  2. Click View, Blend Space Preview. This displays the Blend Space Preview window on the right side of the Geppetto window between the Scene Parameters and Properties panels.

  3. Detach the Blend Space Preview window from the Geppetto window by clicking the Toggle Floating button. Once detached, adjust the size of the Blend Space Preview window by grabbing it's corners.

  4. Under the Assets Panel, under Animations, select the blend space file. The character displays in the preview window at each point on the grid that represents the blend space. The character in the Geppetto window is also animated based on the blend space controls.

  5. Use the same viewport controls to navigate within the Blend Space Preview window as you would in the Geppetto window.

  6. To adjust what part of the blend space is being displayed in Geppetto window, go to the Scene Parameters panel and expand the blend space animation layer to use the sliders to change the blend space's dimensions, such as travel speed and angle.

  7. Adjust the blend space dimensions, examples, and annotations listed under the Properties panel as needed.

1D Blend Spaces

For 1D blend spaces, you can control a single character parameter X, such as movement speed.

In 1D blend spaces all points are on line segments. It is important that p0 points to the lower parameter and p1 points to the higher parameter. If the order is reversed or both parameters are identical, an error results.

Make sure that the line has no uncovered gaps and no overlapping line segments. At runtime, Lumberyard checks whether the input parameter is inside a line segment and then interpolates the value between the two animations.

2D Blend Spaces

2D blend spaces involve changing two parameters, X and Y, independently. This means when one parameter is changed, the other parameter stays constant and vice versa. An example of a 2D blend space is a character that moves at different speeds while also turning while moving. When the speed is changed, the turn radius (body angle) stays the same; and when the turn radius is changed, the speed is not affected.

In 2D blend spaces all points are on planar triangles and quads. Looking down onto the blend space, annotations occur counterclockwise for triangles and quads.

Make sure that the plane has no overlapping triangles and quads and no gaps or holes that are not covered with a face. At runtime, Lumberyard checks whether the input parameters fall inside a plane, and then interpolates the values between the three animations (for triangles) or four animations (for quads).

3D Blend Spaces

For 3D blend spaces, three separate parameters X, Y, and Z are changed independently. For example, character speed, turn radius, and travel angle can be changed.

In 3D blend spaces all points are inside of volume tetrahedrons, pyramids, and prisms. All have a ground plane (3 or 4 points) and a tip (1 or 2 points). If the tip points up, the vertices on the ground plane must be annotated counterclockwise. If the tip points down, the vertices are annotated clockwise.

Make sure that the space has no overlapping volumes and no holes that are not covered with a volume. At runtime, Lumberyard checks whether the input parameters are inside of one those volumes and then interpolates the values between those animations.

3D blend spaces are more difficult to debug, even with a very structured design. Fortunately, many higher dimensional blend spaces are a combination of simple lower dimensional blend spaces. This relationship makes it possible to combine two 2D blend spaces into a 3D space and two 3D blend spaces into a 4D blend space.

Number of Assets for Movement

Four assets are the minimum, but eight are the recommended minimum for realistic 360-degree movement. Diagonal blends usually don't look as good as forward and sideways motions. Specifically, diagonal blends can create foot-sliding, foot-crossing, and foot dipping through the ground if you only use four.

Another issue is hip rotation. Usually the hips point to the right when sidling right and to the left when sidling left. However, doing quick left to right side steps looks like Samba dancing. For best results, keep hip orientation static in each blend space, create a new blend space for each hip rotation, and play an explicit transition to adjust the gait. In this situation, 16 assets may be needed.

Debug Information

The following information is provided in the Blend Space Preview window:

  • All animation files available in the blend space, as a mini version of the character model. You can control the size of the model using the slider near the top right of the preview window.

  • Each model has either a white or red spinning cube at its root joint.

  • Each cube has an index. This is the order that the animation clips appear in the .bspace XML file, including all pseudo examples.

  • A green wireframe quad shows which assets are currently considered in the blend. In a 2D blend space there are either triangles (blends between 3 assets) or quads (blends between 4 assets).

  • A red flashing cursor appears inside a triangle or quad. You can control the cursor with the blend space sliders and see which assets contribute to the final blend.

  • The current dimension values correspond with the current slider values set by the Scene Parameters animation layer.