Mannequin provides a couple of console variables and commands to debug the system state.
Use the mn_debug console variable to turn on/off on-screen debugging information for a specific entity.
This is most useful when combined with frame by frame recording.
mn_debug <EntityName>
The current Global TagState is displayed in the topleft corner.
All the scopes are displayed in a list on the left side. Each scope contains the following information:
This section is grayed out if the scope is inactive. This happens if the Scope Context it uses has no valid Animation Database File (ADB) assigned to it, or if it is invalid (for example an non-existing entity is assigned to it).
The top right section shows the actions which are currently pending, sorted by priority (the higher the number, the higher the priority). Each line contains the following information:
While playing all recent changes in mannequin state are recorded and can be saved to a file. Currently the 200 latest changes are recorded. Note that this code is removed in Release builds, but it is available in Debug and Profile builds.
For this you use the mn_dump console command.
mn_dump [EntityName] [duration]
The sequence is stored as a Sequence File (xml) in the folder specified in the console variable mn_debug_sequence, which by default this is Animations/Mannequin/FragmentSequences/.
The files are named <EntityName>_<Date>_<Time>.xml. For example Dude_17_Apr_2012_15_12_37.xml.
You can load these sequences up in the Mannequin Previewer.
You can log all fragment requests using the mn_debugfragments console variable.
This info only shows up in the log if you also enable mn_LogToFile!
mn_debugfragments <type>
Type:
This is an example output:
[ 46539] Fragment MotionMovement (rifle,) queued on scope FullBody3P for action PlayerMovement
[ 46555] Fragment fire (rifle+rapid+localClient+forceFeedback,) queued on scope WeaponForceFeedback for action ItemAction
[ 46555] Fragment rapid_fire (rifle+shoulder,) queued on scope Torso1P for action RapidFireAction
[ 46556] Fragment MotionIdle (rifle,) queued on scope FullBody3P for action PlayerMovement
[ 46561] Fragment fire (rifle+rapid+localClient+forceFeedback,) queued on scope WeaponForceFeedback for action ItemAction
[ 46562] Fragment spin_down (rifle+FP,) queued on scope OneShotSound for action ItemAction
[ 46562] Fragment idle (rifle,) queued on scope Torso1P for action ItemIdle
[ 46564] Fragment idle (No Match,) queued on scope Torso1P for action ItemIdle
Information displayed on each line:
[ <frame index> ] Fragment <fragmentID name> ( <tags>,<fragment-specific tags> ) queued on scope <scope> for action <action>
The fragmentname is "No Match" when no match was found.
g_manualFrameStepFrequency <Frequency>
Frequency: The framerate that we wish to simulate when using the manual frame-by-frame debugging mode. Setting this to 0 (default value) will disable manual frame-by-frame debugging altogether.
In the GameSDK sample project, the g_manualFrameStepFrequency CVar will let you manually generate frames, one at a time. Just set the CVar to the desired simulation framerate (e.g. 30 or 60 frames per second) and hit "Pause" on your keyboard. The engine will then completely freeze, and new frames will be generated only when you press the right arrow key. Please note that the input system is still running when using manual frame-by-frame stepping. This means that you can use this feature to very easily test extremely specific sequences of inputs. You can leave the manual frame step mode by pressing the "Pause" key again. If you hit the left arrow key, the system will open your default image viewer program and let you scrub through the history of frames that were previously generated.
Frame-by-frame stepping is also supported in multiplayer. If one player enters the manual frame step mode, a command will be broadcast and all clients will freeze and synchronously generate frames one at a time, whenever the right arrow key is pressed. When running multiple clients on the same machine, each client will have its own history, which you can there again access by pressing the left arrow key.
Frame-by-frame stepping used alongside the mn_debug CVar can be extremely valuable when debugging animation-related issues. It can be used to test how the game operates given a very specific sequence of inputs (even on multiple clients in a multiplayer environment), measure input lag, have a very close look at virtually any character animation topic, keep track of the fragment and transition selection process, and many other things.