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:
- Initializing an animation state
- Using the animation state in the Behavior ICE tree
To initialize an animation state
- In the ICE tree, create a new ICE attribute by adding the Set Data compound.
- Double-click the compound.
- In the Set Data property editor, enter a reference name or action ID for the ICE attribute.
-
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.
- Add the compound, and connect its output port to the input port of the Integer node.
- Double-click the Randomize Value by Range compound.
- In the property editor, set the as 1 and turn off the option.
- 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
- Add the node in the Behavior ICE tree.
- Double-click the Get Data node.
- In the Get Data property editor, enter the same action ID that you have entered in the node.
- Copy an existing ICE tree that defines the falling of actors.
- In the first ICE tree that defines the falling of actors, double-click the compound.
- In the Set Animation State property editor, select an animation state from the drop-down list.
- 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.
- Add a node.
- Connect the Execute output port from the first ICE tree to the Case0 input port in the Select Case node.
- 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.
- Connect the Value output port of the Get Data node to the Condition input port in the Select Case node.
- Connect the Result output port of the Select Case node to the If True input port in the node.
Varying the Animation Playback Speed
You can vary the speed of the prerecorded animation using the node.
To vary the playback speed of prerecorded animation
- Add the Set Animation State Parameters node in the Behavior ICE tree.
- 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.
- Double-click the Set Animation State Parameters node.
- From the drop-down list, select the animation state for which you want to define the speed.
- Increase or decrease the value to specify how fast or slow the pre-recorded animation should be played.
- Add the compound.
- In the Randomize Around Value property editor, specify different values for the , , and . Turn off the option.
- 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
-
Expand the node in the ICE tree.
The nodes in the Animation_Definition node ICE tree store the transition between one state to another.
- Double-click the Define Animation State Transition node.
- In the property editor, change the from the original state to the new state.
- Add the Execute node.
- 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.
- Connect the output port in the Execute node to the Animation_Definition system.
This creates a smooth blending between two different animation states.
Except where otherwise noted, this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License