Document

CRYTEK
CryMannequin (working title)
HIGH-LEVEL ANIMATION SYSTEM
CONFIDENTIAL © 2011 Crytek GmbH
CRYTEK
KEY REQUIREMENTS
Data-driven Animation
Ease of adding assets
o Animators should be able to insert new variations of animations easily and
without coder intervention or knowledge of game-specific systems.
Ease of adjusting playback
o Animators should be able to have control over layering and biasing their base
animation assets to produce a final look which is used directly in game.
o Animators should be able to make use of a suite of procedural fragments as part
of their toolkit in authoring an animation fragment.
Ease of adjusting blends between assets
o Very often animations look great when they are playing, but the transitions
between them are poor. This makes the overall flow disjointed and greatly
detracts from the look of the animations.
o Animators should be able to control how different animations blend into each
other and insert tween animations without coder assistance.
CONFIDENTIAL
© 2010 Crytek GmbH
2
CRYTEK
KEY REQUIREMENTS
Better Game Integration
Ensure authored animation perfectly reflects in game results
o We provide a structure such that the editor can be used to perfectly match the
end result in game
o Greatly simplified game-side control
Provide helper control for coordinating animations with game specific effects
o Framework ensures that the game code and animation system are always in synch
o Assurance that the animation system is always doing what is asked of it
Scalability – the level of impact on game code is the user’s choice
o Minimal integration for pure animation control
o Stronger integration for tighter management of actions
CONFIDENTIAL
© 2010 Crytek GmbH
3
CRYTEK
KEY COMPONENTS
Data-driven Animation
The core animation system selects and sequences animations working solely
from a database
Fragments
o Animators author fragments of animation. These are small graphs built from
sequences and layers of raw animation assets to represent a specific animation
state.
Transitions
o Animators author and edit specific transitions between animation assets.
Transitions dictate the timing of blends and can include tween animations.
Selection
o Specific fragments are selected by a game-side identifier (the FragmentId) and a
list of game-side tags that define the animation context (e.g. tired, scar, nervous).
Sequencers
o The core animation system is built around the sequencing of these animation
fragments using the most appropriate transitions.
o The sequencers take in FragmentIds and look up appropriate fragments and
transitions.
CONFIDENTIAL
© 2010 Crytek GmbH
4
CRYTEK
KEY COMPONENTS
Better Game Integration
An action based system provides the high level interface into the game and
adds coordination via priority and splitting the character into parts
Actions
o Basic class used to control animation and synchronise with the game. Can
combine game code with simple high level animation control by pushing
FragmentIds onto owned sequencers.
Scopes
o Scopes represent a part of the animated character, typical examples being Base,
Torso or Head.
o Actions can have control of one or more scopes.
o Scopes allow the coordination of animation across different entities be they a
weapon or another character.
Action Controller
o A high level controller provides the ability to query scope availability and queue
up actions.
CONFIDENTIAL
© 2010 Crytek GmbH
5
CRYTEK
KEY COMPONENTS
Game/Sandbox
Custom Actions
TagState
Action System
Scopes
Action Control
Animation Sequencing
Database
Sequencers
CryAnimation
Core animation processing
CONFIDENTIAL
© 2010 Crytek GmbH
6
CRYTEK
DATA-DRIVEN
ANIMATION
7
CRYTEK
EDITOR COMPONENTS (KEY PATH)
Sequence Analyser
• Timeline for manipulating and playing back fragment
sequences. User places FragmentIds along a timeline.
These are decomposed into a secondary track of
Fragments and Blends which can then be edited.
Fragment Editor
• Simple graph edit pane for defining fragments from raw
assets and procedural controllers.
Transition Editor
• Simple edit pane for defining transition blend times and
tween animations.
CONFIDENTIAL
© 2010 Crytek GmbH
8
CRYTEK
EDITOR COMPONENTS (OCCASIONAL PATH)
Taglist and AnimStateID Editor
• Edit the list of usable Tags and FragmentIDs.
Scope Editor
• Edits the scopes exposed within the editor
used by the SequenceAnalyser.
CONFIDENTIAL
© 2010 Crytek GmbH
9
CRYTEK
SEQUENCE ANALYSER
PREVIEW REFINE DEBUG
An integral tool for authoring animation content. The Sequence Analyser
sits on top of the core animation system and drives it in the same way as
the game would.
Load
Stand
Move
Scar_StandIdle
Recoil
Scar_RecoilLoop
CONFIDENTIAL
Save
Stand2Run
Reload
Scar_RecoilExit
Scar_Move
Idle
Scar_Reload
Scar_Idle_01
© 2010 Crytek GmbH
10
CRYTEK
SEQUENCE ANALYSER
PREVIEW REFINE DEBUG
1
Insert FragmentIDs
along the timeline
2 Sequence of assets
and blends is
generated below 3
Click play to see
sequence in the
character viewport
Load
Stand
Move
Scar_StandIdle
Recoil
Scar_RecoilLoop
CONFIDENTIAL
Save
Stand2Run
Reload
Scar_RecoilExit
Scar_Move
Idle
Scar_Reload
Scar_Idle_01
© 2010 Crytek GmbH
11
CRYTEK
SEQUENCE ANALYSER
1 Scrub timeline to find
problems in the
sequence
2
PREVIEW REFINE DEBUG
Click on generated
asset to be taken to
the Fragment Editor 3
Click on the blend to
be taken to the
Transition Editor
Load
Stand
Move
Scar_StandIdle
Recoil
Scar_RecoilLoop
CONFIDENTIAL
Save
Stand2Run
Reload
Scar_RecoilExit
Scar_Move
Idle
Scar_Reload
Scar_Idle_01
© 2010 Crytek GmbH
12
CRYTEK
SEQUENCE ANALYSER
PREVIEW REFINE DEBUG
Load sequence
information exported
directly from game to
fix glitches
Load
Stand
Move
Scar_StandIdle
Recoil
Scar_RecoilLoop
CONFIDENTIAL
Save
Stand2Run
Reload
Scar_RecoilExit
Scar_Move
Idle
Scar_Reload
Scar_Idle_01
© 2010 Crytek GmbH
13
CRYTEK
FRAGMENT EDITOR
Fragments are specific animation states, they are effectively a fragment
of a complete sequence. This is intended to complement core
CryAnimation functionality and so complex asset mixing can be handled
within it through the usage of parameterised animations.
Load
Save
Stand_idle_01
CONFIDENTIAL
© 2010 Crytek GmbH
14
CRYTEK
FRAGMENT EDITOR
Scrub time and
playback in the same
manner as the
SequenceAnalyser.
Load
Stand_idle_01
Save
IdleBreak_shiftFeet
Create sequences by
dragging assets onto
the timeline.
CONFIDENTIAL
© 2010 Crytek GmbH
15
CRYTEK
FRAGMENT EDITOR
Create random
variation by dragging
assets onto existing
entries.
Load
Stand_idle_01
Asset
Chance
IdleBreak_shiftFeet01
10
IdleBreak_relaxStance01 50
CONFIDENTIAL
Save
IdleBreak_shif ...
Right-click to tweak
random timings and
chances.
© 2010 Crytek GmbH
16
CRYTEK
FRAGMENT EDITOR
Directly edit blends to
customise the default
entry and exit blends
for the sequence.
Stand_idle_01
IdleBreak_shif ...
Insert default tween
animations which can
later be overridden.
Stand_idle_01
CONFIDENTIAL
IdleBreak_shif ...
IdleBreak_exit
© 2010 Crytek GmbH
17
CRYTEK
FRAGMENT EDITOR
Layer animations by
dragging assets into
different layers.
Load
Stand_idle_01
Save
IdleBreak_shif ...
RelaxArms01
CONFIDENTIAL
© 2010 Crytek GmbH
18
CRYTEK
FRAGMENT EDITOR
Layer procedural
effects by dragging
them onto layers.
Load
Save
IdleBreak_shif ...
Stand_idle_01
RelaxArms01
Random look around
CONFIDENTIAL
© 2010 Crytek GmbH
19
CRYTEK
PROCEDURAL FRAGMENTS
Data-driven procedural effects
Layering procedural effects onto animations is another way to build up
behaviours
Procedural animation effects
o Parameterised random look or aim arounds
o Would typically work by applying and driving poseModifiers
Parameterise existing procedural effects
o Hook up of look IK and potentially aim IK animations
o Allow per animation settings for the look/aim IK
o Would typically work by adjusting parameters for existing poseModifiers
Simple game extensions exposed to the editor
o Would need to support extensions from game code for custom effects
CONFIDENTIAL
© 2010 Crytek GmbH
20
CRYTEK
PROCEDURAL FRAGMENTS
Data-driven procedural effects
Layering procedural effects onto animations is another way to build up
behaviours
Manipulate animation playback
o Sub-class of Manipulators to provide mapping from game-side parameter to
specific animation effects
o Example: a layer may wish to be driven from game from 0->1 (off to on) different
manipulators could implement this in different ways, from changing additive
factors to scrubbing time.
o Could also parameterise interpolation rates, allowing animators to author heavy
weapons with slower recovery rates.
o Could also be used to drive the parameters for parameterised animations leading
to a suite of adjustable manipulators to handle typical locomotion tasks
CONFIDENTIAL
© 2010 Crytek GmbH
21
CRYTEK
TRANSITION EDITING
Transitions are key to smooth flowing animation. CryMannequin allows us
to insert and edit blends directly on the Sequence Analyser.
Example: Adding stand2Move transitions.
CONFIDENTIAL
© 2010 Crytek GmbH
22
CRYTEK
TRANSITION EDITING
Right clicking on the target fragment allows us to override the fragment’s
standard entry blend with an explicit transition.
Transitions are filtered by tags in the
same way as Fragments. This allows
you to specify high level transitions to
cover a whole range of contexts, or
very specific ones.
CONFIDENTIAL
© 2010 Crytek GmbH
23
CRYTEK
TRANSITION EDITING
A transition is inserted,
inheriting the existing
blend.
The blend region can
now be dragged to
alter the blend
duration.
New keys can be
added to specify
tweening animation
clips.
CONFIDENTIAL
© 2010 Crytek GmbH
24
CRYTEK
TRANSITION EDITING
Additionally, new layers
of animation can be
overlaid.
These additional layers
can be extended to
overlap the destination
fragment allowing for
more naturalistic
transitions.
CONFIDENTIAL
© 2010 Crytek GmbH
25
CRYTEK
TRANSITION EDITING
Transitions between fragments support procedural clips too and these
can be sequenced and layered in the same way as anim clips.
CONFIDENTIAL
© 2010 Crytek GmbH
26
CRYTEK
EXAMPLE WORKFLOWS
Problem
o Under-barrel weapon attachments cause cut through on the fingers
Solution
o Add new tag UnderbarrelAttachment
o Specify new fragments
• Copy existing fragments
• Layer on a new additive animation to shift the hand
o Sequencer test -> Fail: not all animations work with the additive
o Remove additive from these animations & tweak the specific blend on/off for the
additive until the result is good for all animations
o Sequencer test ->Success
o Save and commit database
o Coder adds the new tag into game
CONFIDENTIAL
© 2010 Crytek GmbH
27
CRYTEK
EXAMPLE WORKFLOWS
Problem
o Need to reflect AI being nervous
Solution
o Add new tag Nervous
o Specify new fragments
• Copy existing fragments for Stand and Move
• Layer on a new additive animation to shift up the arms
• Layer on a procedural fragment to cause random look-around
• Tweak procedural parameters until the correct effect is reached
o Sequencer test ->Success
o Save/commit database
o Coder adds the new tag into game
CONFIDENTIAL
© 2010 Crytek GmbH
28
CRYTEK
EXAMPLE WORKFLOWS
Problem
o Glitch in game going from scar grenade launcher recoil to reload
Solution
o Dump Sequence information from game
o Load into Sequence Analyser
o Playback and identify cause as a blend on a layer
o Tweak blend
o Playback and validate
o Save and commit database
CONFIDENTIAL
© 2010 Crytek GmbH
29
CRYTEK
GAME INTEGRATION
3
CRYTEK
In-Game Usage
Query Action Controller for availability
o The query takes the form of: can I play an action of a given
priority on these scopes within n seconds? Often a single query
can be used to early out on a range of potential actions.
Create custom class or use generic action
o This is dependant on the desired level of integration into game
code and the complexity of the action.
Assign FragmentId, priority and scopes to action
o With a custom action these will typically be predefined by that
class.
Queue up action
o Push action onto system. This will be processed on the next
system update.
o The action is queued up to play at the blend time dictated by the
Transition Database, or triggered immediately if its priority
trumps what is currently playing.
CONFIDENTIAL
© 2010 Crytek GmbH
31
CRYTEK
Action Controller
Example of scope usage by actions over time
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
32
CRYTEK
Action Controller
Initial state. An action controlling
basic locomotion holds the base
scope and an Idle action currently
has control of the torso.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
33
CRYTEK
Action Controller
Game updates and queues up a Jump
action. It is on the same scope as the
Locomotion but with higher priority so it
will interrupt it.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
34
CRYTEK
Action Controller
Locomotion is interruptible and so is
automatically added to the priority
queue ready for reinsertion at the
earliest opportunity.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
35
CRYTEK
Action Controller
Game updates and queues
up a reload action. This
moves straight to the head
of the priority queue.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
36
CRYTEK
Action Controller
Action Controller updates and pushes the Reload onto the
Torso and Weapon Scopes. This triggers the character and the
weapon animations synchronously. The Idle action is not
interruptible and so is terminated and deleted.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
37
CRYTEK
Action Controller
Game updates and queues up a stamp
action. This is a high priority action which
effects all the scopes. It goes straight to
the head of the priority queue.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
38
CRYTEK
Action Controller
The Stamp is pushed on across
all the scopes. The existing
actions are all non-interruptible
and so terminated and deleted.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
39
CRYTEK
Action Controller
The Stamp action hits the ground and pushes on its
final FragmentID (StampLand). When we reach the
most appropriate blend point the Stamp action is
terminated and the Locomotion reinstalled.
Base
Torso
Weapon
Priority Queue
Locomotion
Idle
Locomotion
Idle
Jump
Jump
Idle
Locomotion
Jump
Idle
Reload
Jump
Reload
Reload
Locomotion
Jump
Reload
Reload
Stamp
Stamp
Stamp
Stamp
Locomotion
Stamp
Stamp
Stamp
Locomotion
Locomotion
Locomotion
Locomotion
CONFIDENTIAL
© 2010 Crytek GmbH
40
CRYTEK
ALTERNATIVES
4
CRYTEK
GRAPH BASED APPROACHES
Size = Complexity
o All graphs suffer from the same problem, the more you add the bigger they get &
the harder to maintain & predict behaviour it becomes.
Dual Control
o Graphs have their own control system which then needs to coordinate with the
game. This leads to:
• Added complexity in the graph
• Added complexity & bugs in game code to manage/track/generally interface
with the graph
Divided focus
o Graph structure is dictated by control flow. This makes actual fine animation
control difficult, adding links for blends & transition animations is generally
difficult or not possible
Exclusive ownership
o Because of the complexity of the graph it typically becomes one man’s baby:
• Bottlenecks
• Worse integration of anyone else’s assets
CONFIDENTIAL
© 2010 Crytek GmbH
42
CRYTEK
GRAPH BASED APPROACHES (CONT)
One layer
o A graph can only describe what happens on a single layer. To coordinate
movement animations with torso actions a second graph is required & additional
logic needed to bind the two together
Excellent preview tool
o A graph acts as a great previewing tool. Anything we do instead needs to be as
expressive and visible in its results.
CONFIDENTIAL
© 2010 Crytek GmbH
43
CRYTEK
AnimAction Concerns
What chooses the specific AnimAction?
o If each AnimAction is specifically setup with its own assets then
we’ll need some higher level control to select which AA to use.
Previously this was part of the role of AnimGraph or the Weapon
Animation code.
How do we blend between AnimActions?
o No system in place for this and no clear route to extend it.
Potential learning curve per AA type
o Custom parameterisation could make the addition of new variant
AAs non-trivial.
How do we manage animations across layers?
o Is the AA specifically tied to a single layer or is this something we
explicitly parameterise? This also requires an additional system
to coordinate.
CONFIDENTIAL
© 2010 Crytek GmbH
44