Information Technology Reference
In-Depth Information
Thesegoalsareoftenspawnedas reactions to user interaction or other events
in the environment, or to the character's own internal metabolism. Note that
many of the goals are non-narrative, such as being tickled or being picked up
and carried; in a reactive situation, narrative and non-narrative goals compete
for execution. At any decision point, each goal's filter function is queried to
compute how important it is for that goal to execute under the current cir-
cumstances. Filter functions are custom code in which the programmer can
specify under what conditions a goal should execute. In a reactive context, a
filter function for a narrative goal is customized to respond strongly in situa-
tions in which objects its behavior requires are now available. Part of the craft
of authoring behaviors is balancing the output of these filter functions; it is
easy to accidentally code a behavior to happen far too often or too seldom for
believability.
Narrative goals can also be spawned deliberately as a need to regularly ex-
press the character's particular personality and maintain an illusion of free
will. This is achieved by regularly querying all goals' filter functions in a non-
reactive context, using the character's personality attributes as a basis for eval-
uating its goal's importance; only the filter functions for narrative goals are
coded to respond in this context. Additionally, a simple “story manager” is
keeping track of how often certain interesting narrative goals have occurred
over time, and will deliberately spawn such a goal if the user hasn't experienced
one in a while.
All instantiated goals are sorted in order of urgency priority, with only one
goal executing at any one time (the highest priority goal); all others are sus-
pended (that is, waiting to start or to resume execution). At any time the cur-
rent active goal can be interrupted and suspended if a higher priority goal is
spawned. In fact goals can spawn other goals, allowing for multiple goals to
queue up for eventual execution. Goals may delete themselves if their context
conditions become invalid.
As a first example of a short-term narrative (and perhaps the quintessen-
tial baby behavior), the metabolism model is keeping track of how much time
has passed since a Baby last ate, and may spawn a high-priority “soil diaper”
goal. This goal always begins with the same plan, “poop in diaper”, in which
the Baby sits still wherever it may happen to be on-screen at that time, making
sounds and facial expressions to the effect of dirtying its diaper. After this plan
finishes, the goal lowers its own priority, and suspends itself. This allows other
medium-priority independently spawned goals to execute, such as “play with
toy”, “crawl and explore”, “build blocks” and so on. (Which new goals get cho-
sen is influenced by, for example, what toys the user may be interacting with at
Search WWH ::




Custom Search