JavaScript EditorFree JavaScript Editor     Ajax Editor 

Main Page
  Previous Section Next Section

Modeling Feelings

Because feelings are associated with categories of objects, the animats require a minimal memory to be capable of "feeling." In this section, we'll focus on feelings for other players as they vary from one character to another—unlike objects that have mostly constant benefits. Fascinating interpersonal behaviors could arise from this design.

Memory of Relationships

Players experience emotions while in close proximity with each other (such as anger or joy). These emotions could be remembered to express the feelings (for instance, as the average anger or joy value). However, a more compact approach only stores essential facts, and derives the feelings from them implicitly. This approach enables us to add feelings that are not necessarily emotions.

Data is collected in a statistical fashion, although moving averages allow the trends to change over time (unlike a standard average where the results eventually converge). The following information is gathered over time:

  • Damage taken and inflicted

  • Number of shots fired and received

  • Value and difference of the "kill counters"

This information is used to measure negative feelings (for instance, hatred). Positive feelings (for instance, attraction) are instead based on fixed properties such as gender. Such information is sufficient for deathmatch games, but could be trivially expanded to remember other little details.

Recognizing Feelings

The animats will be subject to four independent feelings: pity, hatred, attraction, and disgust. These are relatively easy to portray in the behaviors (especially in deathmatch games), and are sufficiently distinct from each other.

Each feeling is recognized by a finite-state automaton. The automaton uses the data collected about the players to decide what the animat's feelings are. For example, pity is triggered for large differences in the number of wins versus losses; hatred instead is felt for particularly accurate enemies (that is, high ratio of shots to damage).

Instead of keeping each finite-state automaton (FSA) separate, these are grouped into one large nondeterministic FSA (NFSA) for convenience. Nondeterminism allows the different automata to be merged together very simply, using (epsilon) e transitions, as shown in Figure 42.2.

Figure 42.2. Four deterministic FSA connected into one NFSA to recognize feelings.


Additional feelings could be added very easily thanks to this mechanism. The FSA for the new feeling can be modeled separately, and grouped with the NFSA during the design. The subset construction algorithm described in Chapter 40, "Nondeterministic State Machines," can be used to factor out nondeterminism and create an FSA instead. Alternatively, the algorithm can simulate each NFSA separately to find all the feelings.

The feelings will mainly be used to generate new sensations. However, the feelings can be used by other behaviors as necessary—for example, selecting which enemy to combat.

      Previous Section Next Section

    JavaScript EditorAjax Editor     JavaScript Editor