Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

You may or may not be familiar with state machines. You will find plenty of explanations on the internet about what they are and how they work, especially in the gaming field.

To put it in simple words, state machines are a way for defining a number of animation states (walk, idle, run, etc) and how you can transition from one state to another. To make things even simpler, you might think of a state machine as a graph having nodes (the states) and connected to each other (connections are the transitions).

The Atoms UI has a state machine editor where you can define state machines to be used in Atoms. For a full list of actions please check the quick help at the bottom right of the GUI.


For creating animation states right click on the viewport and select "add animation state" or click the "Add state" button.
You create connections by right clicking on a node and dragging.

The Inspector

The inspector is where you set up your state and transition clips.

In case you're setting up an animation state, you have to give it an id which will later be used by several Atoms Behaviour Modules such as the State machine (a unique id is given set as default by the editor). Each state in the same state machine must have a different id.

You can assign more than one clip to each animation state or transition.
For each clip there are three different merge types:

  • Exclusive : only the exclusive clip will be played. This mode has the highest priority. If you have an exclusive clip all the other clips will be ignored. If you have more than one exlusive clip only the first one will be used.
  • Merge : all merge clips will be merged together. This has higher priority over the random mode. Having only a merge clip is like setting its mode to exclusive.
  • Random : one of the random clips in the list will be played. At the end of each clip another random clip is used. 

Finally there are also seven different motion types: Straight, TurnLeft, TurnRight, TurnUp, TurnDown, BankLeft, BankRight.
Only clips with the same motion mode will be merged together, randomized or will exclude each other.

The Sync value makes sense for turning clips only (motion type not being straight). With this value users specify whether or not the turning clip is in sync with the main straight clip.

The angle and blend angle fields are enabled only when the motion type is not straight and the sync value is set to "Yes".
At each frame your agent direction changes and the angle described by the agent direction at the current frame and the direction at the previous frame will be used by the blending system.
For instance, when setting a TurnLeft clip with angle value to 1 and blend to 2, our agent will start blending the Straight clip with the TurnLeft clip when the mentioned angle will be between from 1 to 3 degrees (3 is simply the agnle value plus the blend value). When the angle will be more than 3 the TurnLeft clip will be played.
The angle and blend values are in degrees.

When use clip direction clip is set to "Yes" the user is instructing Atoms to use the clip direction instead of the agent direction metadata. The angle field has meaning in this case too: the clip will start playing when the angle variation between the previous frame and this frame reaches this value.
The max turn angle field limits the angle variation (degrees) at each frame.

The tag field can be used in two different scenarios:

  • For standard clips you can control the random probability of each clip with a metadata. Specify the metadata name inside the tag field, then add a metadata with that name on your simulation agents. The metadata value represents the weight used by the random function, it can be a boolean, int or double.
  • For additive clips, you can control the weight of that clip on an agent. Specify the metadata name inside the tag field, then add a metadata with that name on your simulation agents. The metadata value represents the weight of the additive clip, it can be a boolean, int or double.



More settings affecting the entire state are available:

  • The max turn angle field is limits the angle variation (degrees) at each frame.
  • This random loop option(on by default). When an agent enters the given state and the state has all clips in random mode: Off, a random clip will be picked and it will be used in a loop; On, a random clip will be picked at random every time playing clip ends.

Whenever a one shot clip (non-loopabe clip) is used inside a state, the transition will be triggered as soon as the animation of that clip ends.

Transitions

When connecting two animation states you can select the transition and assign a transition clip within the inspector.
A light blue dot will appear on your transition in the editor as soon as you assign a clip to a it.

The transition UI is similar to the state UI, the only difference is that you can specify a blend in and out frame value for the transition itself.

If you don't specify a transition clip between two states and in your simulation you pass from one of those to the other, Atoms will do a straight blend between them.

If two states do not have a transition you won't be able to pass from one to the other.

Please always give a name to your transitions or they won't be evaluated by Atoms.

Preview

The preview widget  displays the animation for the selected state. At the bottom you have controls for playing/scrubbing the animation and a control for changing the joint size.

Before the animation can be displayed the user must select a valid agent type from the drop down list at the top of the UI.

When you select a transition (connection) between two states the preview will show its animation.

Yellow circles appearing under the feet show the foot down state for each foot.

By right-clicking on the viewport, a menu will appear with the following options:

  • Draw grid: enable/disable the grid in the viewport display
  • Draw Joint Axis: enable/disable the joint axis in the display
  • Lock Camera: enable/disable the locking on the camera
  • Reset Camera: resets the translation/rotation of the camera
  • Test Loop: enable/disable the animation clip looping

Navigation Controls:

  • Alt + left click and drag: Rotate camera
  • Alt + middle click and drag: Pan camera
  • Alt + right click and drag: zoom camera

  • No labels