agents and avatars 2 - heriot-watt university

52
Agents and Avatars 2 Ruth Aylett

Upload: others

Post on 19-Dec-2021

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Agents and Avatars 2 - Heriot-Watt University

Agents and Avatars 2

Ruth Aylett

Page 2: Agents and Avatars 2 - Heriot-Watt University

Overview-

Crowds Speech and Expressive behaviour

– Embodied conversational characters

Creating autonomy– Scripting– Architectures

Page 3: Agents and Avatars 2 - Heriot-Watt University

Crowds and flocking

Interactions amongmembers of a group– Local neighborhood

Reynolds Boids– Originally birds or

fish– Complex behaviour

determined bysimple rules

Page 4: Agents and Avatars 2 - Heriot-Watt University

Separation: BoidAvoidance

Page 5: Agents and Avatars 2 - Heriot-Watt University

Alignment

Page 6: Agents and Avatars 2 - Heriot-Watt University

Cohesion

Page 7: Agents and Avatars 2 - Heriot-Watt University

Motor Control

Steering Force Integrate to determine acceleration

– Thrust – determines speed– Lateral Steering Force – determines direction

Page 8: Agents and Avatars 2 - Heriot-Watt University

Boid Object Representation

Point Mass Vehicle– Mass– Position– Velocity– Orientation

• Constrained to align with velocity– Force and Speed Limits

(No moment of inertia)

Page 9: Agents and Avatars 2 - Heriot-Watt University

Same maths as point objects

acceleration = steering_force / mass– Given f = mavelocity = velocity + acceleration– Over a unit time period– Generically v = v x atposition = position + velocity– Over a unit time period– Generically s = s + vt

Page 10: Agents and Avatars 2 - Heriot-Watt University

Seeking and Fleeing Aim towards target

Desired_velocity = Kp (position – target)Steering = desired_velocity – velocity

Seeking andFleeing Applet(Reynolds)

Page 11: Agents and Avatars 2 - Heriot-Watt University

Pursuing and Avoiding

Target is another moving object Predict target’s future position Scale prediction time, T, based on distance to object, Dc

T=Dc

Pursuing andavoiding applet(Reynolds)

Page 12: Agents and Avatars 2 - Heriot-Watt University

More Behaviors

Evasion– Like flee, but predict pursuer’s movement

Arrival– Like seek, but stop at target– Applet (Reynolds)

Obstacle Avoidance– Repulsive force– Aim to boundary– Adjust velocity to be perpendicular to surface normal

Page 13: Agents and Avatars 2 - Heriot-Watt University

Do People Flock?

Social psychologist’sreport that peopletend to travel assingles or in groupsof size 2 to 5.

“Controlling Steering Behavior for Small Groups ofPedestrians in Virtual Urban Environments”

Terry Hostetler, Phd dissertation, 2002

Page 14: Agents and Avatars 2 - Heriot-Watt University

Characteristics of Small Groups

Proximity Coupled Behavior Common Purpose Relationship Between

Members

Page 15: Agents and Avatars 2 - Heriot-Watt University

Moving Formations

Pairs: Side by side Triples: Triangular shape

Page 16: Agents and Avatars 2 - Heriot-Watt University

Stationary Formations

Moving pair approachesstationary triple

Stationary quintupleformed

Page 17: Agents and Avatars 2 - Heriot-Watt University

Two Parameters - because in 2D– Acceleration

• Increase/reduce walking speed• Combination of step length and step rate

– Turn• Adjust orientation• Heading direction for forward walking

Locomotion Model for Walking

Page 18: Agents and Avatars 2 - Heriot-Watt University

Avoiding an Obstacle --Trajectory

Small look-ahead distance Large look-ahead distance

ped 1

ped 2

walkway axis walkway axis

ped 1

ped 2

Page 19: Agents and Avatars 2 - Heriot-Watt University

Interaction Between Pairs -- 1

Page 20: Agents and Avatars 2 - Heriot-Watt University

Interaction Between Pairs -- 2

Page 21: Agents and Avatars 2 - Heriot-Watt University

Interaction Between Pairs -- 3

Page 22: Agents and Avatars 2 - Heriot-Watt University

Adding goals

People are usually going somewhere– Easy case: same goal

• Walking to a sports stadium• Political demonstrations

– Harder case: multiple goals• Campus traffic• Most public spaces: streets, shops, stations

Page 23: Agents and Avatars 2 - Heriot-Watt University

Talking Heads

Human faces– Thus high expectations:

• Blinking, random head movement• Facial muscles• Lip sync

Rarely intelligent– Entirely scripted in most cases– No integration of speech production with

intelligent architecture and NL generation

Page 24: Agents and Avatars 2 - Heriot-Watt University

Moving the face - 1

Simple approach– Define overlay frames with different facial

expressions• For example, six mouth shapes

– Use signal from TTS engine to pick amouth shape

– This works OK with cartoon-like characters

Page 25: Agents and Avatars 2 - Heriot-Watt University

Moving the face - 2

Visemes– Mouth and lip position

for each phoneme– Correspond to a

submesh in thegeometry

Page 26: Agents and Avatars 2 - Heriot-Watt University

Using visemes

Find viseme for each phoneme– Synchronise graphical change with sound

Page 27: Agents and Avatars 2 - Heriot-Watt University

Catalan weather forecaster

Complete talking character– Weather forecasts have predictable content– Still have to match content and behaviour

• <demo via browser>

Page 28: Agents and Avatars 2 - Heriot-Watt University

Embodied conversational characters

Beyond talking heads– Key difference is interactivity– Use of dialogue theory– Focus on body language - expressive

behaviour

Relating graphical to languagebehaviour

Page 29: Agents and Avatars 2 - Heriot-Watt University

Expressive facial behaviour

Drawing on psychology:– FACS (Facial Action Coding System)– Developed by Ekman & Friesen (1978)– Distinguishes among 44 Action Units– Each action unit (AU) describes a separate,

visible, and muscle-based facial change

Page 30: Agents and Avatars 2 - Heriot-Watt University

Duchenne de Bologne

French anatomist of19thC– In 1860s used

electric currents onfacially paralysedsubject

– Showed whichmuscles go withwhich expressions

Page 31: Agents and Avatars 2 - Heriot-Watt University

The Duchenne smile

Associated withexpression ofhappiness

AU12 (Lip Corner Puller)

Plus

AU6 (Cheek Raiser)

Page 32: Agents and Avatars 2 - Heriot-Watt University

Mapping onto mpeg-4

Defines FAPs– Facial action

parameters– Set of feature points– Model calibration– Morphology

parameters– Expression

parameters

Page 33: Agents and Avatars 2 - Heriot-Watt University

Coordinating with language Use of Affective Performance Markup Language (APML)<performative type="inform"><theme> As far as <emphasis x-

pitchaccent="LplusHstar"> vitamins </emphasis> are concerned<boundary type="LH"/></theme></performative><rheme><emphasis x-pitchaccent="Hstar"> research </emphasis>

has shown <boundary type="LH"/></rheme> <performativetype="inform"> <rheme>that eating<emphasis x-pitchaccent="Hstar">the recommended </emphasis>levels of vitamin

<rheme affect="sorry-for">can have <emphasis x pitchaccent="Hstar">beneficial </emphasis><emphasis x-pitchaccent="Hstar">effects</emphasis>for your <emphasis x-pitchaccent="Hstar">appearance</emphasis> <boundary type="LH"/> and <emphasis x-pitchaccent="Hstar"> health</emphasis><boundary type="LL"/>

</rheme></performative>

Page 34: Agents and Avatars 2 - Heriot-Watt University

Incorporating gesture

Additional markup to control gestures insynch with other expressive behaviour

Page 35: Agents and Avatars 2 - Heriot-Watt University

Generating expressivebehaviour

Setting the internal state to be expressed Low-level accounts

– Focus on behaviour (non-symbolic)– Primitive emotions– Brain limbic system: physiological integration– Canamero, Velasquez, Damasio

High-level accounts– Focus on cognitive appraisal– Complex taxonomy of emotions– Cortex: cognitive integration– Ortony, Clore and Collins; many applications– Frijda; Lazarus; Sherer

Page 36: Agents and Avatars 2 - Heriot-Watt University

Modelling emotion Appraisals

– Assessments of events, actions, objects

Valence– Whether emotion is positive or negative

Arousal– Degree of physiological response

Implementing appraisals– Domain-specific rules– Probability of impact on agent’s goals

Page 37: Agents and Avatars 2 - Heriot-Watt University

Emotion theoryOrtony, Clore and Collins (OCC)

Extremely widely used for agents– Ortony, A; Clore, G. & Collins, A. 1988 The cognitive

structure of emotions. Cambridge University Press–

Group TypesWell-being joy, distressFortunes-of-others happy-for, gloating, resentment, sorry-forProspect-based hope, satisfaction, relief, fear, fears-confirmed, disappointmentAttribution pride, admiration, shame, reproachAttraction love, hateWell-being ! Attribution admiration + joy " gratitude(compound emotions) Reproach + distress " anger

Pride +joy " gratificationShame +distress " remorse

Page 38: Agents and Avatars 2 - Heriot-Watt University

OCC Model - more detail

Group Specification Name & typeWellBeing

Appraisal ofsituation as event

Joy - pleased about eventDistress - displeased aboutevent

FortunesofOthers

Appraisal ofsituation as eventaffecting another

Happy-for: pleased about anevent desirable for anotherResentment: displeased aboutan event desirable for another

Prospect-based

Appraisal ofsituation as aprospective event

Hope: pleased about aprospective desirable eventFear: displeased about aprospective undesirable event

Emotions defined in terms ofsituations, goals, and others

Page 39: Agents and Avatars 2 - Heriot-Watt University

Autonomy

An independent sense-reflect-act cycle: implies– An agent-based action-selection mechanism– Self-animation in real-time: cannot be pre-rendered– Local sensing– Virtual robotics

Not a natural graphics view– Global manipulation of polygons– Hierarchical scene-graph

Page 40: Agents and Avatars 2 - Heriot-Watt University

Scripting

Typical of NPCs in computer games What representational content is

needed?– Can just invoke named animations– What parameters?

• Depends on animation approach

Page 41: Agents and Avatars 2 - Heriot-Watt University

Parametrised ActionRepresentation

Badler: symbolic term -> movement Supports natural language interaction

– Named actions: walk, jump, run– Adverb modification: quickly, tiredly,

enthusiastically Laban Movement Analysis

– From choreography– Effort and shape components to

characterise movements

Page 42: Agents and Avatars 2 - Heriot-Watt University

Badler’s PARs

Page 43: Agents and Avatars 2 - Heriot-Watt University

Scripting with Finite State Automata

TennisgameFSMsequence

Page 44: Agents and Avatars 2 - Heriot-Watt University

Limitations of scripting

Becomes predictable– Either independent of local sensing– Or single FSM transition stimulus

Limited ability to use internal state– Interaction memory– Affective state

Lacks sequencing flexibility– Sequence is hardwired

Page 45: Agents and Avatars 2 - Heriot-Watt University

Low-level architecture for a fish…

Functional Architecture

Page 46: Agents and Avatars 2 - Heriot-Watt University

High-level architecture

Page 47: Agents and Avatars 2 - Heriot-Watt University

Using game engines

Offer some support for NPCs– More facilities than a scenegraph– Attaching animations to graphical bodies– Imports from popular 3D packages like character studio

Disadvantages– Proprietary; oriented to scripting– Hard (in some cases impossible) to implement sensing

• Fixed paths quite often– Often focused on shooting

Page 48: Agents and Avatars 2 - Heriot-Watt University

Gamebots

Loosely coupled architecture based onUnreal Tournament– CMU– Agent ‘mind’ outside of UT– Defined interface: message types and

content– Javabots gives java interface

Page 49: Agents and Avatars 2 - Heriot-Watt University

The mechanism Gamebots and TCP sockets

– Every robot possesses one TCP socket– Exchange data through the TCP socket– Unreal Client(s) can connect to the server at anytime

UnrealServer

(response to the command;

send out sensor data)

Gamebots

Robot Controller

Unreal Client(s)

Command

Sensor data

Command

Sensor data

Robot ControllerCommand

Sensor data

Command

Sensor data

………… TCP Socket

Virtual robot

Page 50: Agents and Avatars 2 - Heriot-Watt University

Communication protocol Gamebots protocol

– Format: data_type {segment1} {segment2} …• data_type: the type of the data in upper case

characters– Examples: INIT, STA, SEN, DRIVE etc.

• segment: a list of name-value pairs separated by space– Examples: {Location 100,200,300}, {Name Left Range

800.0} etc.

– Example• INIT {ClassName USARBot.ATRVJr} {Location 200,600,-450}

– Two types of data• Message (from the server)• Command (from the client)

Page 51: Agents and Avatars 2 - Heriot-Watt University

Communication protocol - 2 Messages

– State message: the robot’s current state• STA {Time t} {Camera pitch,yaw,roll} {Zoom fov} {Attitude

pitch,yaw,roll} {Location x,y,z} {Velocity x,y,z} {LightToggle bool}{LightIntensity int} {Battery float}

– Sensor message: the sensor data• Sonar Sensor SEN {Type Range} {Name string Range number}

{Name string Range number} …• Laser Sensor SEN {Type RangeScanner} {Name string} {Location

x,y,z Rotation pitch,yaw,roll} {Range r1,r2,r3…}• Human Motion Detection SEN {Type HumanMotion} {Name string}

{Prob float}• Sound Sensor SEN {Type Sound} {Name string} {Loudness float}

{Duration float}– Geometry message: sensor’s geometry information

• GEO {Type string} {Name string Position x,y,z Direction pitch,yaw,roll} {Namestring Position x,y,z Direction pitch,yaw,roll} …

– Configuration message: sensor’s configuration information• CONF {Type string} {Name Value} {Name Value} …

Page 52: Agents and Avatars 2 - Heriot-Watt University

Communication protocol - 3

Command– Spawn robot

• INIT {ClassName robot_class} {Name robot_name} {Locationx,y,z}

– robot_class: the class name of the robot. Example:USARBot.P2AT, USARBot.P2DX etc.

– robot_name: the robot’s name. Can be any string.– x,y,z: the start position of the robot. For different arenas, we

need different positions.• Example

– INIT {ClassName USARBot.P2AT} {Location 312,-600,-305}