- This line was added.
- This line was removed.
- Formatting was changed.
The following tutorial covers the creation of a blend space, its dimensions and annotations.
- A playable character with animations, imported into CRYENGINE.
For instructions on setting up your animated character. refer to the previous chapters in this tutorial series.
A completed blend space file, designed using the instructions listed in this tutorial, has been included below. You can use it to follow the tutorial, or even as a template for your game projects.
Creating a Blend Space File
- In your CRYENGINE project directory, navigate to the folder where your charactecharacter's animations are located.
- Create a new folder called blendspace, and within it, create a new text file with the .bspace extension; we've named the file locomotion_tutorial.bspace for this tutorial.
Open the Character Tool in the Sandbox editor, and select the character's .cdf file from the Assets panel; you should see the blendspace/locomotion_tutorial.bspace file listed under Animations in the Assets panel. Click on it.
Locating the blend space file in the Character Tool
Adding Dimensions to the Blend Space
Bring up the Blend Space Preview window in the Character Tool by enabling the View → Blend Space Preview option from the menu.
Since the imported character only requires a basic locomotion setup, two dimensions are sufficient for the blend space. Begin by creating a "Travel Speed" dimension:
- In the Properties panel, click the dropdown button next to the Dimension field and select the Insert option from the menu to create a new Dimension.
- From the dropdown button in the first row of the newly added entry, select the Travel Speed option as shown.
Adding the first dimension
- Set the Min and Max values of the Travel Speed dimension, along with the Cell Count, according to the number of animations you have; we've set Min to 0, Max to 7.5, and the Cell Count to 10.
- Similarly, create a Travel Angle dimension; we've set its Min, Max and Cell Count values to -3.14, 3.14 and 5 respectively.
Travel Speed and Travel Angle
The two dimensions define the two axes of the blend space, while the cell counts specifies the density of the grid along the corresponding axis.
Adding Dimensions to the Blend Space
Add your animations to the blend space as follows:
- In the Properties panel of the Character Tool, click the dropdown button next to the Examples field and select Insert from the menu to create a new Example.
Add an Idle animation as the first Example by clicking the icon in the first row of the newly added Example entry. In the Blend Space Preview window, make sure that the first Example is placed at -3.14 on the blend space grid by setting its Travel Angle value to -3.14.
Recall that the Min and Max values of the Travel Angle dimension were set to -3.14 and 3.14 respectively.
First idle animation
- Similarly, add another idle animation, and adjust its Travel Angle so that it's directly over the corner of the adjacent cell of the same row as shown.
Second "idle" animation
- Since the first row contains 5 cell corners, add three more animations to the row. Adjust the animations so that they are directly over the cell corners; the Travel Angle of the last animation should be 3.14, since the Max value of the Travel Angle dimension was set to 3.14.
While filling out the second row, left and right movement of the character will have to be considered.
- The simplest way is to fill the row from right to left; since we need to create a loop between forwards and backwards walking on the right side of the blend space grid, add a backward jog animation two cells ahead of the idle animation, on the far right side of the grid.
Adjust its Travel Speed to correctly position the animation over the cell corner, if needed.
Adding backward movement animation
- Now that the character has idle to backwards movement defined, add a right-strafe walk animation to the cell corner adjacent to the last animation in the same row; adjust its Travel Speed animation to reposition, if necessary.
- Similarly, add a left-strafe walk animation to the adjacent cell corner in the same row of the grid, followed by a backwards jog animation.
Although we now have the character's basic movements set up, animations for running still need to be added.
Add a right-strafe run, running, and left-strafe run animation to the grid as shown below. Their positioning can be adjusted as preferred.
The next step is to establish a logic between all the movements. Before that, save all progress and restart the Engine.
We now need to create blend annotations out of the Examples placed in the blend space grid, so that the Engine knows which animations to blend. Since we have a 2D blend space grid, we need to create square annotations:
- Open up the Character Tool and select the character's blend space file (loconotion_tutorial.blendspace) again.
In the Properties panel, insert a new entry in the Annotations section by clicking the dropdown button next to it, and selecting the Insert option from the menu.
A known bug causes the Blend Space preview to disappear when a new Annotation entry is created, until the empty tabs of the entry are filled.
- Create the first annotation using Examples 0, 5, 6 and 1 from the blend space grid.
First square annotation
- Similarly, create the following square annotations for the rest of the Examples in the first two rows:
- Finally, for the remaining Examples in the blend space grid, create the following annotations:
You've now successfully created a blend space for your character.
Feel free to experiment with adding events to the Animation Events section in the Character Tool's Properties panel (below Annotations).
Quick Mannequin Setup
- Open the Mannequin Editor and load the preview Player.xml file.
- Select the Walk fragment from the Fragments panel.
Selecting the Walk fragment
- In the Animation Clip Properties panel, assign your newly created blend space file to the Animation field.
Animation field in the Mannequin Editor
This video tutorial explains how to create blend spaces, set up Annotations and Examples.
On This Page
|Table of Contents|