Game Development Reference
Establishing a safe following distance is more involved and depends on many
factors, however, as we will see in the code. The math for vehicles on a straight
section of freeway is far simpler than the math for birds in flight.
When looking for new emergent behavior, start with the simplest interactions.
The code should resemble general rules more than a book of moves. It is hard to
force emergence, and it can be easy to over-think the problem; tightly scripted
behaviors are too organized to allow new behavior to emerge.
Individual goal-directed boids do not compute the most direct path to their goal
and take it. They are not striving for optimal behavior; they are settling for
reasonable behavior. Optimization drives toward order, fewer choices, and
predictability. There is little or no room for new behaviors to emerge when
everything that is not mandatory is prohibited. This is fine if the AI is for battle
droids marching in lockstep formation, deterred from conforming only by their
own destruction. It certainly will not be lifelike. Optimal behavior can be hard or
impossible to compute, turning this ''close enough is good enough'' approach
into a virtue.
The flip side of too much order is none at all. If what emerges is to be termed
behavior , it needs to have some minimal amount of coherence. Conflicting
directives need a rational resolution. If the interaction inputs drown out the
agent's internal checks and balances, the system will probably not be stable. Ponzi
schemes eventually collapse, stock-market bubbles burst, and bank runs are
stopped by government authorities. If all agents disregard their internal checks
and balances, the system crashes. In contrast, a system in which the agents dis-
regard their internal checks and balances to varying degrees might exhibit large
swings but on the whole remain stable. Getting the checks and balances right is
one of the new challenges presented when dealing with emergent behavior.
The messy middle ground between order and chaos is a hallmark of living things.
If we want our agents to have organic credibility, they must also appear to live in
this messy middle ground. Programmers and designers who abandon the need
for total control may find that emergent behavior gives them the lifelike
appearance that they are after. Most people take steps to manage their time and
their finances. While nearly everyone knows how they can further optimize their
time and their finances, few find that they can comfortably live within the tighter
constraints that additional optimization imposes.