Adding Variations to the Crowd Animation

 
 
 

The actors in your crowd system behave or react according to the parameters defined in the pre-recorded animations. For example, how the actors should behave when moving from one terrain color to the other, what actions to be performed when they collide with obstacles, and so on.

This section explains how to vary an existing animation in a scene.

You can use the sample crowd scenes available in the \Data\XSI_Samples\Scenes\ICE\CrowdFX to try out the variations on the pre-recorded animations as explained in this document.

Assigning Different Animations to Actor Proxies

You can make the animation more interesting by assigning different animations to each actor in a group. This process includes:

  1. Initializing an animation state
  2. Using the animation state in the Behavior ICE tree

To initialize an animation state

  1. In the Emit_and_Initialize ICE tree, create a new ICE attribute by adding the Set Data compound.
  2. Double-click the Set Data compound.
  3. In the Set Data property editor, enter a reference name or action ID for the ICE attribute.
  4. To have this Set Data attribute as an integer, add an Integer node and assign its output port to the Reference value of the Set Data compound.

    This assigns an integer 1 or 0 to each of the actors.

  5. Add the Randomize Value by Range compound, and connect its output port to the input port of the Integer node.
  6. Double-click the Randomize Value by Range compound.
  7. In the property editor, set the Max Value as 1 and turn off the Animated option.
  8. Connect the output port of the Set Data compound to an input port in the Emit_and_Initialize ICE tree.

To use this animation state in the Behavior ICE tree

  1. Add the Get Data node in the Behavior ICE tree.
  2. Double-click the Get Data node.
  3. In the Get Data property editor, enter the same action ID that you have entered in the Set Data node.
  4. Copy an existing ICE tree that defines the falling of actors.
  5. In the first ICE tree that defines the falling of actors, double-click the Set Animation State compound.
  6. In the Set Animation State property editor, select an animation state from the State drop-down list.
  7. Similarly, in the second ICE tree that defines the falling of actors, select a new animation state from the State drop-down list in the Set Animation State property editor.
  8. Add a Select Case node.
  9. Connect the Execute output port from the first ICE tree to the Case0 input port in the Select Case node.
  10. Connect the Execute output port from the second ICE tree to the Case1 input port in the Select Case node.

    These nodes are connected to make the actors collapse or wave depending on the action ID.

  11. Connect the Value output port of the Get Data node to the Condition input port in the Select Case node.
  12. Connect the Result output port of the Select Case node to the If True input port in the If node.

Varying the Animation Playback Speed

You can vary the speed of the prerecorded animation using the Set Animation State Parameters node.

To vary the playback speed of prerecorded animation

  1. Add the Set Animation State Parameters node in the Behavior ICE tree.
  2. Connect the Execute output port of the Set Animation State Parameters node to the input port of the Execute node in the ICE tree for falling actors.
  3. Double-click the Set Animation State Parameters node.
  4. From the State drop-down list, select the animation state for which you want to define the speed.
  5. Increase or decrease the Speed value to specify how fast or slow the pre-recorded animation should be played.
  6. Add the Randomize Around Value compound.
  7. In the Randomize Around Value property editor, specify different values for the Base Value, Variance, and Seed. Turn off the Animated option.
  8. Connect the Value output port in the Randomize Around Value compound to the Speed input port in the Set Animation State Parameters node.

Blending Between Two Animation States

  1. Expand the Animation_Definition node in the Animation_Blending ICE tree.

    The Define Animation State Transition nodes in the Animation_Definition node ICE tree store the transition between one state to another.

  2. Double-click the Define Animation State Transition node.
  3. In the property editor, change the Target State from the original state to the new state.
  4. Add the Execute node.
  5. Connect the Define output ports from all the Define Animation State Transition nodes where you changed the Target State to the input ports in the Execute node.
  6. Connect the output port in the Execute node to the Animation_Definition system.

This creates a smooth blending between two different animation states.

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