Menu
Lumberyard
Legacy Reference

Synchronizing Multiple Characters

Synchronizing multiple animated characters is a common task. Practical examples include animating a weapon in sync with a character's body when reloading or firing, or synchronized actions across multiple characters, such as for stealth kills.

This can be achieved with Mannequin through the use of scope contexts and the concept of coupling or enslavement.

The first step required to synchronize a secondary character with a primary one is to add an extra scope and scope context in the host character's Controller Definition *ControllerDefs.xml file. The secondary character is then attached to the newly-created scope context. The following is an example ControllerDefs.xml file:

<ControllerDef> ... <ScopeDefs> <FullBody1P layer="0" numLayers="3" context="Char1P"/> ... <FullBody3P layer="0" numLayers="3" context="Char3P"/> ... <Weapon layer="0" numLayers="3" context="Weapon"/> ... <AttachmentTop layer="0" numLayers="3" context="attachment_top"/> <AttachmentBottom layer="0" numLayers="3" context="attachment_bottom"/> <SlaveChar layer="0" numLayers="3" context="SlaveChar" Tags="slave"/> <SlaveObject layer="0" numLayers="3" context="SlaveObject" Tags="slave"/> </ScopeDefs> </ControllerDef>

This example shows seven scopes using seven different contexts, which means that fragments can be synchronized for up to seven different characters.

Parameters

Scope Scope Context Layers
FullBody1P Char1P 0, 1, 2
FullBody3P Char3P 0, 1, 2
Weapon Weapon 0, 1, 2
AttachmentTop attachment_top 0, 1, 2
AttachmentBottom attachment_bottom 0, 1, 2
SlaveChar SlaveChar 0, 1, 2
SlaveObject SlaveObject 0, 1, 2

The Actor:EnslaveCharacter Flow Graph node can be used to couple characters together in order to play synchronized animations.

When coupling a character, you can optionally use a different Animation Database .ADB file if needed, depending on setup in the Mannequin Editor. If left empty, fragments will be queried from the host character's .ADB file.