Tutorial 8: Working with Crowd Animation

Lesson 2: Using Multiple Delegates and Behaviors

character studio has a number of special facilities for working with multiple delegates and crowds, as you'll see in this lesson. You'll also explore several new behaviors.

This lesson builds on the knowledge gained in the previous one. If you haven't completed the Getting Started with Crowds lesson, please complete it before undertaking this one.

Setup

  1. Run 3DS MAX or reset the program, and then add a delegate and crowd object as in the first lesson.

  2. Add a small box near the center of the workspace, then add a large sphere surrounding it. The two should be roughly concentric.

    You can load a .max file that already has these objects. Open cs_tut08_lesson2.max from the cstudio\tutorials\tutorial_8 directory in your 3DS MAX path.

Cloning delegates

You'll use the Scatter Objects tools to create several clones of the delegate, position them about the large sphere's surface, and aim them at the box.

  1. Select the crowd object and go to the Modify panel.

  2. In the Setup rollout, click the Scatter button to open the Scatter Object dialog. This dialog is fully documented in Scatter Objects Dialog.

  3. In the Scatter Objects dialog > Clone tab, under Object to Clone, click the None button and select Delegate01. Click Select to close the dialog.

  4. Change the How Many setting to 9.

  5. Click Generate Clones.

    This creates nine copies of the delegate (10 delegates in all). You can't see them yet because they're all coincident with the original delegate.

  6. In the Scatter Objects dialog > Position tab > Placement Relative to Object group, choose On Surface.

  7. In the same group, click the None button, and select Sphere01.

    Even though you're using a sphere to distribute the delegate clones, you're not choosing Inside Sphere. That's because you're going to position the clones on the surface of the sphere, rather than throughout its volume.

  8. Click the Generate Locations button at the bottom of the Position panel.

    Delegates are scattered about the sphere surface.

Reorienting delegates

The delegate clones are positioned at random locations across the large sphere's surface. They're all pointing in the same direction. In the next steps, you'll reorient them so they're all pointed at the small sphere.

  1. In the Scatter Objects dialog > Rotation tab > Look At Target group, choose Selected Object.

    This makes the None button available.

  2. In the same group, click the None button and select Box01.

  3. Click the Generate Orientations button.

    Delegates are pointed at the box.

    The delegate clones are all now pointing at the box.

  4. Click OK to close the Scatter Objects dialog.

Adding behaviors

  1. Select the large sphere and press the DELETE key to remove it from the scene.

    You'll use this setup in the fourth lesson.

  2. Save the file as cs_tut08_lesson4a.max.

    Next you'll use two behaviors, Seek and Repel, to make half the delegates move toward the small box and the other half move away from it.

  3. Select the crowd object and, in the Setup Rollout, add a Seek behavior.

  4. In the Seek Behavior rollout, click the None button, and select the box.

    The box's name appears on the button, indicating that it is now the object that will be sought by any delegate to which the behavior is applied.

  5. In the Setup rollout, click Behavior Assignments.

    You could assign the Seek behavior one delegate at a time, but that's not necessary. Crowd lets you group delegates into teams and assign a behavior to the entire team.

  6. In the Behavior Assignments and Teams dialog > Teams group, click New Team.

    This adds a team with the default name Team0. You can rename it by clicking its name at the top of the group box.

  7. Rename the team Seek Team.

    Next, you'll specify which delegates are to be members of Seek Team.

  8. Click the Add Members button. In the Select Delegates dialog, click Delegate01, and then hold down SHIFT and click Delegate05 to select the first five delegates. Click OK to exit.

    The delegate names appear on the Seek Team roster.

  9. In the Assignment Design group > Teams list, click Seek Team, and in the Behaviors list, click Seek Behavior.

  10. Click the New Assignment button to create the assignment.

Creating a behavior in the Behavior Assignments and Teams dialog

You'll create a Repel behavior in the Behavior Assignments and Teams dialog.

  1. In the Behavior Assignments and Teams dialog > Assignment Design group, click the New Behavior button, and choose Repel Behavior.

    The behavior is added to the Behaviors list. You still need to use the command panel to modify the behavior. The dialog stays open as you do this.

  2. In the Setup rollout, choose Repel Behavior from the list.

    The Repel Behavior rollout replaces the Seek Behavior rollout.

  3. In the Repel Behavior rollout, specify Box01 as the repel object, using the same method as with the Seek behavior.

  4. In the same rollout, in the Radius group, turn off Use Radii.

    This applies the Repel behavior at any distance, not just within a specific radius.

  5. Create a new team containing Delegate06 through Delegate10 and rename it Repel Team.

  6. Assign the Repel behavior to Repel Team and close the dialog.

  7. Solve the simulation.

    Half the delegates move toward the box and the other half move away, but they all stay in their own plane. You can make them move in three dimensions.

    If you tried the third suggestion at the end of the previous lesson, you might have an idea of how to fix this: Turn off the delegates' Constrain to XY Plane switches. But there's no need to do so one delegate at a time.

Moving delegates in three dimensions

  1. In the Setup rollout, click Multiple Delegate Editing.

    The Edit Multiple Delegates dialog appears. You can use this dialog to apply changes to several delegates simultaneously.

  2. In the Edit Multiple Delegates dialog > Delegates to Edit group, click the Add button.

  3. In the Select dialog, click All and then Select.

    This adds all delegates in the scene to the Delegates to Edit list.

    You cannot work with teams in the Edit Multiple Delegates dialog. However, the Behavior Assignments dialog lets you create named selection sets from teams, and the Select dialog lets you specify selection sets.

  4. In the General group, turn off Constrain to XY Plane.

  5. Turn on SET, the adjacent check box.

    This ensures that the changed setting takes effect when you exit the dialog.

  6. Click the Apply Edit button.

    This closes the dialog and applies your change to all specified delegates.

  7. Solve the simulation again.

    This time, the delegates move in three dimensions. Half of them move directly towards the box, and the other half turn and move directly away. The seeking delegates continue to seek the box after they reach it, continually circling it.

  8. Save this file as cs_tut08_lesson3a.max for use in the next lesson.

Next

 

 

 


Comments