450 likes | 589 Views
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!.
E N D
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!
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
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
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 “I want X to do Y when Z” x 1,000
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”.)
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 Tree hide cover grenade fight fight melee shoot shoot root root uncover search pursue idle sleep
Behavior Tree Three Simplifications: • No sibling connections • Prioritized-list decision-scheme • Binary relevance functions Benefits: • No more n2 complexity • Scalability
Behavior Tree: Designer Tools bool hide_relevance() { if (damage > MAX_DAMAGE) { return true; } else { return false; } } • Behavior Parameters • Masks
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
You idiot! You killed our own guy! Aaargh!!! Ha! They killed their own guy! Oh no, I killed my own guy! I’m sorry!!! Oh no, they killed my friend! Well done, friend! Well done, Master Chief! Damn you, Master Chief!
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 system Event: “Player killed a grunt” killed(a,b) prs_plr_kill enemies(a, b), player(a) friend(a) 0.8 event vocalization relevance conditions speaker conditions
Combat Dialogue Implementation: a rule-matching system Event: “Player killed a grunt” killed(a,b) prs_plr_kill enemies(a, b), player(a) friend(a) 0.8 killed(a,b) prs_ally_kill enemies(a, b) friend(a) 0.5 killed(a,b) crs_plr_kill enemies(a, b), player(a) enemy(a) 0.5 killed(a,b) crs_plr_btry friends(a, b), player(a) friend(a) 0.0 Probabilistically choose among top contenders
Combat Dialogue Implementation: a rule-matching system Event: “Player killed a grunt” killed(a,b) prs_plr_kill enemies(a, b), player(a) friend(a) 0.8 killed(a,b) prs_ally_kill enemies(a, b) friend(a) 0.5 killed(a,b) crs_plr_kill enemies(a, b), player(a) enemy(a) 0.5 killed(a,b) crs_plr_btry friends(a, b), player(a) friend(a) 0.0 Probabilistically choose among top contenders
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
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
Technique Summary • Behavior Tree • Rule-matching Transparency in decision-making is important Two parts to transparency: • Transparent algorithm • 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 Isla damiani@bungie.com ?!