James Kuffner  
 
Research
Papers

High-Level Behaviors for
Autonomous Animated Characters

James Kuffner, Jr.
Stanford CS Robotics Laboratory
August 1999

Overview

For the purposes of creating interesting animations for autonomous characters, some degree of high-level scripting of a character's behavior is needed. The general idea is to aggregate several lower-level task commands using a logical scripting language. The goal is to create a script (program) that defines a higher-level behavior.

Scripting Languages

At a minimum, a scripting language should provide the ability to loop and perform conditional branches. The ability to invoke other scripts (possibly passing parameters to them) is not necessary, but very convenient for modularizing behaviors.

Links to the animation system are accomplished via sensors ("inputs") and actions ("outputs"). Sensors serve as feedback channels, providing abstract representations of what the character perceives in the environment. Actions are either low-level motor commands or high-level task commands (e.g. "move", "walk", "get", "touch", etc).

Using the data provided by sensors in conditional branches facilitates the ability to alter a character's actions depending upon what the character perceives in its environment. As a consequence, even very simple scripts with sensing feedback can yield quite complex behaviors and interactions between characters.

Following and Pursuit Behaviors

Using a navigation algorithm as a scriptable action, interesting animations involving multiple characters can be created. For example, simply setting the navigation goal of one character to be the sensed location of another character immediately yields following or pursuit behavior. Because motion planning is used in navigation, the character will circumvent obstacles while following the other character.

two characters following another character



SAMPLE SCRIPT:


while (TRUE) {
 if (! nearCharacter(target, 1.7))
  moveTo(target, 1.5);
 else
  stop();
}


Interactions between Characters

Increasingly complex animations can be constructed by building upon existing behaviors. For example, given the following / pursuit behavior above, it is quite simple to script several characters to play a game of tag, where one character who is "it" pursues nearby characters, while the others attempt to flee.

 

wandering and following

pursuing the user-controlled character


The examples above involve seven characters (three humans and four robots) in different scenarios.

In the example on the left, two human character follow the other human character (which is under user control), while the robots are instructed to wander and follow any human that passes nearby.

In the example on the right, all of the characters are instructed to pursue a single character under user control. Besides being applicable as a general pursuit behavior for video games, it can be used to animate a crowd following a leader (e.g. a virtual tour guide leading a group of virtual tourists).

Scripting navigation and manipulation

Given the two fundamental task commands "moveTo" (navigation) and "getObject" (manipulation), one can script high-level behaviors that involve picking up and moving objects around. For example, one could create a cleaning behavior for a virtual park employee in which the character wanders around picking up any litter it sees.

By modularizing such a "cleaning" behavior, one can integrate the behavior as a subgoal for more complex actions. For example, an autonomous waiter in a virtual cafe could roam around tables filling the patrons' cups of coffee, but if he happens to see some litter, the cleaning behavior can be invoked.



1997 - 2009 © James Kuffner, Jr.