Game Development Reference
behavior. Consider how hard it would be to orchestrate the same behaviors with
a top-down, coordinated approach. As a thought problem, try to see if you can
define these behaviors without resorting to using terms equivalent to the inter-
actions of independent agents. Forcing these formations would be hard; letting
them happen is simple.
Emergent behavior yields realism at a low run-time cost, especially when applied
to group movement. More innovative uses will require exploration and tuning to
achieve the maximum effectiveness of the method, but even these efforts are
quite reasonable. AI built this way tends to degrade gracefully in the face of overly
constraining circumstances, but it is not free of its own set of peculiarities. Every
AI programmer considering these methods should keep in mind the unpleasant
behaviors seen when a real bird gets trapped in an unfamiliar environment.
Answers are in the appendix.
1. List the elements and characteristics of a system that allows and encourages
2. Describe the effects of feedback and the effects of feedback rates.
1. Adjust the tuning settings for the AI think rate. A rate of one thought per
second is the slowest that is still safe for the simulation. Note how the drivers
miss open slots. Increase the rate above two until it matches the frame rate.
Note how this makes it harder to see what the drivers are doing.
2. Change the SpeedInLane() function to allow the drivers to change into lanes
with compromised clear distance. The comment above an If statement talks
about dampening maniacal lane changes; make that If statement always
true instead of true only when the lane being evaluated is the current lane.
Run the code and note the amount of ruthless lane changing it generates.
Notice how two lanes will swap with each other when a car cuts off another;
this creates a better hole for the car that got cut off, thus creating a ripple