8

Assigning Behaviors 1013
A few behaviors cannot b e weighted. These are
Avoid, Surface Follow, and Orientation. Avoid
and Surface Follow take over after all of the other
behaviors have been applied to a delegate. They
can take str ingent measures to affect the delegate,
possiblyoverpoweringotherbehaviorsinorderto
meet t heir constraints. Orientation simply sets the
delegate’s facing direction. It cannot be weighted
and does not apply a force.
Behavior Tips
A few helpful things to know about behaviors in
character studio:
You can create conditional behavioral systems
w ith Crowd’s Cognitive Controller feature.
This uses the MAXScript scripting language to
determine when to effect a transition from one
behavior to another; we’ve provided a n umber
of sample scripts for you to learn from and
adopt to your own simulations in
Cognitive
Cont roller Editor (p age 2–1057)
and
State
Tr ansition Dialog (page 2–1060)
.
The Behavior rollout appears immediately after
the Crowd object > Setup rollout in the Modify
panel. However, it doesn ’t show up until you ’ve
addedatleastonebehaviortothecrowdobject.
The Crowd panel displays only one Behavior
rolloutatatime. Toaccessadifferentone,
chooseitsnamefromthedrop-downlistatthe
bottom of the Crowd object’s Setup rollout.
As with most scene entities in 3ds Max, it’s a
good idea to give behaviors custom names, such
as "Seek D o or way" or "Follow Hilly Surface."
You do this by clicking the behavior’s name in
the Setup rollout and entering a new one from
the keyboard.
The default behavior settings may not always
give the ideal results. The optimal settings
depend vary with the particulars of your
simulation setup; in many cases, if not most,
you’ll need to experiment with the settings to
get the results you want. In some cases, you
might need to animate settings as well.
One particularly useful feature of the delegate
is its ability to display, using colored vectors,
the strength and direction of the various
forces acting upon it during solution of the
crowd simu lation. Each force can have a
unique, identifying color. For example, the
Seek b ehavior uses green by default, w h i le the
Wander behavior uses aqua. You can change
these colors to any you like.
If a simulat ion isn’t proceeding as expected, you
candebugitbyobservingthevectorsduring
the s olution. And if the solution occurs too
quickly,youcanusetheStepSolvefeatureto
solve the simulation one f rame at a time.
Procedure
To use a ssign behaviors to delegates:
This ex ample shows how to create a basic crowd
simulation with delegates and b ehaviors.
1. Run 3ds Max or reset the program.
2. Add a Crowd object and one or more
Delegate
objects
to the scene. In general, add delegates
in the Top view port so that they point forward.
The Crowd object’s location is immaterial.
3. Select the Crowd object and open the Modify
panel.
4. On the Setup rollout > Behaviors group, click
the New button .
5. In the Select Behavior Type dialog, click a
behavior and then click OK to close the dialog.
ABehaviorrolloutappearsforthebehavior
you chose.
6. If the behavior requires a target object or
objects, such as Se ek, click the None button and
then select an object, or click Multiple Selection
and select several objects.
7. Change other behavior sett i ngs as necessary.