Game Development Reference
In-Depth Information
Some recent games have incorporated more realistic-looking combinations of idle
behaviors that don't rely on player-triggered events. Despite the appearance of
added complexity, however, the enemy is still “waiting for something.�
A completely event-triggered method can also be extremely brittle. Depending
on when and in what order the messages arrive, our agents may react in different and
unexpected ways. Even messages that arrive in the same frame may be processed in
an order that leads to problems simply because of the order they were placed in the
message queue. Also, considering that some of the actions that we may trigger as a
result of a message can take a significant amount of time to perform (especially
when measured in 20 ms frames), we may effectively preclude a response to some-
thing that needs to be considered.
For example, if we receive a message that causes our agent to decide to do
something relatively mundane (such as answering the phone), we initiate that task,
and then receive information of a high priority (the grenade), we may not process
that information until much later. Our agent can get stuck doing the mundane task
when he needed to consider something else.
The mechanics of event-driven architectures, the messaging systems that sup-
port them, and the difficulties involved in interrupting animations are well docu-
mented in other topics. However, it is important to be aware that they exist from a
conceptual standpoint.
A H YBRID A PPROACH
As we have seen with the various tools and techniques throughout this topic, a
combination approach is often called for. We can draw from the strengths of the
different methods to build an appropriate self-monitoring scheme. As we discussed
at length in Chapter 2, observation of our own behaviors holds many clues to what
the proper approach is. Just as we broke down a decision process into smaller val-
ues, formulas, and algorithms, we can subdivide the decision-monitoring process
into component parts.
For example, think about what we do when we drive a car—an example we
touched on briefly above. The decisions we make require a reevaluation of our en-
vironment to determine that our current course of action is the correct one. For
simplicity's sake, let's list only the factors we consider to determine if we should
change our speed. While we monitor many items on a regular basis, we monitor
none of them on a continual basis—that is, taking up all of our attention. We tend
to alternate our attention between the following:
Our current perceived speed
Our current reported speed
 
Search WWH ::




Custom Search