Game Development Reference
In-Depth Information
coherence as a herd. Without interactions between individuals, there would be
no herd behavior; as best we can tell, bison do not get instructions from any
centralized sources.
Half of a randomly aligned buffalo herd will not see a hunting predator (buffalo
ignore wolves that do not appear to be hunting) because they are pointed the
wrong way. Their safety depends on actions taken by the rest of the herd. A deaf
buffalo will not hear snorts and other signals; unless some action takes place
where it is looking, it will not react with the herd. Its failure to react also means
fewer cues for it neighbors . A deaf buffalo exhibits inferior individual actions, but
it also weakens herd behavior due to its diminished interactions .
There is a chain in all of these examples. It goes like this: Agent A acts, Agent B
notices the action, Agent B reacts, Agent A notices the reaction.... Unlike
reactors, bison do not seem to have major problems if the chain of herd reactions
result in a stampede.
In the Cars and Trucks freeway-simulation project for this chapter, each vehicle
pays attention to the lane, speed, and position of the vehicles around it and reacts
by changing its speed and/or its selected lane. The simulation moves the cars and
trucks every animation frame, so differences in speed create changes in relative
position. Thus, the actions taken by each vehicle cause interactions with the
nearby vehicles. The agents could be programmed to do many other things, such
as select a radio station, but the other agents would ignore these behaviors, and
thus they would not cause any interactions.
Simple Behaviors
The basic design for systems that create emergent behavior seems to be, ''Toss in
a few rules and turn them loose.'' This exploits the simplicity of the system and
keeps the programmer from investing in code that later proves superfluous.
Boids only needed simple behaviors.
Simple behaviors do not always imply that they are simple to code. Simplicity
was a design goal for the Cars and Trucks freeway simulator project for this
chapter. It has three basic behaviors: The vehicles are not allowed to change lanes
into another vehicle, the vehicles prefer the fastest lane possible, starting on the
right, and the vehicles try to keep a safe following distance for their speed.
Avoiding collisions when changing lanes proves to be relatively easy to imple-
ment. Determining the speeds available in nearby lanes is also quite simple.
 
 
Search Nedrilad ::




Custom Search