In the real world, different crowds exhibit diverse behaviors, and even members of the same crowd can conduct themselves in various and sundry ways. Included with character studio's Crowd system is an assortment of behaviors that let you simulate a range of crowd activities. And if you need custom behaviors, you can create your own.
Following is a list of available behaviors:
Avoid Behavior - Prevent delegates from colliding. Avoidance can use any combination of turning, braking/stopping, repelling, and vector field.
Orientation Behavior - Applies a fixed orientation or orientation range to delegates, so they face a specific direction instead of toward the destination. You can specify orientation in absolute terms, or relative to the direction the delegate currently faces.
Path Follow Behavior - Restricts motion to a spline or NURBS curve; options include back-and-forth patrol-type movement.
Repel Behavior - Forces delegates to move away from a target.
Scripted Behavior - Uses MAXScript to specify behavior.
Seek Behavior - Moves delegates toward a target or targets.
Space Warp Behavior - Uses any dynamics-oriented space warp to control movement, including wind and gravity. Vector Field, a crowd-specific space warp that lets delegates avoid irregularly shaped objects while following their contours, is included with character studio.
Speed Vary Behavior - Lets delegates change speed for more realistic movement.
Surface Arrive Behavior - Lets delegates move toward and land on a surface, with custom speed and acceleration parameters.
Surface Follow Behavior - Delegates move along a surface, which can be animated. Also, you can specify whether the delegates are to move straight ahead or skirt hills and depressions.
Wall Repel Behavior - Uses a grid to repel delegates; ideal for keeping objects inside an enclosed, straight-sided room.
WallSeek Behavior - Uses a grid to attract delegates. You can use this as a doorway for crowd-controlled bipeds to walk through.
Wander Behavior - Induces a realistic semi-random movement for characters such as shoppers at a mall.
To use a behavior, you apply it to a delegate or a team of delegates using the Behavior Assignments and Teams dialog. In this dialog, each assignment of a behavior to a delegate is given a weight. You can modify and/or animate these weights to influence the simulation.
Behavior assignment weights can profoundly effect a simulation. When applying two or more behaviors to the same delegate, the weights define the relationship between the behaviors, making one more or less powerful than the other. One way to visualize a behavior assignment weight is to examine the behavior's force vector during a crowd simulation. The vector's length indicates the behavior's weight upon the delegate.
Each behavior has its own parameters which appear in the Behavior rollout, available in the Crowd object's Modify panel. These parameters describe how the behavior works, and can sometimes contribute to the behavior's strength as well. For instance, Seek, Repel, Wall Seek, and Wall Repel, all have specific volumes of influence. Outside these volumes they have no effect and essentially have a weight of zero. This rollout lets you specify whether or not you wish to see behavior's force vector dynamically displayed during a Crowd simulation, and what color that vector should be.
When working with the Crowd system, it is critical to play with behavior assignment weights, as well as each behaviors' parameters. Typically, you run the simulation repeatedly, changing the weights and parameters to get the desired result.
A few behaviors cannot be 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 stringent measures to affect the delegate, possibly overpowering other behaviors in order to meet their constraints. Orientation simply sets the delegate's facing direction. It cannot be weighted and does not apply a force.
A few helpful things to know about behaviors in character studio:
You can create conditional behavioral systems with Crowd's Cognitive Controller feature. This uses 3DS MAX's MAXScript scripting language to determine when to effect a transition from one behavior to another; we've provided a number of sample scripts for you to learn from and adopt to your own simulations in Cognitive Controller Editor and State Transition Dialog.
The Behavior rollout appears immediately after the Crowd object > Setup rollout in the Modify panel. However, it doesn't show up until you've added at least one behavior to the crowd object.
The Crowd panel displays only one Behavior rollout at a time. To access a different one, choose its name from the drop-down list at the 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 Doorway" or "Follow Hilly Surface." You do this by clicking its 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 may need to animate settings as well.