Top Banner
gamedesigninitiative at cornell university the Character AI: Sensing & Perception Lecture 21
62

Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

May 05, 2018

Download

Documents

trandan
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Character AI:Sensing & Perception

Lecture 21

Page 2: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Take Away for Today

� Sensing as the primary bottleneck� Why is sensing so problematic?� What types of things can we do to improve it?

� Optimized sense computation� Can we improve sense computation performance?� Can we share sensing between NPCs?

� Sense event matching� What are events and how are they represented?� What is the advantage of an event system?

Sensing & Perception2

Page 3: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Sense: � Perceive the world� Reading the game state� Example: enemy near?

� Think: � Choose an action � Often merged with sense� Example: fight or flee

� Act: � Update the state� Simple and fast� Example: reduce health

Sensing & Perception3

Review: Sense-Think-Act

?

Page 4: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Sensing may be slow!� Consider all objects

� Example: morale� n knights, n skeletons� Knights fear skeletons� Proportional to # seen

� Count skeletons in view� O(n) to count skeletons� O(n2) for all units

Recall: Sensing Performance

Time per tick

3 units

2 units

1 unit

Sensing & Perception4

Page 5: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Sensing may be slow!� Consider all objects

� Example: morale� n knights, n skeletons� Knights fear skeletons� Proportional to # seen

� Count skeletons in view� O(n) to count skeletons� O(n2) for all units

Recall: Sensing Performance

Time per tick

3 units

2 units

1 unit

Sensing & Perception5

Page 6: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Idea taken from databases� Unordered set of information� Combine into single value� Used in statistical analysis� Examples: sum, avg, mode

� Decomposable Aggregates� Split the set up into subsets� Aggregate on each subset� Combine values from subsets� Only for some aggregates

6

10

5

7

9

7

3

9

Sensing & Perception6

Aggregation

Page 7: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Idea taken from databases� Unordered set of information� Combine into single value� Used in statistical analysis� Examples: sum, avg, mode

� Decomposable Aggregates� Split the set up into subsets� Aggregate on each subset� Combine values from subsets� Only for some aggregates

6

10

5

7

9

7

3

9

Sensing & Perception7

Aggregation

avg = 8(16,2)

avg = 6(12,2)

avg = 8(16,2)

avg = 6(12,2)

Page 8: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Idea taken from databases� Unordered set of information� Combine into single value� Used in statistical analysis� Examples: sum, avg, mode

� Decomposable Aggregates� Split the set up into subsets� Aggregate on each subset� Combine values from subsets� Only for some aggregates

6

10

5

7

9

7

3

9

Sensing & Perception8

Aggregation

avg = 8(16,2)

avg = 6(12,2)

avg = 8(16,2)

avg = 6(12,2)

avg = 7(28,4)

avg = 7(28,4)

Page 9: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Idea taken from databases� Unordered set of information� Combine into single value� Used in statistical analysis� Examples: sum, avg, mode

� Decomposable Aggregates� Split the set up into subsets� Aggregate on each subset� Combine values from subsets� Only for some aggregates

6

10

5

7

9

7

3

9

Sensing & Perception9

Aggregation

avg = 8(16,2)

avg = 6(12,2)

avg = 8(16,2)

avg = 6(12,2)

avg = 7(28,4)

avg = 7(28,4)

avg = 7(56,8)

Page 10: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Idea taken from databases� Unordered set of information� Combine into single value� Used in statistical analysis� Examples: sum, avg, mode

� Decomposable Aggregates� Split the set up into subsets� Aggregate on each subset� Combine values from subsets� Only for some aggregates

6

10

5

7

9

7

3

9

Sensing & Perception10

Aggregation

avg = 8(16,2)

avg = 6(12,2)

avg = 8(16,2)

avg = 6(12,2)

avg = 7(28,4)

avg = 7(28,4)

avg = 7(56,8)

Page 11: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Proximityto Base

Slide courtesy of Dave Mark

Sensing & Perception11

Page 12: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

Proximityto Base

Slide courtesy of Dave Mark

Sensing & Perception12

Page 13: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

Threat Ratio

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

Proximityto Base

Slide courtesy of Dave Mark

Sensing & Perception13

Page 14: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

Threat Ratio

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

Proximityto Base

Urgency

Slide courtesy of Dave Mark

Sensing & Perception14

Page 15: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

Threat Ratio

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

My Morale

Proximityto Base

Urgency

Slide courtesy of Dave Mark

Sensing & Perception15

Page 16: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

Threat Ratio

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

My Morale

Retreat %

Proximityto Base

Urgency

Slide courtesy of Dave Mark

Sensing & Perception16

Page 17: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

AI and Aggregation Trees

Numberof Allies

Numberof Enemies

Threat Ratio

My HealthProximityto Leader

Strengthof Allies

Strengthof Enemies

Allied Strength Enemy Strength

My Morale

Retreat %

Proximityto BaseUrgency

Slide courtesy of Dave Mark

Computable independentof the NPC

Sensing & Perception17

Page 18: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� “Invisible NPC”� Assigned to NPC Group� Performs all thinking� NPCs just follow orders

� Applications� Protecting special units� Flanking� Covering fire� Leapfrogging advance

Thinking and Acting18

Related Approach: Tactical Managers

NPC NPC NPC NPC

TacticalManager

Page 19: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting19

Protecting Special Units

Slide courtesy of Dave Mark

Page 20: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting20

Protecting Special Units

Slide courtesy of Dave Mark

Page 21: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting21

Protecting Special Units

Slide courtesy of Dave Mark

Page 22: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting22

Protecting Special Units

Slide courtesy of Dave Mark

Page 23: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting23

Protecting Special Units

Slide courtesy of Dave Mark

Page 24: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting24

Protecting Special Units

Slide courtesy of Dave Mark

Page 25: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting25

Protecting Special Units

Slide courtesy of Dave Mark

Page 26: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting26

Protecting Special Units

Slide courtesy of Dave Mark

Page 27: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting27

Protecting Special Units

Slide courtesy of Dave Mark

Page 28: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Normal Sensing

� Loop over all NPCs

� Check what NPC senses

Sensing & Perception28

Performance: Loop Inversion

Inverted Sensing

� Loop over sensations

� Send these to each NPC

NPCLoop

SenseLoop

sound1

sound2

sight1

sight1

Page 29: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Normal Sensing

� Loop over all NPCs

� Check what NPC senses

Sensing & Perception29

Performance: Loop Inversion

Inverted Sensing

� Loop over sensations

� Send these to each NPC

NPCLoop

SenseLoop

sound1

sound2

sight1

sight1

Page 30: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Event: encoded sense data� Tagged with sense type � Information self-contained� O(n) data is aggregated� O(1) to combine w/ NPC

� Sensing is event matching� Each event has a type� NPCs “register” for a type� Send NPC registered events� Check if event is relevant

Sensing & Perception30

Sense Events

Pre-aggregated

Page 31: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception31

Sense Event Matching

Event Handler

Register eventsof interest

Gam

e Loop

sound

sightsound

soundsmell

Page 32: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception32

Sense Event Matching

Event Handler

Notify of anymatching events

Check for anymatching events

Gam

e Loop

Page 33: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

MessageDispatcher

� Send with dispatchMessage� delay (0 if immediate)� sender (can be null)� target (null for subscribers)� type (user defined int code)� data (object, like Box2D)

� Subscribe with addListener� NPC to receive message� Type (int) to subscribe to

Sensing & Perception33

Event Handling in LibGDX

Telegram

� Stores the event message� Entries of dispatchMessage� Except for the delay value� Preaggregated sense in data

� Received by Telegraph � Interface for the receiver� Implemented by the NPC� One method: handleMessage

Page 34: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

MessageDispatcher

� Send with dispatchMessage� delay (0 if immediate)� sender (can be null)� target (null for subscribers)� type (user defined int code)� data (object, like Box2D)

� Subscribe with addListener� NPC to receive message� Type (int) to subscribe to

Sensing & Perception34

Event Handling in LibGDX

Telegram

� Stores the event message� Entries of dispatchMessage� Except for the delay value� Preaggregated sense in data

� Received by Telegraph � Interface for the receiver� Implemented by the NPC� One method: handleMessage

Page 35: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting35

Recall: S-T-A Architecture

Actor1

GameState

Actor1Controller

Actor2

Actor2Controller

ComputeSensing

Page 36: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting36

Recall: S-T-A Architecture

Actor1

GameState

Actor1Controller

Actor2

Actor2Controller

ComputeSensing

Page 37: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Thinking and Acting37

Recall: S-T-A Architecture

Actor1

GameState

Actor1Controller

Actor2

Actor2Controller

ComputeThinking

Page 38: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing: Perception Groups

� Vision: limited field of view� Gives exact object location, information � Limited by obstacles and range� Little information (motion) at periphery

� Sound: omni-directional� Gives direction & distances� Requires you track the “sounds” actions make

� Smell: omni-directional� No direction or distance; proximity only� Requires you track the “smells” actions make

Sensing & Perception38

Page 39: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Case Study: Thief Series

Sensing & Perception39

Page 40: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

40 Sensing & Perception

Page 41: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception41

Line-of-Sight in Thief

FocusedView

Long Distance

Short DistancePeripheral

Vision

Page 42: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception42

Line-of-Sight in Thief

FocusedView

Long Distance

Short DistancePeripheral

Vision

MotionDetection

Page 43: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� “Easier” than vision� Primarily distance-based� Decays probabilistically� Tag with level of interest

� Sounds can be blocked� Not same as line-of-sight� Use alternate level map� Or tag your visible map

� Not physically realistic� Echoes? Reflections

Sensing & Perception43

Sounds in Thief

Page 44: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� “Easier” than vision� Primarily distance-based� Decays probabilistically� Tag with level of interest

� Sounds can be blocked� Not same as line-of-sight� Use alternate level map� Or tag your visible map

� Not physically realistic� Echoes? Reflections

Sensing & Perception44

Sounds in Thief

Page 45: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Sounds are general purpose� Resuable framework� Code is lightweight� Encodes other senses

� Example: Smell� Treated as “pseudo-sound”� Generate like any sound

� Again, ignores other factors� Wind direction� Masking smells

Sensing & Perception45

Sounds in Thief

* sniff *

* sniff *

Page 46: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Lightweight

Sensing & Perception46

Custom Data in Events

Heavyweight

Memory

Target

ThiefExposed

Memory

Target

ThiefExposed

Reference to target

Copy oftarget

Page 47: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Lightweight

� Advantages� Fast to create event� No additional memory

� Disadvantages� Must be used immediately� Lost over frame boundary

� Ideal for fast decisions

Sensing & Perception47

Custom Data in Events

Heavyweight

� Advantages� Can persist past frame� Can retain as memory

� Disadvantages� Must allocate memory� Object ownership is tricky

� Ideal for communication

Page 48: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception48

Communicating Senses

Page 49: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception49

Communicating Senses

First HandLOS

Sight & Sound

Page 50: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception50

Communicating Senses

First HandLOS

Sight & Sound

First HandLOS

Sight & Sound

Page 51: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception51

Communicating Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

Page 52: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception52

Communicating Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

?

Page 53: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception53

Alertness: Active Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

High Alert

Page 54: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception54

Alertness: Active Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

High AlertMedium Alert

Page 55: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception55

Alertness: Active Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

High AlertMedium Alert

High Alert

First HandSound

Page 56: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception56

Alertness: Active Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

High AlertMedium Alert

High Alert

Page 57: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Sensing & Perception57

Alertness: Active Senses

First HandLOS

Sight & SoundSecond Hand

Sight & Sound

First HandLOS

Sight & Sound

High AlertMedium Alert

High Alert

First HandSound

Page 58: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Restrict to nearby NPCs� Have detection range

� Limits events sensed

� Easy to combine with event matching system

� Works in both directions � Nimbus: “can see” radius

� Aura: “can be seen” radius

� Area of interest management

Sensing & Perception58

Spatial Optimizations

Page 59: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Restrict to nearby NPCs� Have detection range

� Limits events sensed

� Easy to combine with event matching system

� Works in both directions � Nimbus: “can see” radius

� Aura: “can be seen” radius

� Area of interest management

Sensing & Perception59

Spatial Optimizations

Page 60: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

� Restrict to nearby NPCs� Have detection range

� Limits events sensed

� Easy to combine with event matching system

� Works in both directions � Nimbus: “can see” radius

� Aura: “can be seen” radius

� Area of interest management

Sensing & Perception60

Spatial Optimizations

Page 61: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Lighting Movement Exposure

Visibility

Viewcone

Sound System

Sound Queue

Non-specific Spatial Events

ListenLook

Sense PulseReceiver

Ramp UpDelay

Cool-downCapacitor

Inter-AgentCommunication

Inter-AgentObservation

ViewconeSelector

Position

Game Mechanics and Configuration

Sense Links61

Thief: Sense Events and Aggregation

Page 62: Lecture 21 - Cornell University€¦ · of the NPC 17 Sensing & Perception. gamedesigninitiative at cornell university the

gamedesigninitiativeat cornell university

the

Summary

� Sensing is the most expensive part of AI� Each character “looks” at every object in game� Often leads to O(n2) behavior (bad!)

� Can optimize sense gathering� Aggregation is amenable to parallelization� Can piggyback some data onto pathfinding

� Event matching inverts the sensing problem� Creation of sense makes a data event� Forward event to “relevant” NPCs

Sensing & Perception62