65
EXPRESSIVE INTELLIGENCE STUDIO Lecture11 CS148/248: Interactive Narrative UC Santa Cruz School of Engineering www.soe.ucsc.edu/classes/cmps248/Spring2008 [email protected] 03 June 2008

Lecture11 CS148/248: Interactive Narrative

Embed Size (px)

DESCRIPTION

Lecture11 CS148/248: Interactive Narrative. UC Santa Cruz School of Engineering www.soe.ucsc.edu/classes/cmps248/Spring2008 [email protected] 03 June 2008. Interactive drama. Interactive drama combines autonomous characters and drama management to create first-person story-worlds - PowerPoint PPT Presentation

Citation preview

Page 1: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO

Lecture11CS148/248: Interactive Narrative

UC Santa CruzSchool of Engineeringwww.soe.ucsc.edu/classes/cmps248/[email protected] June 2008

Page 2: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Interactive drama

Interactive drama combines autonomous characters and drama management to create first-person story-worlds

Problems that have to be solved Communication with characters (natural language, gestures, …) Maintaining a story structure (causally unified chain of events

with closure) Believable characters (personality rich, emotional, lifelike

behavior)

Interactive drama requires unifying the character and story view

In this lecture we’ll talk about The overall architecture and approach of Façade The ABL programming language

Page 3: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade

Page 4: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Overview of approach

Page 5: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

How is Façade like a simulation

On a moment-by-moment basis, Façade is open-ended

You are free to move in 3D anywhere you want at any time, to pick up and use objects, to say anything you want at any time (by typing)

Grace and Trip are autonomous characters that can perform dramatic dialog in multiple ways and places, have goals, including personality and emotion behaviors

Grace and Trip are directly, immediately responsive to your dialog and actions – local agency, character Requires a large collection of behaviors to achieve interesting

local agency

Page 6: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

How does Façade have narrative structure Façade has collections of coordinated character behaviors

called story beats

The current beat supplies Grace and Trip each with a rich set of additional behaviors that combine with their already existing innate behaviors, giving them focused goals to pursue for the next ~60 seconds of the simulation

Each beat is designed to attempt to accomplish a nugget of narrative action, for example, forcing the Player to choose sides on an issue, play a psychological headgame with Player to increase tension, or reveal important information to the Player

A beat manager is responsible for deciding how to sequence the beats

Page 7: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Hybrid between simulation and narrative structure On a moment-by-moment basis, Façade

is as open-ended as a simulation

But every minute or so, the drama manager re-programs the simulation in order to give the overall experience some narrative shape Somewhat akin to levels in a more

traditional game, except a new level happens every minute or so

Page 8: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade architecture

Drama Manager

(sequences beats)

Bag of beats

beatbeat

beat

beat

beatbeat

Desired valuearc(s)

Selected beat

History

timePrevious action

beat beat beat beat

Activity not part of a beat

Currentstoryvalues

Player

Story World

TripGrace

Recognizers

Natural Language Processing

surface text

discourse acts

discourse acts

reactions

Behavior-basedagents used here

Page 9: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Natural language understanding

Page 10: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Two phases of the Façade NLU

NLU: Surface text to discourse acts

Conversation management: Discourse acts to reactions

Surface textDiscourse acts (~25)

“You two look so happy in this wedding picture”

text pattern feature

feature feature

AgreeDisagreePraiseRefer to…

Context:Affinity Game

Context:Global

Proposer Proposer Priority map

Proposer Proposer Priority map

Selector}

Page 11: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Focus on what language does: Pragmatics

““it’s not a problem”it’s not a problem”

• Syntax – produce a parse tree of the sentenceSyntax – produce a parse tree of the sentence

• Semantics – represent the formal meaning of the sentenceSemantics – represent the formal meaning of the sentence exists(x).Situation(x) ^ ~Problem(x)exists(x).Situation(x) ^ ~Problem(x)

• Pragmatics – the conversational “move” of the sentence Pragmatics – the conversational “move” of the sentence Agree(<character>)Agree(<character>)

Page 12: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example discourse acts

Representation of Discourse Acts Pragmatic Meaning of Discourse Acts

(DAAgree ?char) Agree with a character. (e.g. “certainly”, “sure thing”, “I would love to” )

(DADisagree ?char) Disagree with a character. (e.g. “No way”, “Fat chance”, “Get real”, “Not by a long shot”)

(DANegExcl ?char) A negative exclamation, potentially directed at a character. (e.g. “Damn”, “That really sucks”, “How awful”, “I can’t stomach that”)

(DAThank ?char) Thank a character (e.g. “Thanks a lot”)

(DAAlly ?char) Ally with a character. (e.g. “I like you”, “You are my friend”, “I’m here for you”)

(DAExplain ?char ?adj) Explain something simple about a character. (e.g. “You’re afraid”, “Trip is controlling”, “Grace is angry”

(DAExplainRel ?char1 ?char2 ?rel)

Explain about a relationship between characters. (e.g. “Grace doesn’t love Trip”, “Trip is cheating on Grace”)

Page 13: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Social games

Page 14: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade’s social games

Affinity game Player must take sides in character disagreements

Hot-button game Player can push character hot-buttons (e.g. sex, marriage) to

provoke responses

Therapy game Player can increase characters’ understanding of their

problems

Tension Not a game, but dramatic tension increases over time and is

influenced by player actions (e.g. pushing character hot-buttons can accelerate the tension)

Page 15: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Multiple, mixable progressions

Each social game, plus tension, forms a mixable progression

A progression consists of Units of procedural content (e.g. beats, beat

goals) A narrative sequencer that manages the

progression and responds to player interaction

Multiple progressions run simultaneously and can intermix

Page 16: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

The progressions

Beat library

Beat manager

Beat sequencing (overall story + tension)

Beat goal sequencing(affinity game)

Canonical beat goalsequence

Handlers (ABL meta-behaviors) + discourse management

Mixin library

Handlers + discourse

Global mixins (hot button game)Therapy game similar

Page 17: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Story AI: authorship and interaction

The The EnemyEnemy

Author has control but All interaction paths must be pre-coded by author Can only make very small stories Bits of story can’t be incrementally added

Page 18: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Beat manager

Page 19: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Drama management

Policy for “story piece” selection

An alternative to explicitly coded links

Story library

Selection policy

Actual sequence

Page 20: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Drama management design space

What are the story moves?

How is the desired story represented?

What is the selection policy?

When does selection happen?

Page 21: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade: Beat-based drama manager

What are the story moves? Dramatic beats

How is the desired story represented?Beats (declarative selection knowledge, procedural performance knowledge)

What is the selection policy?Maintain probability distribution over potential next beats

When does selection happen?When a beat completes or aborts

Page 22: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Dramatic beats

The beat is the smallest unit of value change Coordinated action which moves story forward

Story values – properties of characters and relationships that change over the story Examples: anger, love, trust, hate, tension

Activity without value change is not dramatic action

Page 23: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Beat example

Beat: Introduce Grace’s buried desire to be an artist Beat: Introduce Grace’s buried desire to be an artist

Precondition

story at tension level 1 andafter greeting and affinity is neutral

• Beats become architectural entitiesBeats become architectural entities

• Declarative knowledge to sequence beats

• Procedural knowledge to coordinate characters

• The unit of meaningful player interaction

Behaviors

Grace complains about her decoratingTrip insists it looks greatThey force player to take a side

Page 24: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Beat manager architecture Language

Declarative knowledge influencing beat sequencing Specify desired dramatic arc(s)

Sequencer Probabilistic agenda – draw from a changing beat distribution

Bag of beats

beatbeat

beat

beat

beatbeat

Desired valuearc(s)

Selected beat

Beat Manager

timePrevious action

beat beat beat beat

Activity not part of a beat

Currentstory

values

Recognizers History

Page 25: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Authoring content within Façade

Page 26: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

The atom of performance

Joint dialog behaviors form the atom of performance

Façade consists of ~2500 joint dialog behaviors Each 1-5 lines of dialog long (5-20 secs) System sequences these, including

transitions between Most are interruptible JDBs use ABL’s joint intension

framework to coordinate performance

Page 27: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Types / uses of joint dialog behavior Beat goals and beat mix-ins

Global mix-ins

Autonomous mix-in behaviors

Page 28: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Types / uses of joint dialog behaviors (1) Beat goals and beat mix-ins

Progression of a specific topic – “beat”e.g., arguing about Grace’s decorating;

showing off while fixing drinks

~10–100 jdb’s per beat – 66% of the 2500 total

Sequenced in response to the player’s action by the beat’s meta behaviors and reaction proposers

Page 29: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Canonical beat goal sequence

Page 30: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Beat goal behaviors Beat mix-ins

Page 31: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Types / uses of joint dialog behavior (2) Global mix-ins

Progression of a global topic category e.g., divorce, sex, the view, the wedding

picture

1 jdb each – 33% of the 2500 total Sequenced in response to the player’s

action by the global meta behaviors and reaction proposers

Page 32: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Global mix-ins

Page 33: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Types / uses of joint dialog behavior (3) Autonomous mix-in behaviors

Physical behaviors in parallel with beats and global mix-ins, with a bit of dialog

Occasionally mixes in a jdbp – 1% of 2500 total e.g., staging, fixing drinks, eightball

Page 34: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Bag of beats

27 beats total; ~15 seen in one runthrough

PBehindDoor, TGreetsP, TFetchesG, GGreetsP, ExplDatAnniv, ArtistAdvertising, ItalyTrip, FixDrinks, PhoneCall, TxnT1toT2, OneOnOneAffChrG, OneOnOneAffChrT, OneOnOneNonAffChrG, OneOnOneNonAffChrT, NonAffChrReturnsG, NonAffChrReturnsT, RomPrp, Crisis, PostCrisis, TherapyGame, RevBuildup, Revelations, EndingNoRevs, EndingSelfsOnly, EndingRelatsOnly, EndingSRNotGTR, EndingGTR

Some beats have rich internal variation Each jdbp may have 2-3 affinity X 2 tension

variations, for a total of 100+ jdbp’s in a beat Sequenced by beat manager to match

global tension arc Easy to add or take away beats

Page 35: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Collection of global mix-ins

3-tiered progressions – digging deeper ~20 global topic categories

objects: furniture, wedding pic, brass bull, view, etc.

satellites: marriage, divorce, sex, therapy, etc.

Variation 2-3 affinity X 3 tension

First half of drama Slew of generic deflects and recoveries

Page 36: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Special beats

Recap beats Crisis – halfway though drama Revelation Buildup – just before climax

Therapy Game beat Crisis -> Climax Large collection (~150) of jdbp’s, play 25 (~5

min) Direct access + custom search-based

sequencing

Page 37: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Artistry and crafting

Designing joint dialog behavior pairs Beat goals and beat mix-ins Global mix-in progressions Autonomous mix-in behaviors

All of the above must INTERMIX coherently – a real struggle to achieve

Page 38: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Artistry and crafting (part 2)

Coverage of player expression: abstraction and mappings Best short list of parameterized

discourse acts (~25) Surface text -> discourse act mapping Competing DA -> Reaction mappings

(proposers and context priority mappers)

Page 39: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Artistry and crafting (part 3)

High level beat progression 27 beats Some are special recap beats

Writing good dramatic dialog

Emotive procedural animation

Page 40: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

ABL: A Behavior Language

Page 41: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

New programming constructs for believable characters

In creating Façade, we developed programming constructs for believable characters

We created a new language to support these constructs A Behavior Language– ABL Based on the CMU Oz-project language Hap Reactive-planning: characters organized as goals and

behaviors Lessons from these constructs can be generalized beyond

ABL

A different way of thinking than imperative languages (e.g. C++, Java)

Page 42: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade character requirements

Moment-by-moment believabilityBody movements, facial expression, behavior mixing

Tightly coordinated actionCharacters work closely together to perform story

Conversational behavior Longer-term, non-linear dialog flow that preserves reactivity

Page 43: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Code support for character requirements Goals and behaviors

Sequencing + reactivity, behavior mixing, hierarchy

Joint goals and behaviorsProtocol supporting multi-character teamwork

Meta-behaviors Canonical behavior sequences are modified by player interaction

Page 44: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Façade architecture

Drama Manager(sequences

beats)Bag of beats

beatbeat

beat

beat

beatbeat

Desired valuearc(s)

Selected beat

History

timePrevious action

beat beat beat beat

Activity not part of a beat

Currentstory

values

Player

Story World

TripGrace

Recognizers

Natural Language Processing

surface text

discourse acts

discourse acts

reactions

Behavior-basedagents used here

Page 45: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

A behavior-based agent

Active Behavior TreeRoot

behavior

Goal1 Goal2

Seq.Behavior1

Par.Behavior2

Mental Act Goal3

Available for execution

Behavior libraryBehavior1

Behavior2

Behaviorn

Working memoryWME1 WME2

WMEn

SensorsSensor1

World

Page 46: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Features of our behavior-based agents Characters organized as goals and sequential & parallel behaviors

Joint (synchronized) goals and behaviors

Reflection (meta-behaviors)

Generalization of sensory-motor connections

Multiple named working memories

Atomic behaviors (useful for atomic WM updates)

Page 47: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

BehaviorsBehaviors consist of steps

Similar to the scripts or functions associated with FSM states, but Can be parallel as well as sequential Mix together as multiple behaviors are pursued

Behaviors are chosen to accomplish a goals Similar to function calls but Are dynamically chosen given current game conditions Can be re-chosen if the first choice doesn’t work out

Page 48: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example behaviors

sequential behavior AnswerTheDoor() { WME w; with success_test { w = (KnockWME) } wait; act sigh(); subgoal OpenDoor(); subgoal GreetGuest(); mental_act { deleteWME(w); }}

To answer the door:1. Wait for knock2. Sigh3. Open the door4. Greet the guest

sequential behavior OpenDoor() { precondition {

(KnockWME doorID :: door) (PosWME spriteID == door pos :: doorPos) (PosWME spriteID == me pos :: myPos) (Util.computeDistance(doorPos, myPos) > 100) }

subgoal YellAndWaitForGuestToEnter(doorID);}

If there is knock and the door is too far away,yell for guest to come in.

Page 49: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Steps Subgoal – chooses behaviors

Act – does a physical act in the world

Mental act – a bit of computation (e.g. change memory)

Wait – used with conditions to accomplish demons

All steps succeed or failBehavior finished when all steps succeed or one step fails

Behavior success and failure propagates up ABT

Page 50: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Continuously monitored conditions

Success tests – spontaneously make a step succeed if test is satisfied

Context conditions – spontaneously make a behavior fail if test is satisfied

Makes behaviors immediately reactive to changes in the world

Page 51: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Success and failure propagation

ABTRoot

behavior

Par.behavior2

Goal2Goal2

Goal3

Act2

Seq.behavior1

Mental Act1

Act2 Fail

Seq.behavior3

Seq.behavior3

Fail

Goal3

Goal2

Success TestSucceeds

MentalRemove

RemoveSeq.

behavior1

Page 52: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example: Sequential behavior + subgoaling

sequential behavior FixDrinks(Drink drink1, Drink drink2) { long prepareEndTime;

mental_act {prepareEndTime = System.currentTime() + randGen.range(3, 10);}

subgoal WalkTo(eObject_bar); with (persistent when_fails) subgoal PrepareDrinks(prepareEndTime); subgoal AnimEngine_CreateDrinks(drink1, drink2); subgoal PickupObjects(drink1, drink2); subgoal WalkTo(eObject_player); subgoal OfferObject(drink1, eObject_player);}

sequential behavior PrepareDrinks(long prepareEndTime) { int whichAnim; mental_act { whichAnim = eAnim_fixDrinks1 + randGen.range(0, 9); } act DoAnimation(whichAnim); if (System.currentTime() < prepareEndTime) fail;}

Page 53: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example: Continuous monitoring

sequential behavior FixDrinks(Drink drink1, Drink drink2) { context_condition {!(HeldObjectWME characterID == eObject_player

objectType == eObjectType_barObject)} ...}

parallel behavior PrepareDrinks(long prepareEndTime) { subgoal PrepareDrinks_seq(long prepareEndTime); with (optional) subgoal PrepareDrinks_smileWhenPlayerClose();}

sequential behavior PrepareDrinks_smileWhenPlayerClose() { with (success_test { (ObjectPositionWME objectID == player x > 50) } ) wait; subgoal SetFacialExpressionBase(eFEBase_smile); subgoal DoGaze(eObject_player);}

Page 54: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example: Low-level parallelism

parallel behavior BeatGoal_IntroduceAnniv() { with (effect_only) subgoal BeatGoal_IntroduceAnniv_staging(); subgoal BeatGoal_IntroduceAnniv_seq();}

parallel behavior BeatGoal_IntroduceAnniv_staging() { with (priority_modifier 1) subgoal WalkTo(eObject_player); subgoal KeepFacing(eObject_player);}

sequential behavior BeatGoal_IntroduceAnniv_seq() { subgoal SetFacialExpressionMood(eMood_happy, eMoodStrength_low); subgoal SetFacialExpressionBase(eFEBase_serious); subgoal DoGaze(eObject_player); subgoal DoDialog(etripScript_dialog_oh_huh_i_just_thought_of_something);

subgoal SetFacialExpressionBase(eFEBase_smile); subgoal DoGaze(eObject_grace); subgoal WaitFor(2);}

Page 55: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example: High-level behavior mixing

conflict FixDrinks BeatGoal_IntroduceAnniv_staging;

parallel behavior TheBeat() { with (priority 10) subgoal BeatGoal_FixDrinks(); with (priority 1) subgoal BeatGoal_IntroduceAnniv();}

Page 56: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Joint goals and behaviors

Characters sometimes need to coordinate actionCharacters sometimes need to coordinate action

Some approachesSome approaches• Coordinate through sensing (but plan recog. hard)Coordinate through sensing (but plan recog. hard)• Explicitly communicate (but ad hoc)Explicitly communicate (but ad hoc)• Build it into architecture (but not flexible)Build it into architecture (but not flexible)

Architecture coordinates author-specified joint actionArchitecture coordinates author-specified joint action

Page 57: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Negotiation

Agent1’s ABTRoot

behavior

Goal1Joint Goal2

Seq.Behavior1

JointBehavior2

Mental

Agent2’s ABTRoot

behavior

Goal5

Seq.Behavior5

Act

Joint Goal2

JointBehavior6

Intention to enter G2

Intention to enter G2

Page 58: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Conflicting intentions

Agent1’s ABT Agent2’s ABT Agent3’s ABTRoot

behavior

Goal1

Joint Goal2

Succeeds

Rootbehavi

or

Goal3

Seq.Behavior1

Joint Goal2

JointBehavior2

ActFails

Rootbehavi

or

Goal4

Seq.Behavior3

Joint Goal2

JointBehavior4

Act

Suspends

Resolution: intentions are precedence orderedResolution: intentions are precedence ordered

Mental

Goal5

Problem: Problem: asynchronousasynchronous agents enter conflicting states agents enter conflicting states

Page 59: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Inconsistent subtree execution

ABTRoot

behavior

JointGoal1

G2

Seq.Behavior1

JointBehavior2

Joint Goal2

Act

Succeeds

Resolution: freeze subtreeResolution: freeze subtree• Initiate exit intention at the subtree root• Remove all leaf steps• Deactivate all monitored conditions• Negotiate removal of all joint goals• Commit to exit intention at subtree root

Problem: Problem: continuingcontinuing execution execution leads to ABT inconsistenciesleads to ABT inconsistencies

Page 60: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Variably coupled agents

Agent1’s ABT

Seq.Behavior1

Rootbehavi

or

Goal1Joint Goal2

JointBehavior2

Act

Agent2’s ABTRoot

behavior

Goal3Joint Goal2

JointBehavior4

Mental

Seq.Behavior3

Effects propagate across ABTs

Mental

Goal4

Effects propagate

within ABTs

A tunable spectrum between one-mind and many-mindsA tunable spectrum between one-mind and many-minds

Page 61: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Example: Coordinating dialog

conflict BeatGoals_Intro BeatGoals_Question;

parallel behavior TheBeat() { with (priority 20) subgoal BeatGoal_FixDrinks(); with (priority 2, persistent when_fails) subgoal BeatGoals_Intro(); with (priority 1, persistent when_fails) subgoal BeatGoals_Question();}

sequential behavior BeatGoals_Intro() { joint subgoal BeatGoal_IntroduceAnniv_line1(); joint subgoal BeatGoal_IntroduceAnniv_line2();}

The leader has these behaviors

Grace and Trip each define their version of _line1 and _line2joint parallel behavior BeatGoal_IntroduceAnniv_line1() { teammembers Trip Grace; ...}

Page 62: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Meta-behaviors

Meta-behaviors manipulate the runtime state of other behaviors (e.g. succeed or fail steps).

Ability to match on this runtime state just like it was part of the world (preconditions, context conditions, success tests)

Page 63: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Conversation = joint behaviors + handlers

sequential behavior handlerDA_DoReaction() { precondition { (ReactionWME type == eDAType_Disagreement)

theBeat = (ParallelBehaviorWME signature == "TheBeat()") }

subgoal AbortBeatGoalAndSuspendTheBeat(); with (priority 10, persistent when_fails) spawngoal BeatGoal_DisagreementReaction() at theBeat; subgoal UnsuspendTheBeat();}

sequential behavior BeatGoal_DisagreementReaction() { joint subgoal BeatGoal_DisagreementReaction_line1(); joint subgoal BeatGoal_DisagreementReaction_line2();}

Page 64: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

Interaction = (Joint) behaviors + handlers Difficult to specify responsive sequential activity

Implicitly encode in ABT – conditions get complicated fast!

Flat behaviors with declarative state – redundant and error prone

Instead: Joint behaviors + handlers (meta-behaviors) Explicitly encode sequential activity in ABT Modify future activity through dynamic ABT

modification

Page 65: Lecture11 CS148/248: Interactive Narrative

EXPRESSIVE INTELLIGENCE STUDIO UC SANTA CRUZ

ABL Conclusions

Behavioral coding vs. FSMs Behaviors support mixing (can be in more than

one “state” at once) Behavior hierarchy more expressive than flat

FSMs Dynamic coupling between goals and

behaviors

Behavioral coding vs. rules Behaviors support sequential activity Behaviors support hierarchy