Tutorial 8: Working with Crowd Animation

Lesson 1: Getting Started with Behaviors

The Crowd object lets you assign behaviors to delegates. This lesson teaches you how to add these two objects and make them work together. You'll add a behavior and assign it to the smallest possible crowd: a single delegate.

Creating a delegate

  1. On the Create panel, click Helpers.

  2. In the Object Type rollout, click Delegate.

  3. In the Top viewport, drag to add a Delegate helper object.

    By default, the tip of the pyramid-shaped delegate object is its front; it helps to think of it as an arrowhead pointing in the direction it wants to go. Adding a delegate in the Top viewport points it forwards, in terms of the default world orientation.

Creating a crowd object

The Crowd helper object is available from the same rollout.

  1. In any viewport, add a crowd object.

    Delegate and Crowd helper objects in Top viewport

    The size, position, and orientation of the crowd object are not important. Be sure to make it easily accessible, because you'll be selecting it frequently as you work with crowd simulation.

    Tip: Create a selection set containing the crowd object to be able to select it quickly without using the viewports.

Adding a behavior

You'll add a behavior and apply it to the delegate. The easiest behavior to use is the Wander behavior.

  1. Go to the Modify panel, which shows rollouts for the crowd object.

  2. In the Setup rollout, click the New button.

  3. In the Select Behavior Type dialog, choose the Wander behavior and click OK.

    The default name of the behavior, Wander, appears in the list at the bottom of the Setup rollout, and a new Wander Behavior rollout appears in the command panel under the Setup rollout. You can find a full explanation of its parameters in the Wander Behavior.

    When you have multiple behaviors in a scene, this rollout shows the type and parameters for the current behavior as indicated in the list.

  4. Change the name of the Wander behavior by clicking in the list box and typing a new name, such as My Wander Behavior.

    Tip: When a scene contains multiple behaviors of the same type, give them distinguishing names so you don't confuse them.

    The name doesn't change in the behavior's rollout title. The rollout title always displays the name of the behavior type.

Assigning the behavior

Next, you'll apply the behavior to the delegate.

  1. In the Setup rollout, click the Behavior Assignments button.

    This dialog lets you group delegates into teams and assign behaviors and cognitive controllers to delegates and teams. We'll cover the more advanced functionality in further lessons; meanwhile, you can find reference material on the dialog in Behavior Assignments and Teams Dialog.

  2. In the Behavior Assignments and Teams dialog > Assignment Design group, click the two list entries: Delegate01 and My Wander Behavior.

    The New Assignment button, outlined in red

    When you select both a delegate and a behavior, the New Assignment button becomes available. This vertical button, situated between the Assignment Design and Behavior Assignments group, displays a column of right-pointing arrows.

  3. Click the New Assignment button.

    The assignment is added to the list in the Behavior Assignments group. By default, it has the highest available Weight value of 1.0 and is active.

  4. Close the dialog by clicking OK.

Solving the simulation

You're now ready to solve the simulation.

  1. In the Crowd command panel > Solve rollout, click the Solve button.

    The software solves the simulation, while the bar graph under the Solve button shows its progress. As a result, the delegate wanders randomly around on the world grid.

    The wandering delegate's trajectory

    Tip: You can see the delegate's trajectory by going to the Motion panel and clicking Trajectories.

  2. Play the animation.

    You might need to change viewport settings to see the delegate throughout the animation.

  3. Experiment with the behavior and delegate settings and continue to solve. Remember that you must have the crowd object selected to see the various crowd parameters.

    Here are some things to try:

Now that you've learned the basic features of the crowd system, you can work with real crowds that contain more than a single delegate.