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

Preview:

Citation preview

The Two Faces of Video Game AI

Damian IslaAI 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!

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

Terminology

Game AI must be:

• Coherent• Transparent – for the player– for the

designer

• Workable

Player Interface

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?

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

Designer Interface

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?!”

Scale

The Enemy of all Transparency

x 1,000

“I want X to do Y when Z”

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”.)

Transparency vs. Competence

Case Study 1: Behavior Selection

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

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)

Behavior FSM

Behavior FSM

???

Behavior Tree

melee

shoot

grenade

uncover

pursue

sleep

fight

search

hide

idle

root

cover

root

fight

shoot

Behavior Tree

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

scheme3.Binary relevance functions

Benefits:• No more n2 complexity• Scalability

Behavior Tree: Designer Tools

1. Behavior Parameters

2. Masks

bool hide_relevance() {

if (damage > MAX_DAMAGE) {

return true;}else {

return false;}

}

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

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

Case Study 2: Combat Dialogue

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!!!

Combat Dialogue

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

“Vocalization”

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

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

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”

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”

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

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

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

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

Conclusions

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

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???

Thank You!

Questions?

Damián Isladamiani@bungie.c

om

?!

Recommended