Miarmy Crowd Simulation Documentation (English)

Cycle Phase Based Transition

What is Action Phase and Cycle Phase

Cyclic action plays a piece of cycle animation 1 time or several times. And each cycle from start pose, and end up with the same pose as the start point.

So, the action phase is the value between 0 and 1 describe the action from start to the end. Whereas the cycle phase is the value between 0 and 1 describe the degree from start to end of each single cycle.

So, in an action there might be 1 cycle or more cycles, but each cycle the phase from 0 to 1 repeatedly. 

Please check the below picture, such as this type of long action cycle, the entire action cycle is blue range and the action phase repeated only 1 time (blue) from 0 to 1 from start to end.

And the cycle in this action repeated 4 times (green), and also the cycle phase repeated 4 times from start through the end.

Action phase (blue) and cycle phase (green)


More importantly, the cycle phase can define the pose, that is means different phase represent different specific pose.

Please check the below pictures, the character is playback a walk cycle. No matter run or walk action, Miarmy usually define the "left foot" in front most pose the phase 0.0 and "left foot" in behind most the phase 0.5. 

 Based on this definition, let's use phase value represent the below pictures, start from 0.0 and then end up with 0.9 and back to 0.0

Miarmy Define the Left Foot in Front most the phase 0.0

Miarmy Define the Right Foot in Front most the phase 0.5

Cycle Phase Based Transition

Sometimes based on the project, we have a very long cycle animation, and it contains a lot of cycles with many nuances cannot be cut into single cycle action. And when this action transition out to other action or other action transit into this action, we cannot simply use "entry range" and "exit range", because only a rough range of exit range cannot define "which pose" our action can be transit to other action, it will cause unsmooth result when transit such as walk to stand.

For example a very long walk action with many cycles need to transit to run, but with "exit range", we cannot find correct pose of walk action connected with start of run action.

Since cycle phase is able to define the pose, we can match the transit out phase of walk and let it connect with start of run action correctly.


Parse Cycle Phase Tool

Miarmy Action Editor provide a new tool since Miarmy 3.2 and it can parse out the cycle phase data.

Notice: this tool can parse everything inside the action node with the data already inside, no need any agent simulation or rebuild action node.

Firstly we need specify a target bone, our system will automatically calculate it's relative distance with pelvis in Z (the red line in below picture) or Y (the dash yellow line in below picture) axis (usually use Z), and with the different distance parse out phase data. But only the action contains more than 2 cycles can be parsed more precise.

Z different: the red the line (more precise). Y different: the yellow dash line

The features

  • The Target Bone name is the bone which we want to compare with pelvis, usually we use left foot. in our bone structure, its name is "footL"
  • The Parse Type (0 or 1) is means: 0: compare in Z direction, 1: compare in Y direction. Usually we use 0 default.
  • Make sure you selected the action node, please click the "parse" button. the result will be in the below GUI.
  • The period shows how many frames each cycle average.

Parse a walk action with many walk cycles

Using Cycle Phase Control the Pose Can Transit out 

We can specify only in some cycle phase range, current action can transit out to other actions. This can define the transit out pose and only these poses can connect with next action smoothly.

For example the walk action is very long. and the "walkToRun" action start at "left foot moving backward and in front of pelvis". So we need set the transit out pose of long walk "left foot moving backward", and the phase is between 0.0 to 0.25, and based on more detailed tweak, we can found out more precise transition timing!

Please take a look at below picture, the action can transit to "walkAtojogA" in below phase range,

only in yellow phase range, it can transit to other action when triggered.



Random Transit In

The action which been parsed cycles can enable random transit in.

If other action transit into this action, usually it will start playback from first frame.

Since we parsed cycle phase, when other agent transit into this action, it can find the similar phase as the first frame phase.

Please check the below picture, once we enable "Similar Phase Random In", and when other action transit into this action, it can be transit into the blue range into the similar pose as the first frame. 

Blue similar frame can be used for transit into frame





Basefount Technology