45
The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Embed Size (px)

Citation preview

Page 1: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

The Two Faces of Video Game AI

Damian IslaAI Lead, Bungie Studios

Page 2: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 3: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Halo 3

• First person shooter• Epic Story• Epic Combat• Vehicles• Physics• Cooperative and Competitive Multiplayer• Saved Films• User-edited Levels

• Player-equivalent AI– in terms of abilities, not in terms of tactics!

Page 4: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 5: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 6: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 7: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

The Two Faces of AI

• One outwards, towards the player• One inwards, toward the content creators• Two interfaces with completely different, at

times contradictory functions

This talk• General properties of these two interfaces• Two examples– Behavior selection– Combat dialogue

• Conclusions

Page 8: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Terminology

Game AI must be:

• Coherent• Transparent – for the player– for the

designer

• Workable

Page 9: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Player Interface

Page 10: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

The Illusion of Intelligence

AI seems smart, focused, lifelike– timing seems right– decisions seem reasonable– attends to the things that demand attending

to– In Halo: the AI is a worthy opponent

How do we sell the illusion of life and intelligence?

Page 11: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 12: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

The Fun: Transparent Decision-making

• Player can explain AI behavior– “He dove out of the way because I threw the grenade.”

• Player can predict AI behavior– “If I throw the grenade, I bet the AI will dive out of the

way.”

• Player forms an ongoing narrative in his/her head– “I threw the grenade, so he dove out of the way, and

then cursed at me, and threw a grenade back, but I shot it in the air and hurt him, so he went nuts and charged me …”

• The AI needs to facilitate / encourage that narrative

Page 13: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Designer Interface

Page 14: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Transparent Decision-making

• Designer can explain AI behavior– “He dove out of the way because his danger_dive

behavior is active.”• Designer can predict certain AI behavior

– “When I throw this grenade, there’s a 75% chance he’ll dive out of the way”

• Designer knows how to get different behavior– “Hmm … he reacted to that grenade too quickly

… I think I’ll increase his projectile-acknowledgement delay from 0.5 to 0.7 seconds.”

• Designer knows how to diagnose and fix MISbehavior– “WOAH … why the hell did he do THAT?!”

Page 15: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Scale

The Enemy of all Transparency

x 1,000

“I want X to do Y when Z”

Page 16: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Scale

The Enemy of all Transparency

The greater the variety of unique situations we need to handle well, the more complex the internal structure needed to disambiguate them, and the less expressible that internal structure is.

(We might also call that “competence”.)

Page 17: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Transparency vs. Competence

Page 18: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Case Study 1: Behavior Selection

Page 19: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Hide?Panic?Get in that vehicle?Throw a grenade?Hold my ground?

Page 20: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior

A program that takes temporary control of an actor to achieve a specific goal.

• Fight• Hide• Enter vehicle• Throw grenade• etc.

How do I decide what to do when?

~120 of these in total

(i.e. ~ 7140 possible

transitions)

Page 21: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior FSM

Page 22: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior FSM

???

Page 23: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior Tree

melee

shoot

grenade

uncover

pursue

sleep

fight

search

hide

idle

root

cover

root

fight

shoot

Page 24: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior Tree

Three Simplifications:1.No sibling connections2.Prioritized-list decision-

scheme3.Binary relevance functions

Benefits:• No more n2 complexity• Scalability

Page 25: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Behavior Tree: Designer Tools

1. Behavior Parameters

2. Masks

bool hide_relevance() {

if (damage > MAX_DAMAGE) {

return true;}else {

return false;}

}

Page 26: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 27: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Players and Trees

Players understands TRIGGERS, not TRANSITIONS– i.e. when the brute’s armor depletes, he charges,

no matter WHAT he was doing at the time

Players understand priorities

Players understand discrete events

Players understand task-decomposition

The Tree is representative of the mapping we HOPE exists in the player’s head

Page 28: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Lessons from Halo 2 and Halo 3

• Figuring out why something happened is easy

• Figuring out why something DIDN’T happen is still fiendishly hard

Page 29: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Case Study 2: Combat Dialogue

Page 30: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Oh no, they killed

my friend!

Well done, friend!

Well done, Master Chief!

Ha! They killed

their own guy!

You idiot! You killed our own

guy!

Oh no, I killed my own guy!

I’m sorry!!!

Damn you,

Master Chief!

Aaargh!!!

Page 31: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Combat Dialogue

<A> kills <B> “Event”“Oh no, they killed our friend!”

“Vocalization”

Match ~100 events ~320 vocalizations(and find a speaker)

Page 32: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Combat Dialogue

Implementation: a rule-matching systemEvent: “Player killed a grunt”

killed(a,b)prs_plr_

killenemies(a, b),

player(a)friend(a)

event vocalization

relevance conditions

speaker condition

s

0.8

Page 33: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Combat Dialogue

killed(a,b)prs_plr_

killenemies(a, b),

player(a)friend(a) 0.8

Probabilistically choose among top contenders

killed(a,b)prs_ally

_killenemies(a, b) friend(a) 0.5

killed(a,b)crs_plr_

killenemies(a, b),

player(a)enemy(a

)0.5

killed(a,b)crs_plr_

btryfriends(a, b),

player(a)friend(a) 0.0

Implementation: a rule-matching systemEvent: “Player killed a grunt”

Page 34: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Combat Dialogue

killed(a,b)prs_plr_

killenemies(a, b),

player(a)friend(a) 0.8

Probabilistically choose among top contenders

killed(a,b)prs_ally

_killenemies(a, b) friend(a) 0.5

killed(a,b)crs_plr_

killenemies(a, b),

player(a)enemy(a

)0.5

killed(a,b)crs_plr_

btryfriends(a, b),

player(a)friend(a) 0.0

Implementation: a rule-matching systemEvent: “Player killed a grunt”

Page 35: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 36: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 37: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios
Page 38: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Lessons from Halo 1, 2 and 3

• Player is an egomaniac– Brute: “He’s gone into cover!”– Player: “uh … no I haven’t.”

• AIs need to speak consistently with each other– Marine1: “I see him!”– Marine 2: “I don’t see him!”

• Combat dialogue serves fundamentally different functions for enemies and allies– Allies are about aural backdrop– Enemies are about information

Page 39: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Combat Dialogue

• Use the appropriate tools– Excel has its place

• Expected results were extremely “soft”– target was a “narrative”– target was negotiated between design and

audio

• Data-mining was absolutely critical

Page 40: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

But ... where’s all the real AI?!

Page 41: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Real AI

What about• Planning• Inference• Genetic

approaches• Learning• etc. …

• F.E.A.R (Monolith)– STRIPS Planning

• Black & White (Lionhead)– Decision-tree

learning– Gesture recognition

• Euphoria (NaturalMotion)– NN + GA

Page 42: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Conclusions

Page 43: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Technique Summary

• Behavior Tree• Rule-matching

Transparency in decision-making is important

Two parts to transparency:1.Transparent algorithm2.A tools infrastructure for editing and

debugging

Page 44: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Conclusions

• There are two important video game AI interfaces: one out towards the player, the other in, towards the content creators.

• Making them agree is hard.

• The Holy Grail:

A WYSIWIG AI Editor???

Page 45: The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios

Thank You!

Questions?

Damián [email protected]

om

?!