Controlling the Actor's Animation

 
 
 

After you've loaded action sources for an actor and created a crowd simulation, this animation data is initialized so that it can be used in the simulation. How the animation data is used depends on which type of simulation you've created. For example, pedestrian (locomotion) simulation.

For locomotion simulations, you set the target speed for how fast you want the actors to move. Then you set the speed at which to switch to each pose state and how long the transition takes between pose states. See the sections below for information.

Selecting the Initial Pose State for the Simulation

By default, the animation state with an ID of 0 is set as the Source value in the Initialize Move Locomotion Data compound in the Emit_and_Initialize ICE tree.

The first animation state used is often a neutral or idle animation; however, you can select a different animation state to start the simulation, such as to have all actors walking or running. This may be useful so that you don't need to create a pre-roll for your simulation if you want all the actors to be in a certain state from the beginning of the simulation.

You could also randomize the actor ID value so that each actor instance doesn't have the identical starting pose for the simulation.

Setting the Actor's (Particle's) Target Speed for Locomotion

In a locomotion-type crowd simulation, the actor's velocity is determined by the speed of its COG (center of gravity) deformer in the Z direction (its horizontal speed). The actors (particles) are always trying to reach this Target Speed value over the course of the simulation.

To set the target speed:

  1. Open the Set Velocity Using Collision Avoidance compound in the Behavior ICE tree.

  2. Set the Target Speed value, which is the number of Softimage units per second the particle travels.

The actor's speed is a combination of the Target Speed, the Maximum Acceleration, and Max Deceleration (both set in the Initialize Collision Avoidance compound). For example, the faster the acceleration to the target speed, the sooner the final locomotion state (see below) is reached.

The Target Speed can also determine whether or not a locomotion state is reached or not. For example, if the Target Speed is set to 10, and the "Running" state's minimum speed is 20, that state will not be reached because the actor never reaches the minimum speed.

Although the Target Speed is the actor's ultimate speed goal, the actor's speed is also affected by potential collisions with other actors or walls (see Collision Avoidance Behavior for Actors). Actors will slow down to avoid collisions, but then their speed is resumed after the threat of collision is over.

Switching between States For Locomotion Simulations

For pedestrian simulations, three basic states of locomotion are set in order of their speed in the Initialize Locomotion Data compound: Idle, Walk, and Run. Of course, you can have different types of action sources loaded than idle, walk, and run, but these three "speed states" give you a standard base to work with.

The trigger that determines when one state switches to the next is when the actor's current speed is greater than the Min Speed set for each state (see below).

To set each state's minimum speed and transition duration:

  1. In the simulation point cloud's Emit_and_Initialize ICE tree, open the Initialize Move Locomotion Data compound's property editor.

    If you don't have the ICE Tree view open, choose the CrowdFX Simulation Edit Inspect Init. Animations command from the ICE toolbar to open this property editor.

  2. Set the Min Speed value for the Walk and Run states. This is the minimum speed (in Softimage units per second) at which the actor switches to that state.

    These are just states whose speed applies to whatever action source you have loaded for ID 1 and ID 2: they don't have to be walk and run action sources.

    Remember to set the Min Speed values in accordance with the Target Speed value for the simulation; that is, make sure that the Target Speed is at least 1 value higher than the Run state's Min Speed value if you want the actors to reach the Run state during the simulation. If you have the same value for the Target Speed as the Min Speed for the Run state, the actor's animation will flicker between the Walk and Run states.

  3. Set the Transition Duration for each state, which is the number of frames over which the transition (blending) from the previous state into this pose state happens.

  4. When you play back the simulation, the animation from each pose state is cycled over as many frames as the actor is within that state's speed range.

    For example, if an actor slows down to avoid collision with another actor or a wall, he may switch to another state that matches his speed, such as switching from running back to walking. When there is no risk of collision anymore, the actor tries to reach the target speed again and switches states again.

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