Game Development Reference
In-Depth Information
Chapter 5. Crowd Control
In this chapter, you will learn how to build large crowds into your game. Instead of
having the crowd members wander freely, like we did in the previous chapter, we will
control the crowds better by giving them directions on what to do. This material will
be useful for a wide range of game use cases, such as planning soldier attacks by
groups or directing flows of traffic in a car game.
In this chapter, you will learn about:
• Crowd-steering behaviors
• Using the Fame Crowd Simulation API to manage crowds
• Exploring ANT-Op to create more goal-directed crowds
An overview of crowd control
In Chapter 4 , Crowd Chaos ,welookedatcreating crowdsusingwanderingbehaviors,
where different crowd members worked individually to travel to different points. This
works well for ambient crowds, but there was no working as a group. As there was no
larger group-defined behavior or director managing crowds, our previous implement-
ations required creating and configuring character AIs individually. Defining and con-
figuring individual AIs is fine for smaller groups, but not practical when creating much
larger crowds. In the demos in this chapter, we will look at crowds that work, or at
least move, as a group. Moving AI characters in groups, also called flocks, has been
a popular subject in AI for many years. The most popular system is called Boids , and
it was designed in the 1980s by Craig Reynolds, a renowned computer graphics and
AI developer, and the basic design is used in crowd AIs in most games today. In these
systems, different simple steering behaviors are defined, such as moving to a target
position or following a path, as well as behaviors to not collide with other agents or
align to the same direction of nearby agents.
These simple behaviors are applied to large numbers of game characters (or in the
original system, Boids), and when they run together, they move as groups the way
you would expect them to. These simple behavior combinations give surprisingly real-
istic results considering how simple the individual steering behaviors are.
Search WWH ::




Custom Search