Game Development Reference
In-Depth Information
To make this process more involved, let us return to the idea that the decision
about “who to shoot� is only a part of the whole. At the end of Chapter 14, we listed
other actions that we could consider: fleeing, hiding, surrendering, grabbing a
health pack or a new weapon, running to a detonator of our own, or (as we so glibly
joked) pausing to take a photo to memorialize the occasion. When we consider
those actions as well, the line that demarks when we should process a new decision
is a little more blurry.
If we are hiding, for example, when do we peek out? How often do we think
about peeking out? If we have decided to head off in pursuit of the health pack in
the distance, what happens if someone else takes it first? Or shoots a rocket at it? Or
simultaneously makes a break for the world-ending detonator? All of those are sit-
uations that may cause us to change our mind about what we should be doing.
Continuing on with our current course of action could make us look… well… less
than intelligent .
The answers to some of those events are triggers. A Dude shooting a rocket at
us is certainly a trigger that would get our attention and spur us into careful recon-
sideration of our priorities. On the other hand, some of the criteria are polling-
based. “Is the health kit still there?� is very similar to checking to see if our target is
still alive, for example.
Other answers are a little harder to nail down. For instance, we don't want to
trigger an event every time a Dude moves. We would never stop triggering events!
We can stick to polling the relevant information about the location of the Dudes to
determine if any one of them is either an urgent threat or an opportunistic easy kill.
However, if our polling interval is too long, the Dude may get a jump on his dash
for the doomsday switch before we can react.
Again, there isn't a “right� answer that covers every contingency. We must
keep in mind, however, is that we must find that elusive balance between useless
reprocessing and the accuracy of the current decision.
P ERSEVERANCE AND D ECISION M OMENTUM
While changing our mind at appropriate times and for appropriate reasons is a ne-
cessity to building agents that react adequately to their surroundings, problems can
result. Even a seemingly logical decision change—in both the timing and content—
can be perceived as odd, unproductive, or incorrect. What's worse, by making our
agents reactive to their environment, we can be opening them up to manipulation
and exploits.
Rather than doing theory first and then an example, let's reverse the process.
 
 
Search WWH ::




Custom Search