Documentation made for Animation Graph 1.5
There are two files associated with each AnimationGraph. One .xml file and one .ag file with the same name.
Both are located inside the Game\Animations\Graphs
folder.
The .xml file is stores the Editor information for the Animation Graph. It is only needed inside the Editor and contains a lot of metadata like Views and Node positions for the Animation States which are irrelevant upon execution of the game. This file is uncompressed but it is not recommended to edit it by hand.
Upon saving in the AnimationGraph Editor, the .xml file is saved out and then loaded into the Engine implementation AnimationGraph which sits in CryAction.dll. In this steps all the parameterized states are expanded into separate states and the templates are integrated. Is the loading successful, all this information is saved out again into the.ag file, which is a binary xml file.
Ingame, the engine will always try to load the ag file directly - if it isn't present or the current ag file format is different from the one the file was saved in, it will load and convert the xml file instead, which takes longer.
The ag file does not depend on the template files to be present and it does not contain redundant metainformation. This file can not be opened with the AnimationGraph Editor.
For shipping, both the xml and the Template files can be removed.
The current ag file format version is defined as in CryAction in AnimationGraph.h. It needs to be updated if the serialization of any of the nodes change. See the Animation Graph Programming Reference for further information.
const static int AG_VERSION = 50;
When the internal version number is increased, the graph will not load ag files that were saved with a lower version number. Instead it will load the corresponding xml files and convert them on-the-fly. This will take a long time and cost memory and is to be avoided expecially on consoles. Re-save each graph once to update the ag files and get rid of the stall at loading time. You will get a warning message in the log file about mismatching version in animation graphs. (also see Warnings and Error Messages)
Include In Game | |
Allow Selection | |
Allow Higher Layers | |
Can be hurried | |
Skip for Players |
Loop Asset | |
Manual Update | |
Repeat Last Key | |
Use Time Warp Blending | |
Stop Current Animation | |
Partial Body Animation | |
Move2Idle Anim | |
Exclusive Root Movement | |
Transition Time |
When creating a link between two states, the AnimationGraph allows to set a few parameter on this link to fine-tune the transition represented by it.
To edit these parameters, right click on the little circle in the middle of the link, and choose "Edit" from the popup menu.
Pathfind Cost | This parameter is for fine-tuning the pathfinding in the graph. When the graph switches from one state to another, it finds a path through the graph through some transition states (if these exist). It usually chooses the shortest path it can find. However, instead of calculating the number of states on the path and then choosing the shortest one by selecting the path with the lowest number of states in it, it actually calculates a "path cost". For each state and transition (link) on the way it adds a number to this cost. Usually this number is set to a default of 100, but you can manually increase or decrease it and thus make sure the graph will choose a certain path from A to B even if the number of states on this path is higher. |
---|---|
Override Transition Time | The blending time from an animation currently playing to the next on is determined by the state that holds this next new animation. The time can be set in the state parameters. This blend time will be used for all incoming transitions to this state, regardless from where the transition is coming. |
Force Follow Chance | Force-Following can be used for two things in the AnimationGraph: |
The Animation Randomizer is available with CryENGINE 3.1.5 and up.
Double-Clicking on the Animation Name Edit field in a state or Additive Modifier will open the Randomizer dialog.
Instead of a single animation name, you can specify a list of animations here with a couple of options and parameters and the graph will pick on based on probability at runtime to play.
Note that the Animation Randomizer as the rest of the Animation Graph is not serialized over the network, as the game logic and animation logic are kept separate in CryENGINE. If you need randomized assets to be in synch over the network, please use an Input to select the asset instead and generate and serialize this inside the game dll instead.
Switch Assets Over Time | |
Switch Probability | |
Time Align between Assets | |
Switch Immediately after non-looping asset finished | |
Initial Delay before first animation | |
Add Animation |
Loop | |
Do not Interrupt | |
Allow Reselection | |
Transition Time | |
Probability | |
Remove Slot |
Action | usually used for all looping non-locomotion actions, like sitting, talking, etc, in SDK also for the loop while being on a ladder |
---|---|
ActualMoveDir4LH | Simplified Movement Direction of the character: Bwd, Fwd, Lft, Rgt, Idle |
RequestedMoveDir4LH | Simplified Movement Direction of the character: Bwd, Fwd, Lft, Rgt, Idle |
ActualMoveSpeed | movement speed in meters per second (m/s) |
RequestedMoveSpeed | movement speed in meters per second (m/s) |
ActualMoveSpeedLH | flat ground (2D) movement speed in meters per second (m/s) |
RequestedMoveSpeedLH | flat ground (2D) movement speed in meters per second (m/s) |
ActualMoveSpeedLX | movement speed on x axis (in m/s) |
RequestedMoveSpeedLX | movement speed on x axis (in m/s) |
ActualMoveSpeedLY | movement speed on y axis (in m/s) |
RequestedMoveSpeedLY | movement speed on y axis (in m/s) |
ActualMoveSpeedLZ | movement speed on z axis (in m/s) |
RequestedMoveSpeedLZ | movement speed on z axis (in m/s) |
Aiming | 0 or 1, whether Aiming is active or not |
AnimPhase | current normalized time of the active animation in layer 0 |
DesiredTurnSpeed | desired turn speed of body direction |
Firing | firing timer, when a bullet is shot, the counter goes to 10 seconds and starts counting down |
Health | integer health value of the character |
Item | name of the item that the character has equipped |
PseudoSpeed | a form of normalized speed value |
Signal | used for one-shot action, like reloading, melee punches etc |
Stance | used mostly for locomotion modifiers (relaxed, combat, crouch, prone,...) |
SwimControlX | desired velocity on the x axis |
SwimControlY | desired velocity on the y axis |
SwimControlZ | desired velocity on the z axis |
Vehicle | name of the vehicle the character is currently in, "none" if in no vehicle |
VehicleSeat | Seat number the character is sitting on |
waterLevel | depth in the water that the player is submerged (in meters) |
The animation graph performs a database-like query over all selectable states by comparing current input values with the selection criteria of each state. The goal is to create the list of available states whose selection criteria match best with the current input values. Note that inputs, for which the value is set to its initial special value <not set> will be ignored during this process.
The process begins with the highest priority input first – all selectable states whose selection criterion is matching the current value of that input are stored in the list of available states. If there are no states in the list, the process stops with an error. If there is only one state in the list, the process is over – there is no need to further narrow the list since there is only one state in it.
Then the value of the second highest priority input is evaluated against all states from the list of available states. States whose selection criterion on that input does not match the current input value are removed from the list. If there is still more than one state left in the list, the process of removing states from the list continues with the next input in order of their priority. The process stops, if there is only one state left or if after some iteration, there are no states left in the list of available states. In the latter case the last iteration will be rolled back and the process stops, with the list of available states before processing the last input, even if there is more than one state left in the list.
Each state has a ranking of how well he matches the current inputs - the ranking is determined by the priority each input has been assigned.
Some inputs have significantly higher priorities than others. For example if a state matches the Action input perfectly, but doesn't care about item, stance, speed or vehicle, then that state will still be chosen over one that matches the latter four, since it has a higher priority and the state will have a higher ranking.
Only the top ranking states in the list will be returned by the state query. Each state in the list has the same ranking value.
The ranking of each state can be seen in the AnimationGraph Editor using the State Query tool with a set of Input values.
If there is only one state in the list of available states, it is being selected as the queried state.
Otherwise the graph will check whether the state it is currently in is among the available states. If so, it will just stay in this state. This avoid unnecessary jumping between states. If the current state is not in the list one of them will randomly be chosen to be the queried state, since all the remaining states are equally suitable to be selected.
Should this message appear on your console or the Editor/Game log file, you will need to re-export the Animation Graph.
+Explanation:+The file format of the binary file (AG File) changed and thus cannot be loaded. The graph detects the version mismatch and loads the xml file instead, converts it on the fly into an ag file and then loads the result. This takes a huge amount of time and costs memory during the time of conversion (same on consoles).
Simply opening the graph in the AnimationGraph editor and re-saving it will update the file format and solve the issue.
You do NOT have to convert your AG 1.0 graphs to AG 1.5 to fix this, re-saving with the old graph editor will also update the file format.
A node could not be created, it most likely doesn't exist or the data has been exported wrongfully. This needs a code fix.
+Explanation:+When working with nodes, either with Modifiers (in AG versions 1.5 and up) or Extra Properties (in AG 1.0) in the Editor, the graph will try to instance the implementation of this node/modifier upon loading the xml file in CryAction. If a graph includes a modifier/node that is not implemented and registered this warning will occur. It can also happen that the node itself exists, but it cannot make sense of the data in the xml file and cannot initialize itself. When working with customly added game specific noes, make sure everything is still in place after an integration.See the AnimationGraph programming reference about programming nodes.
See the Animation Graph Programming Reference for more information.
Upon loading an animation graph saved with version 1.0 into the 1.5 (or higher versions) editor, the graph data will automatically be converted. It cannot be saved in the old format. It is recommended that you make a backup or change the file name. While backwards compatibility is kept to a maximum, there might occur conversion issues in special cases or when the graph has been custom modified.
The following lists all known issues that cannot be solved automatically upon conversion due to feature changes in the graph versions when converting from version 1.0 to version 1.5.