Bringing Characters to Life Reprinted from The Journal of Computer Game Design Volume 2, Number 2, (December 1988): pages 10-11 Copyright 1988 by David Graves dag@hpsemc.cup.hp.com A common failing of interactive fiction today is that the player is totally responsible for the progress of the plot. Whenever the player cannot solve a given puzzle, progress grinds to a halt. Most interactive fiction works are entrenched in this obstructionist model. There is no plot continuity, and too little dramatic interaction. Our characters are not "pulling their own weight". The first step is to take the player out of the role of being responsible for the flow of the plot. In her PhD dissertation, Brenda Laurel explains: "The user of an interactive system may indeed make contributions on the level of plot; however, the responsibility for integrating such contributions into the whole and creating other plot elements that maintain the necessary dramatic qualities in the whole belongs to the system. When that responsibility devolves to the user, first-personness is destroyed, as in the classroom improvisation where the actor must divide his attention between acting and playwriting tasks. By assuming formal control of the action, the system frees the user from playwriting concerns and allows him to immerse himself in the experience of his character." Furthermore, the characters found in most computer games are cardboard cut- outs, without any personality. In her PhD dissertation, Mary Ann Buckles points out this failing in the original Adventure game, which still applies to most games today: "The characters the reader encounters in the fictional underworld have no significance other than to pose a puzzle for the reader. The reader has little emotional involvement with the characters because they, in turn, do not represent any emotional or spiritual facets of human existence." Artificial Personality (a term coined during the design of Chris Crawford's Siboot project) addresses this need for simulating personality in our characters. Almost all attempts to generate behavior in computer-controlled characters have followed a simple stimulus/response model. For each statement you may make to character, there is one response it may display. Giving the same stimulus several times in a row, the character will mindlessly repeat the same response. Clearly, there is room for improvement in creating lifelike characters, but how can we attack such a difficult task? To start, we can extract a number of ideas and methods from the field of Artificial Intelligence. In his unpublished book on simulated worlds, Warren Robinett puts it this way: "The field of Artificial Intelligence has fragmented itself, seeking to closely emulate various human abilities such as vision, use of language, and problem solving. Researchers are still immersed, after 30 years of effort, in discovering the mechanisms by which vision, language, and choice work. Perhaps it is too ambitious to have tried to simulate the behavior of man, a creature of 50 trillion cells. Certainly, simple models of plans, emotions, or knowledge could be defined. A creature's plans, emotions, or knowledge would affect its behavior. A plan is a sequence of actions to be carried out, with the intent of achieving some goal. An emotion is a state which affects what goals are chosen, with for example, fear eliciting flight, and desire eliciting pursuit. Knowledge is a list of objects external to the creature, and their attributes and relations." I'll address each of these prerequisites to behavior generation, plus a few others, in the sections to follow. We can borrow from the field of AI, avoiding the difficult problems that haven't yet been solved, to produce the illusion of intelligent, emotional, motivated characters. INTELLIGENCE AND GOALS In order for characters to act intelligently they must be able to interpret the state of their environment and apply appropriate behaviors. James Meehan, who developed the story generating system "TALESPIN" as part of his PhD work, states "A problem domain contains: (1) a set of representational primitives, (2) as set of problems which are expressed in terms of those primitives, and (3) as set of problem solving procedures." Meehan's characters applied their knowledge to solve problems, creating a story by their actions. While applying a problem solving procedure to achieve some goal, however, complications may arise. In traditional interactive fiction, we pass all these problems to the player. Instead of troubling the player character minor complications, the game software could automatically resolve them. For example, given the command "Drink the beer", rather than having a character complain "The beer isn't open", it could recognize "Open the beer" as an implied subgoal. Any given goal could give rise to a number of subgoals, which may create subgoals of their own. When a character is able to handle low level logistics without being given explicit instructions, he appears much more intelligent. This technique also provides a mechanism for handling tedious logistical details on behalf of the player, who is then free to think at higher levels. The topics of handling subgoals and representing the physical environment are covered in detail in "Second Generation Adventure Games" by Graves. Meehan points out that "This isn't the stuff that stories are made of. It may be coherent, but it isn't normally interesting". However, a certain level of intelligent behavior is required in any simulated character, else the illusion of lifelikeness is too easily shattered. Further, this software layer makes a platform for simulating motivated behavior: an important "fuel for plot". MOTIVATION AND DRAMA No organism's behavior is ever unmotivated. Thus, in order for characters to display behaviors that appear reasonable and believable, they must have their own motivations. These motivations help stimulate the generation of plot. However, without guidance for the plot, chaos is a likely result. To ensure that the generated plot is interesting, the system could have some concept of drama and apply it to the currently unfolding story. Laurel's dissertation gives an outline of an expert system to do just that. "Understanding a story in its totality is a task that integrates natural language understanding and the understanding of characters' goals, plans, traits, and emotions, and utilizes still other techniques for identifying larger patterns of action." This computerized playwright would recognize opportunities for new plot twists and act on them. Clearly, this is a lofty vision, requiring vast resources to implement. Several projects have been successful in creating small expert systems that focus on character behavior and interaction, rather than attempting to recognize and generate plot units. Crawford employed a set of over 70 rules which defined the specific behaviors for character interaction, plus rules dictating the unseen internal reactions of the characters. Instead of focusing on generating a storyline, the game focused on interesting associations between characters, via dialog and deal-making. Meehan demonstrated a simple (although powerful) technique for driving the plot in TALESPIN. The plot unfolds simply from the goals of the characters, their relationships to each other, and their individual traits. Thus, using Meehan's model the author exerts indirect influence on the plot, through the definition of the characters. Changing the initial state of the characters would result in the generation of a different story. Of course, an author could also "cheat" by defining additional goals or feelings that may be inserted in a character's head at certain times critical to plot development, or in response to some external stimulus. This forms the basis of the Artificial Personality research currently in progress by Tim Brengle and myself. We use code fragments called "affectors" (which may be attached to various locations, objects, or actors) to influence an actor's behavior by giving him additional goals or by modifying his emotional state. Using this model, each character's emotional state and current goals drive the selection of a specific behavior from a large set of possible behaviors. The intensity of the appropriate emotion values is then used to determine the intensity of the expression of the behavior. The description of the behavior may be embellished with adverbs or modifying phrases based on additional emotional state, providing "color" to the text. Even when performing simple actions, a character's hidden emotional state may "leak out". The internal emotional states and displayed behaviors form a feedback loop: one character's display may poke the affectors of another character. Thus, the way in which a character attempts to accomplish his goals may be influenced by his emotions and those of the other characters. Due to the complexity of the emotional state of the characters, the sub-plot twists are unpredictable, and due to the the goals inserted at plot-critical times, the author can control the overall plot coherence and pace. EMOTIONS AND RELATIONSHIPS In creating a model of personality and relationships, one must select a manageable set of emotion variables. The magnitude of these variables will define how each character relates to the others. Selecting the appropriate set of emotions is a surprisingly difficult task. Further, different sets of emotions are needed for different types of stories. Laurel wrote that "Aristotle identified sets of emotions that are most appropriate to each dramatic genre: fear and pity for the tragic form, laughter and ridicule for comedy, and fear and hate for melodrama." Crawford's first set of emotions for Siboot was trust, fear, and affinity. His psycho-linguist consultant, Christa Hansen, proposed good/bad, strong/weak, active/passive, arguing that this set was more orthogonal. However, determining a set of truly orthogonal emotional variables is difficult because real emotions overlap and bleed into each other so much. Meehan decided to forgo orthogonality for completeness: his emotional palette consisted of trust, affection, dominance, deceptiveness, competition, familiarity, and indebtedness. Each of these emotion values tells how one character feels about another. Meehan points out that `It's also very important to us to be able to distinguish "John loves Mary" from "Mary loves John", so that "John loves Mary" does not contradict "Mary does not love John". The asymmetry of interpersonal relationships is a great source of social dynamics. From the storyteller's point of view, such things tend to keep the story lively, giving rise to new goals all the time.' In addition to these two dimensional emotions (directed towards other characters), some one dimensional emotion variables may be created, which indicate a character's internal emotional state or mood, or personality attributes that remain constant. Michael Lebowitz, creator of a program that writes soap opera stories, uses one-dimensional attributes such as niceness, guile, physical-appearance, and promiscuity. A WIDER DOMAIN FOR DISCOURSE In most interactive fiction products, characters are treated as objects. Most interactions with other characters are limited to making imperative statements to them (giving commands). True interaction with characters is impossible in these worlds because the representation of the world is void of any "interactive media". You cannot talk with them because there is nothing to talk about. In worlds containing only objects, the only topic of discourse is the "object economy" (physical objects that may be manipulated). In order to produce interaction on more human terms, a system must have (1) a rich representation for emotions, knowledge, and beliefs (an "emotion economy" and an "information economy", terms coined by Crawford); (2) a rich set of behaviors that are driven by these new economies; and (3) a rich grammar for communication of knowledge, events, beliefs, and emotions. These subsystems must be fully integrated with each other. One would not want to design-in emotions that cannot influence behavior, or that cannot be talked about using the input grammar. To support the economy of knowledge and beliefs, a rich knowledge database must be constructed. It would contain both static initial data (the state of the world's knowledge before the start of the game), and dynamic data of events or information flow as the game proceeds. Each character would have pointers into this database to indicate the set of his own knowledge and beliefs. This database may be inconsistent, as some characters may hold beliefs that contradict the knowledge or beliefs of other characters. At the center of any Artificial Personality system is an emulation of human emotions. Besides providing new motivation for believable behavior, emotions give the characters a new domain for discourse. They may interact on the levels of physical state, information state, and emotional state. In designing an interactive story, the designer must keep in mind the interlocking dimensions of physical state, emotions, character beliefs, behavior, and communication. One must also keep sight of the vision: characters displaying believable original behavior and engaging in interesting, dramatic interaction. ----- ooooo OOOOO ooooo ----- REFERENCES All three PhD dissertations may be obtained from University Microfilms, (800) 521-0600, at about $50 each. Look up "Poetics" in your library. Mary Ann Buckles, "Interactive Fiction: The Computer Storygame 'Adventure'", Ph.D. diss., University of California, San Diego, 1985. Has its moments, even though the game is over a decade old. David Graves, "Second Generation Adventure Games", The Journal of Computer Game Design, vol. 1, no. 2, (August 1987): 4-7. Brenda Laurel, "Towards the Design of a Computer-based Interative Fantasy System", Ph.D. diss., Ohio State University, 1986. Defines the vision and the technologies required to implement it. Read one this first. Michael Lebowitz, "Creating Characters in a Story-Telling Universe", Poetics, 13, (1984): 171-194. James Meehan, "The Metanovel: Writing Stories by Computer", Ph.D. diss., Yale University, 1976. An AI classic, with implementation details.