Skip to main content
Version: Next (dev)

Animation Database Asset

An Animation Database is a table of rules that picks what a character plays from its blackboard. Gameplay code never names an animation. It only sets values such as Motion = Run, Stance = Crouch or MoveSpeed = 3.2, and each rule says which values it needs and what to play. The rule that matches best plays, and changes blend over the time you set.

The Animation Database node plays a database inside an Animation Graph. A database suits characters with many animations for many combinations of state: weapons, stances, moods and movement. A state machine with a transition for every combination would be hard to maintain.

Move In converts CRYENGINE Mannequin databases (.adb) into Animation Database assets.

How a rule is picked​

The table has columns and rows:

  • Each column is a blackboard entry, with a type and a Weight.
  • Each row is a rule. Its cells say which value each column must have, and a blank cell matches any value. The row also says what to play: a sequence of clips or a blend space.

Every update, the database reads the columns from the blackboard. Of the rows whose cells all match, the one with the highest weight plays. A row's weight is the sum of the weights of the columns it tests, so a more specific rule wins over a general one. When two matching rows have the same weight, the one higher in the table plays.

Rows sit in channels, which play on top of each other:

Channel modeHow it plays
BaseAlways plays its best row on the whole body. When the row changes, it crossfades.
LayerPlays its best row on top of the channels above it, on the bones of its mask, or added on top. It fades out when no row matches.
ActionWhen its action entry is set, plays the best row once on top, then sets the entry back to none. Use it for one-off moves such as reloading or waving.

Blend times​

When the base channel's row changes, it blends over:

  1. the time of the first blend override whose From cells held before and whose To cells hold now, for example Motion Idle to Motion Sprint;
  2. otherwise, the longest Blend Time of the columns whose value changed (action columns are not counted);
  3. otherwise, the new row's Blend In.

Creating a database​

  1. In the Asset Browser, create an Animation Database asset.
  2. With nothing selected in the table, set Preview Mesh in Properties to the character's animated mesh. Set Preview Graph to a graph that plays this database with an Animation Database node. Set Blackboard Template to the template that holds the character's entries.
  3. On the Columns page, add a column for each blackboard value the rules test, and give each its type and values.
  4. On the Rules page, set the values in the Blackboard panel beside the preview, then click + Rule. The new rule starts with those values, so it plays at once. Pick its animation in Properties.
  5. Add more rules. Green cells match the current values, red cells do not, and any matches every value. The line below the table says which rule plays.
  6. In your character's Animation Graph, add an Animation Database node, set its Database, and connect Pose to the output.

Closable Getting started help at the top of the editor explains these steps. The ? button opens it again.

The editor's pages​

PageWhat it edits
RulesThe rows of each channel. Channels are listed top to bottom; a lower channel plays over the ones above it. Click a channel again to set its name, mode and mask in Properties.
ColumnsThe blackboard values that rules test: their type, values, default, weight and blend time.
BlendsBlend overrides: a blend time for one particular change.
MasksNamed sets of bones. Select a mask, then tick its bones in the skeleton on the right. With bones below adds each ticked bone's children.
Blend spacesThe rules whose animation is a blend space, drawn as a plot. Larger clips weigh more at the current values. Drag in the plot, or along the strip of a third axis, to try other values on the preview.

Column properties​

PropertyDefaultDescription
NameThe blackboard entry.
TypeNamedNamed: one of the column's Values. Number: a number that cells compare. Bool: yes or no.
ValuesThe names a Named column can hold.
Weight1What a row that tests this column adds to its weight.
Blend Time0.2 sHow long the base channel blends when this column's value changes.
DefaultThe value while the blackboard has no entry: a value name, a number, yes or no. Empty means none, 0 or no.

Cell values​

Column typeCell examples
NamedRun
Boolyes, no
Number> 4.5, <= 2, = 0, or just 3

Row properties​

PropertyDefaultDescription
ConditionsThe cells: a column and the value it needs.
ClipsA sequence of clips, each with its own Speed. When Loop is on, the last clip loops.
Blend PointsA blend space instead of clips: each point is a clip at X, Y and Z, with its own Speed.
Blend X, Blend Y, Blend ZThe number columns that place the blend space's values. A 1D space uses only X, a 2D space X and Y.
Blend PolaroffBlend Y is a direction in radians and Blend X a speed: each point is a speed along a direction. Use it for movement in every direction.
Blend In0.2 sThe blend time when no override or column blend time applies.
LooponRepeats the row's animation.
Speed1The playback speed of the row.
MaskThe bones the row moves. Empty means the channel's mask, or the whole skeleton.
AdditiveoffAdds the row on top of what is below it, instead of replacing it.
NoteA comment for people, such as where the row came from. Not used at runtime.

Blend spaces​

A 1D blend space blends the two points on either side of the value. A 2D or 3D blend space uses gradient bands: a point's weight falls to zero where another point lies between it and the current values, so only the clips around the values blend. A backward walk does not leak into a forward one, for example. Each axis is measured against the points' extent along it, so speeds, angles and slopes can share one space.

Channel properties​

PropertyDefaultDescription
NameShown on the Rules page.
ModeBaseBase, Layer or Action (see How a rule is picked).
MaskThe mask of rows that do not name one.
Action EntryAction channels: the Named column that starts a row when gameplay sets it.

Tips​

  • Give the columns that matter most a higher weight, such as a weapon over a mood, so the most important rules win.
  • Keep one general rule per channel with few cells as a fallback, so the base channel always has something to play.
  • A row whose cell names a column or value that does not exist never plays. The log names it when the database loads.

See also​