How Action Sources Are Used in the Crowd Simulation

 
 
 

When you load a model into a crowd simulation, you must also load its action sources as described in Loading Action Sources. Several things are then set up in the Crowd model and the simulation point cloud's ICE trees so that the animation from those action sources can be used on the actors in the crowd simulation: the following is a general outline.

NoteYou can get also direct access to action sources in the ICE tree without needing to load them and create pose states. You may want to do this if you're using action states to animate specific deformers in the rig proxy. This requires more ICE knowledge than using pose states, but also offers you more control. See Modifying Deformer Transformations for the Animation States for information.

Converting the Action Source Data to a Point Cloud

When you load the action sources, a point cloud for each source is created in the Animation Proxies node in the Crowd model. The local transform data that is in each original action source is stored in this point cloud as global transform data on every deformer in the actor's rig proxy at each frame (see Modifying the Actor's Rig). These point clouds also set certain ICE attributes on the actions so they can be used in the ICE trees for the crowd simulation.

Getting the Action Source Data into ICE

Each point cloud generated from a loaded action source is referenced in the Get Animation Sources ICE tree of the simulation point cloud. The point clouds are connected in the ICE tree in the order in which the action sources were loaded from the CrowdFX Actor Proxy Property Editor. This order sets their ID, starting at 0. If these actions are locomotion type actions, they should be in top-down order from slowest to fastest.

Changing or Updating the Action Sources Used by an Actor

After you have created the crowd simulation with one or more actors, you can change the action sources used by the actors in the simulation. For example, when you selected the actor for the crowd simulation, you loaded a "running" action source. Now you want the actor to use a "jogging" action source instead. Or you have fixed up the animation in the original "running" action source so that it's better and now you want to use it instead of the "running" action source that's already loaded for the actor.

Basically, you need to remove the action source that's already loaded and bring in a new action source, as described here:

  1. Open the CrowdFX Actor Proxy Property Editor for the actor whose action sources you want to change.
  2. Select the loaded action sources you want to remove from the Selected Actions list, and click the Move << button to move them to the Action Sources list. This just keeps it clear which sources you have loaded, but doesn't change anything in the ICE trees.
  3. Move the new action sources you want to load from the Action Sources list to the Selected Actions list.
  4. Select the new action sources in this list and click the Selected button to load it on the actor.
  5. In the simulation point cloud's Get Animation Sources ICE tree, unplug or delete the Get Data nodes for the removed action sources from the Get actor proxy Animations compound.

    In this image, the "Running" action source is being removed and replaced with the newly-loaded "Jogging" action source.

  6. Right-click on the unused In Name port and choose Delete Port. This is removed so that "blank" data isn't added to the calculations done by the Load Actor Cycles compound under the hood.

    The "Jogging" action source can now be used by the actors.

  7. Make sure that the logic set in the simulation point cloud's other ICE trees works with the new action source you have loaded. Check the speed and duration data set for the new action sources in the Initialize Move Locomotion Data compound (see Controlling the Actor's Animation).

Defining the Animation State

After importing the Action Sources into the crowd system, you can use them in the Animation States.

When you expand the Animation Definition node, you can view the Define Animation State, Define Move Animation State, and Define Animation State Transition nodes. For example, in the following figure there are four different animation states (Idle, Move, Move_Zombie_Style_A, and Move_Zombie_Style_B). You can notice that the names of all these states are meaningful enough to understand the transition of actors from one state to another.

To change the state name

  1. Double-click the Define Animation State node.

    The Define Animation State window appears.

  2. In the State Name text box, enter a new state name.

In the Define Animation State node, all the prerecorded animation states are imported directly from the ICE CrowdFX. From the Define Animation State window Name drop-down list, you can select the animation state of your choice.

Using the Pose Modifier element in the Define Animation State node, you can modify the existing prerecorded animations. You can also define blending between different animations (walking, standing, running, and so on) in one animation state.

Defining Transition Between Animation States

After defining the state for each of your prerecorded animations, you need to define the transition between the animation states (from idle to move, move to run, and so on) and the duration of the transition. If you do not define any transition between states, then there will be a hard switch between these animation states.

The Define State Transition node in the Animation Blending tree enable you to define transition between states.

Double-clicking the Define State Transition node displays the Define State Transition window.

In this window, you can set the transition from Source state to Target state. In the Duration field, specify the transition time in number of frames.

In this way, you can define the capabilities of actors using the Animation Blending tree.

Defining the Behavior of Actors

The Behavior ICE tree enables you to use the predefined animations by defining the behavior of actors. In the Behavior ICE tree, different environments are defined and conditions are set for the actors to respond to the defined environments.

To apply the behavior of animation states in the crowd system

  1. In the Behavior ICE tree, double-click the Set Animation State compound.

  2. In the Set Animation State property editor, select the new animation state (that you added in the Define Animation State node) from the State drop-down list.

The Animation State Selector node in the Behavior ICE tree enables you to choose different animation states between each transition. Double-clicking the Animation State Selector node displays the State Selector window.

The State drop-down list contains all the different animation states, with meaningful names, defined in the animation blending. This allows you to easily choose the animation state of your choice during each transition.

The Animation_Blending and the Behavior ICE trees clearly separate different parts of the ICE CrowdFX simulation. This enables you to easily define the animation states, transition between states, and control the behavior of actors by conveniently choosing the state of your choice during each transition.

Using Action Sources in the Animation_Blending ICE Tree

The Action Sources are used in the Animation_Blending tree within the Animation States. You cannot directly use the Animation Sources in a crowd system, rather you should use only the Animation States. An Animation State references one or multiple Animation Sources.

You can use the Set Animation State Parameters node to define how the Animations Sources are used in an Animation State.

Set Set Animation State and Set Animation States Sequentially.

Creative Commons License Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License