Creating and Editing Fragments
Fragments are stored in an Animation Database File (ADB).
Which ADB file a fragment you edit ends up in is determined as follows:
- First the system looks at the scope you are editing a fragment on. (e.g. FullBody).
- This scope has a certain scope context. This is defined in the controller definition (e.g. the FullBody scope might work on the MainCharacter scope context).
- Then the system looks at which ADB file is assigned to this scope context in the current preview setup, which is edited in the context editor (e.g. the MainCharacter scope context has MainCharacterAnims.adb assigned to it).
- The fragment will end up in this ADB file. It is possible for this ADB file to have optional rules that move the fragment into another ADB file, a sub-ADB. This is edited in the animation DB editor (e.g. there might be a rule that moves fragments for the "hit" FragmentID into the sub-adb MainCharacterHitAnims.adb).
Fragment ID Description
A FragmentID is the main label under which a fragment is stored.
The FragmentID represents an animation state like "Moving", "Idling", "Reloading", "Firing", etc... The game requests fragments by specifying this FragmentID. Contrary to what the name 'FragmentID' might suggest there are typically many fragments that fall under the same FragmentID. For example you can have many different "Moving" fragments: they represent either random variations or context-specific variations (moving while crouched, moving while standing, etc).
Typically a programmer defines a FragmentID for every basic animation state and then animators can create fragments for those FragmentIDs.
FragmentID or Transition?
A good rule of thumb to define what should be a FragmentID: Reduce the states to the minimum, logically required to control the flow of the system. These are all the code needs to drive and can be taken as your key FragmentIDs.
For example this is how a Weapon Crafting feature could look like:
If we need animations between FragmentIDs these are best handled as Transitions. This reduces code and makes the system easier to modify purely through data:
A grey area is the customization step. The swapping of a part needs to sequence removing a specific old part and inserting the new (left of the picture).
Or we could just request an alternate customize stance (change a tag specifying the stance and request a new fragment) and then let the transition system handle removing the old part and apply the new part. This would also let the animators drop in a single animation to do both steps if they wished.
Creating & Editing FragmentIDs
FragmentIDs are created, renamed and deleted in the Mannequin Fragment Browser.
You edit them in the Mannequin FragmentID Editor.
FragmentIDs are stored in a FragmentID Definition File (xxxActions.xml), which is referred to from the main character setup, the Controller Definition File (xxxControllerDefs.xml).