Lumberyard
Legacy Reference

Mannequin Action Queuing

Actions are queued onto the target Mannequin ActionController(IActionController), which is the root object that controls the character mannequin.

For actors, the ActionController is accessible via the AnimatedCharacter extension (IAnimatedCharacter::GetActionController()).

A queueing statement looks like the following: pActionController->Queue( pAction );

This is a priority queue where higher priority actions are selected first. For each frame, the Mannequin system checks whether queued actions can be installed on the applicable scopes. Specifically, the FragmentID is retrieved and associated scope mask is determined.

If an action has higher priority than all the actions currently owning those scopes, it is installed immediately and skips any waiting times in transitions. This is called trumping. Otherwise the candidate action waits for those actions to finish or for a suitable transition to gracefully stop the current action.

When an action gets selected from the queue, it gets installed on its scopes, and its fragmentID is pushed on and updated before the next batch of animations are sent off for processing.

Actions that get pushed away are stopped unless the interruptible flag is set, in which case they get pushed back to the queue and return when they can. The interruptible flag is typically used for actions controlling Movement or Idling actions. These are low-priority interruptible actions that run by default on certain scopes but get pushed back by more specific actions.