Tutorial 8: Working with Crowd Animation
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.
Run 3DS MAX or reset the program, and then add a delegate and crowd object as in the first lesson.
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.
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.
Select the crowd object and go to the Modify panel.
In the Setup rollout, click the Scatter button to open the Scatter Object dialog. This dialog is fully documented in Scatter Objects Dialog.
In the Scatter Objects dialog > Clone tab, under Object to Clone, click the None button and select Delegate01. Click Select to close the dialog.
Change the How Many setting to 9.
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.
In the Scatter Objects dialog > Position tab > Placement Relative to Object group, choose On Surface.
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.
Click the Generate Locations button at the bottom of the Position panel.
Delegates are scattered about the sphere surface.
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.
In the Scatter Objects dialog > Rotation tab > Look At Target group, choose Selected Object.
This makes the None button available.
In the same group, click the None button and select Box01.
Click the Generate Orientations button.
Delegates are pointed at the box.
The delegate clones are all now pointing at the box.
Click OK to close the Scatter Objects dialog.
Select the large sphere and press the DELETE key to remove it from the scene.
You'll use this setup in the fourth lesson.
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.
Select the crowd object and, in the Setup Rollout, add a Seek behavior.
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.
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.
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.
Rename the team Seek Team.
Next, you'll specify which delegates are to be members of Seek Team.
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.
In the Assignment Design group > Teams list, click Seek Team, and in the Behaviors list, click Seek Behavior.
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.
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.
In the Setup rollout, choose Repel Behavior from the list.
The Repel Behavior rollout replaces the Seek Behavior rollout.
In the Repel Behavior rollout, specify Box01 as the repel object, using the same method as with the Seek behavior.
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.
Create a new team containing Delegate06 through Delegate10 and rename it Repel Team.
Assign the Repel behavior to Repel Team and close the dialog.
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
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.
In the Edit Multiple Delegates dialog > Delegates to Edit group, click the Add button.
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.
In the General group, turn off Constrain to XY Plane.
Turn on SET, the adjacent check box.
This ensures that the changed setting takes effect when you exit the dialog.
Click the Apply Edit button.
This closes the dialog and applies your change to all specified delegates.
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.
Save this file as cs_tut08_lesson3a.max for use in the next lesson.
Lesson 3: Applying Avoidance and Animating Behavior Assignments