Using Multiple Delegates and Behaviors
 
 
 

3ds Max 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.

Set up the lesson:

  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 open a MAX file that already has these objects. Open crowd_basics01.max from the tutorials\character_animation\crowd_basics directory in your 3ds Max path.

Clone the delegate:

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. Press H to open the Select From Scene dialog, select the Crowd object, then go to the Modify panel.
  2. In the Setup rollout, click the Scatter button to open the Scatter Objects dialog.
  3. On the Scatter Objects dialog > Clone panel, click the Object To Clone button and select Delegate01. Click Select to close the dialog.
  4. Change the How Many setting to 9.
  5. Click the Generate Clones button.

    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 panel > Placement Relative To Object group, choose On Surface.
  7. In the same group, click the Grid/Box/Sphere/Surface/Shape 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. Near the bottom of the Position panel, click the Generate Locations button.

    The software distributes the delegate clones randomly on the sphere surface.

    Delegates are scattered about the sphere surface.

Reorient the 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 box.

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

    This makes the button available.

  2. In the same group, click the Selected Object button, and select Box01.
  3. Click the Generate Orientations button.

    The delegate clones are all now pointing at the box.

    Delegates are pointed at the box.

  4. Click OK to close the Scatter Objects dialog.
  5. Select the large sphere, and press the DELETE key to remove it from the scene.

    You'll use this setup in the fourth lesson.

  6. Save the file as crowd_basics03a.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.

Add behaviors:

  1. Select the Crowd object. In the Setup Rollout, click New and add a Seek Behavior.
  2. On the Seek Behavior rollout, click the button at the top (currently labeled “None”), and select the box.

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

  3. On 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.

  4. In the Behavior Assignments And Teams dialog > Teams group, click New Team, and then OK.

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

  5. Rename the team Seek Team.

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

  6. 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.

  7. In the Assignment Design group > Teams list, click Seek Team, and in the Behaviors list, click Seek.
  8. Click the vertical New Assignment button to create the assignment.

Create a behavior with the Behavior Assignments And Teams dialog:

You'll create a Repel behavior using 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. Click OK.

    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. On the Setup rollout, choose Repel from the list.

    The Repel Behavior rollout replaces the Seek Behavior rollout.

  3. On the Repel Behavior rollout, specify Box01 as the repel object, using the same method as with the Seek behavior.
  4. On 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. Return to the Behavior Assignments And Teams dialog. Create a new team containing Delegate06 through Delegate10. Rename it Repel Team.
  6. Assign the Repel behavior to Repel Team and close the dialog.
  7. In the Solve rollout, click Solve to solve the simulation.

    Half the delegates move toward the box and the other half move away, but they all stay on 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.

Move the delegates in three dimensions:

  1. On 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 the Select All icon, then click Select.

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

    NoteYou 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 toward 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 crowd_basics02a.max for use in the next lesson.

Next

Applying Avoidance