crytek confidential © 2011 crytek gmbh crymannequin
TRANSCRIPT
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
WHAT IS IT?
2
A generic data-driven high-level animation system
Replaces:• AnimGraph• Weapon animation• All other custom animation systems
Key Features:• Clip sequencing and layering• Advanced transitions
o Blends, tween animation sequences and layering• Coordinates animations across entities• Procedural extensions
o Coordinating code and animation• Game-side action management
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
KEY REQUIREMENTS
4
Data-driven Animation• Ease of adding assets• Ease of adjusting playback• Ease of adjusting blends between assets
Better Game Integration• Ensure authored animation perfectly reflects in game results • Provide helper control for coordinating animations with game specific
effects• Scalability – the level of impact on game code is the user’s choice
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
CONSEQUENCES FOR CODE
5
No direct referencing of animations• Game requests animation fragments by ID (FragmentID) and provides a
State (tags) for selectiono Required for editor/game parityo Required for data-driven sequences and transitions
Hands off the animation control!• Game does not directly manipulate animations
o Required for editor/game parityo Required for data-driven sequences and transitions
• Manipulate animations via procedural clips and setting paramso Actually results in simpler game-code and more code reuseo Allows for better threading of animation code
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
SAMPLE WORKFLOW
6
Animator• Authors and exports animations• Previews and hooks up new fragments in the editor
o Potentially adds new FragmentIDs and Tagso Can setup custom blends if required
Coder• Creates new action to control animation
o May inherit new class or use generic one for simple cases• Sets the relevant FragmentID• Sets any Fragment specific Tags
Bugs• Visual -> Animator• Functional -> Coder Maybe
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
WHAT ARE FRAGMENTS?
7
Fragment == Layered animation sequence
Layers of sequences of clips• Clips are raw animation assets or custom coded effects• Clips can be arranged sequentially and layered on top of each other
The basic atomic animation unit• Fragments are pushed on as a single element
Support Procedural Clips• Procedural clips are classes registered from within game-codeo Inherit from IProceduralClip or the TProceduralClip<> helper templateo Currently need to expose via Scripts\Mannequin\ProcDefs.xml
• They allow custom code effects to be sequenced and parameterised alongside the animations
o Sound effects, entity position adjustment, IK controllers...
• Can receive inputs from the game via Action Parameters
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
ACTION CREATION
8
Action == Game-side class with a state-machine style interface for making fragment requests
Create• Create new action to control animation
o May inherit new class or use generic one for simple caseso Inherit from the IAction interface or the TAction<> helper template
• Set the relevant FragmentID• Set any Fragment specific Tags• Set the action’s Priority
o Used to manage overlapping actions
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
ACTION CREATION
9
Queue• Push the action onto the target’s Action Controller
o For actors this is accessible via the AnimatedCharactero This will be pushed on and updated before the next batch of
animations are sent off for processing
Update• The Action can switch Fragments and set Params for procedural clips• The Action can do custom game-side work to assist co-ordinating
animation and game stateo Reload: Handle events to ensure that ammo is installed at the correct
timeo Locomotion: Changing the FragmentID based on player input
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
ACTION SCOPES
10
Scope == A high level animation channel
A scope controls where the fragments are triggered• Handles different part of the body (Base body, Torso, Legs)• Handles different entities (Weapon, Attachments, Target Player)
Actions control Scopes• Each Scope can only be controlled by a single Action• Multiple Actions can be active concurrently, each on different Scopes• A single Action can be installed on multiple Scopes
o Full body actions such as “Stamp Attack” tend to go across all scopesoWhich Scopes an Action uses is generally set in data by which
FragmentID is set, but can be specified in code by the Action itself
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 11
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
Example of scope usage by actions over time
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 12
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
Initial state. An action controlling basic locomotion holds the base
scope and an Idle action currently has control of the torso.
Initial state. An action controlling basic locomotion holds the base
scope and an Idle action currently has control of the torso.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 13
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
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.
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.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 14
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
Locomotion is interruptible and so is automatically added to the priority queue ready for reinsertion at the
earliest opportunity.
Locomotion is interruptible and so is automatically added to the priority queue ready for reinsertion at the
earliest opportunity.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 15
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
Game updates and queues up a reload action. This
moves straight to the head of the priority queue.
Game updates and queues up a reload action. This
moves straight to the head of the priority queue.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 16
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
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.
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.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 17
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
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.
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.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 18
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
The Stamp is pushed on across all the scopes. The existing
actions are all non-interruptible and so terminated and deleted.
The Stamp is pushed on across all the scopes. The existing
actions are all non-interruptible and so terminated and deleted.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL 19
Base Torso Weapon Priority Queue
Locomotion Idle
Locomotion Idle Jump
Jump Idle Locomotion
Jump Idle Reload Locomotion
Jump Reload Reload Locomotion
Jump Reload Reload Stamp Locomotion
Stamp Stamp Stamp Locomotion
Stamp Stamp Stamp Locomotion
Locomotion
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.
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.
ACTION CONTROL
CRYTEK
© 2010 Crytek GmbHCONFIDENTIAL
DEBUGGING DEMO
20
In-game debug• Mn_debug <entity_name>
o In-game display of current actions, fragments & clipso Very useful in conjuction with FRAPS
• Es_debugAnim <entity_name>o Low-level debug on the actual animation assets on the named entity
Dumps• Mn_dump <entity_name> <duration>
o Duration is time in secs to dump, defaults to dumping the entire buffer
o Sequence file is saved into Animations\Mannequin\FragmentSequences
o Can be loaded into the Editor via the LoadSequence command