Managing Complexity in the Halo2 AI Damián Isla Bungie Studios

Slides:



Advertisements
Similar presentations
The Halo 2 AI In 10 Minutes or Less Damián Isla Bungie Studios
Advertisements

Language Processing Hierarchy
Ministry and Mission in Uncertain Times. Challenging Tasks in Times of Stress 1. Remember the calling 2. Help people reflect personally 3. Weave a helpful.
Object Persistence for Synthetic Characters Damian Isla Bungie Studios Microsoft Corp. Bruce Blumberg Synthetic Characters MIT Media Lab.
Halo 3 Objective Trees: A Declarative Approach to Multiagent Coordination Damián Isla Bungie Studios.
The Two Faces of Video Game AI Damian Isla AI Lead, Bungie Studios.
Transparent Decision-Making and AI Design Damian Isla AI Lead, Bungie Studios.
The Illusion of Intelligence
Heuristic Search techniques
AI Pathfinding Representing the Search Space
Tetris and Genetic Algorithms Math Club 5/30/2011.
Topics in Programming Reactive Systems Prof. Ronen Brafman and Dr. Gera Weiss.
Rule Based Systems Michael J. Watts
Artificial Intelligence in Game Design Intelligent Decision Making and Decision Trees.
(Quickly) Testing the Tester via Path Coverage Alex Groce Oregon State University (formerly NASA/JPL Laboratory for Reliable Software)
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
Fundamentals of Game Design, 2 nd Edition by Ernest Adams Chapter 7: Storytelling and Narrative.
The Mobile Environment u Environment –something which exists in a space, a concept defined with respect to the kind of system in focus (boundary). u Two.
Architectural Design Principles. Outline  Architectural level of design The design of the system in terms of components and connectors and their arrangements.
Introduction to mobile robots Slides modified from Maja Mataric’s CSCI445, USC.
1. 2 FUNCTION INLINE FUNCTION DIFFERENCE BETWEEN FUNCTION AND INLINE FUNCTION CONCLUSION 3.
Advanced Behavioral Modeling
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
. Memory Management. Memory Organization u During run time, variables can be stored in one of three “pools”  Stack  Static heap  Dynamic heap.
Design, goal of design, design process in SE context, Process of design – Quality guidelines and attributes Evolution of software design process – Procedural,
CORE MECHANICS. WHAT ARE CORE MECHANICS? Core mechanics are the heart of a game; they generate the gameplay and implement the rules. Formal definition:
AI and GAMES CSC 8520, Villanova University Spring, 2004 Paula Matuszek & Robin McEntire.
Narrative Essay Mrs.Narasimhalu.
INTRODUCTION TO THE SCRATCH PROGRAMMING ENVIRONMENT.
Methods Chapter 6. 2 Program Modules in Java What we call "functions" in C++ are called "methods" in Java Purpose Reuse code Modularize the program This.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
University of Palestine software engineering department Testing of Software Systems Fundamentals of testing instructor: Tasneem Darwish.
1/19 Component Design On-demand Learning Series Software Engineering of Web Application - Principles of Good Component Design Hunan University, Software.
Computer Science CPSC 322 Lecture 3 AI Applications 1.
CHAPTER 2: COMPUTER-SYSTEM STRUCTURES Computer system operation Computer system operation I/O structure I/O structure Storage structure Storage structure.
Artificial Intelligence in Game Design Behavior Trees.
Method Overriding Remember inheritance: when a child class inherits methods, variables, etc from a parent class. Example: public class Dictionary extends.
“Low Level” Intelligence for “Low Level” Character Animation Damián Isla Bungie Studios Microsoft Corp. Bruce Blumberg Synthetic Characters MIT Media Lab.
CSE 219 Computer Science III Program Design Principles.
AI in Computer Gaming: The first person shooter Tyler Hulburd.
Introduction to Exception Handling and Defensive Programming.
MD – Object Model Domain eSales Checker Presentation Régis Elling 26 th October 2005.
Elements of Drama. Story vs. Play When a writer describes a character’s conflict in a novel or story, they can describe it. When a writer describes a.
Scaling Up To More Sophisticated AI Without Overburdening Developers - Lessons Learned Marc Atkin Irrational Games AGDC 4-Dec-2004.
Jumping, Climbing, and Tactical Reasoning Section 2.5 Tom Schaible CSE 497 – AI & Game Programming.
University of Windsor School of Computer Science Topics in Artificial Intelligence Fall 2008 Sept 11, 2008.
AI in games Roger Crawfis CSE 786 Game Design. AI vs. AI for games AI for games poses a number of unique design challenges AI for games poses a number.
Presented by Ronni Rosewicz.  To learn the basics of Social Thinking  To learn practical strategies and common vocabulary to help your child be more.
DAT 332 SQL Server 2000 Data Transformation Services (DTS) Best Practices Euan Garden Product Unit Manager SQL Server Development Microsoft Corporation.
AI Evaluation David Nowell CIS 588 2/14/05 Baldur’s Gate.
CHAPTER 14 Classes, Objects, and Games XNA Game Studio 4.0.
Sega 500 Scripted events and Sequences Jeff “Ezeikeil” Giles
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
Program Design. Simple Program Design, Fourth Edition Chapter 1 2 Objectives In this chapter you will be able to: Describe the steps in the program development.
Elements of Drama. Story vs. Play When a writer describes a character’s conflict in a novel or story, they can describe it. When a writer describes a.
Finite State Machines Logical and Artificial Intelligence in Games Lecture 3a.
Verification vs. Validation Verification: "Are we building the product right?" The software should conform to its specification.The software should conform.
Personal Power 6: Value and belief system.  Reminder: 1. Please choose a “challenging” topic for your final project. Each group leader needs to upload.
The Game Development Process: Artificial Intelligence.
Next-Gen Content Creation for Next-Gen AI Damián Isla Moonshot Games 2.
Team Member AI in an FPS and Goal Oriented Action Planning.
Resource Management IB Computer Science.
A Simple Syntax-Directed Translator
Personal Power 6: Value and belief system
Coding Defensively Coding Defensively
SECTIONS: Abilities - nick Co-op AI - nick Enemy AI - josh
Knowledge Representation
Chapter 16 – Programming your App’s Memory
Control Structure Testing
Presentation transcript:

Managing Complexity in the Halo2 AI Damián Isla Bungie Studios

Managing Scalability in the Halo2 AI Damián Isla Bungie Studios

Scalability? No! Scalability!

Why Scalable AI? More is BETTER The brute force approach to common sense: the more unique situations you can recognize and react to, the more common-sensical you are. (e.g. Cyc, OpenMind projects)

3 Dimensions of Scalability heretic grunt elite major flood swarms hunters hell-jumpers brute captain Miranda sniper marine DRAMA! pacing story challenge Variety Variation drive the warthog Shoot the needler melee attack fight perch hide boarding Strafe target Volume

The Ultimate Goal Designer I want X to do Y whenever Z! Engineer Okay. (To himself) Hmm … and I know exactly where to put that … I’m happy now. (Trundles back to design-bubble) Two points: A great architecture has one PERFECT place for each new feature X,Y,Z – as in almost all of the designer’s requests – describe something observable by the player. It is not smart, it is in fact a predictable rule that will always happen. The only question is whether it will play nice with the other 500 XYZs the designer has asked for.

AI Design Requirements Transparency Facilitate the ongoing narrative in the player’s head Coherence Focused action, right priorities Directability For the designer Workability For the engineer See [Butcher & Griesemer] GDC 2002 Transparency – often about clear animation, clear lines of dialogue, etc. NEXT SLIDE: TITLE SCALABLE DECISION MAKING

Managing Scalable Decision-Making in the Halo2 AI Damián Isla Bungie Studios

Behaviors Behavior: a program that takes temporary control of the actor in order to get something done Behaviors are action over time: Move to a point Orient Shoot Crouch Play dialogue Trigger “actions” Behaviors have notion of relevancy and duration e.g., Fight Vehicle entry Throw grenade Find cover Cover friend Check body Wake up a sleeping grunt Etc. Halo2: ~130 in total

The Combat Cycle Massive amounts of complexity hiding in here!

Decision-Making Behavior Tree (or DAG) Good Bad Intuitive Modular Scalable Bad Never really that simple Debugging is hard Memory is hard

Decision routines Parent custom Child-competitive

Given A, B or C, always choose D (all of the above) Decision routines Child-competitive strategies Analog Relevancy Binary Relevancy Prioritized-list (root, engage) Sequential Sequential-looping (search) Randomized One-off randomized (postcombat) DP #1: customizability Priorities list is most common COHERENCE IS ABOUT PRIORITIES Design Principle #1 : Given A, B or C, always choose D (all of the above)

Unless the player is in vehicle, in which case... Impulses Problem: What happens (with a prioritized list) when the priority is not constant? Unless the player is in vehicle, in which case...

Design Principle #2 : Formalize complexity (don’t hide it) Impulses Solution: Separate alternative trigger conditions out into separate impulse Two execution options In-place Redirect Design Principle #2 : Formalize complexity (don’t hide it)

Design Principle #3: Embrace the hackery Impulses The other purpose of impulses: HACKS Or, “localized code with ad-hoc Functionality” e.g. crouch_on_danger impulse dive impulse Design Principle #3: Embrace the hackery Two things demanded of the architecture: Allow us to do it. Help us contain/catalog/keep track of it

Behavior Metadata Problem: In determining relevancy, we check the same conditions over and over and over and over Actor’s vehicle status (infantry, driver, passenger) Actor’s alert status (idle, in combat, visible target) Solution: Use metadata to describe execution conditions Force all behaviors to declare their execution conditions Halo2: “conditions” bitvector compared to “actual state” bitvector Acts as a behavior/impulse mask (modifying the basic structure of the tree itself)

Design Principle #4 : Variation from a stable base Custom Behaviors Problem: character-type specific behaviors Don’t want all characters evaluating behaviors that only one type can do E.g. grunt’s “retreat from scary enemy” impulse Solution: attach custom behaviors to tree ALTERNATIVE: New TREE

Stimulus Behaviors Problem: rare event-driven behaviors tested for every tick e.g., Grunts flee when their leader dies Solution: Stimulus Behaviors Behaviors or impulses dynamically and asynchronously placed into tree at specified location “Actor Died” 1 sec. Why not just force the actor to start running the behavior??? Maybe a higher-priority XYZ is running The tree ensures that the priorities of the designers are respected. TREE PLACEMENT as much a part of the decision as the RELEVANCY function

Joint Behaviors Remember Design Principle #1! (always choose D, all of the above)

Behavior Summary Behavior DAG Binary decision routines Impulses Metadata Custom Behaviors Stimulus Behaviors Joint behaviors The behavior tree is fundamentally a DYNAMIC structure!

Memory is a problem fundamental to the behavior tree structure. No system is complete with an explicit memory solution.

Memory and Memory Problem: Persistent behavior state is impossible (too much data to keep around!) Solution: Only keep around state for behaviors that are running Problem: What about state we need to keep around regardless of whether we’re running the behavior or not? (e.g. last grenade-throw time) Part of maintaining coherence is remembering what I’ve been doing!!!

The Anatomy of Memory …memory is a complicated thing. Store memory as… Behavior state (short-term) Persistent per-behavior Persistent per-target Props are also Perception caches Our knowledge model “Props”

(formalize complexity, The Anatomy of Memory e.g. Search Aquire target 1 Lose sight of target 1 Search target 1 Last known location inspected New search point selected Aquire target 2 Search deactivated, short-term state discarded Target 2 killed Switch to target 1 Where do we search? Existing search point used EXPERIENCE is VERY coherent No tree architecture is complete without a memory solution Remember Design Principle #2 (formalize complexity, don’t hide it)

Designer Direction Variety Variation Character definition Model, animation graph Behavior parameters Static control Level-scripting Dynamic Control Variation

Static Control: Variety Character types Elites Grunts Marines Variants Gold elite Red elite Honor guard elite Jetpack elite Each variant gets a .character definition file A LOT of parameters to author and maintain! 64(variants) x 80 (behaviors/variant) x 3 (parameters/behavior) = 15,360

Static Control: Parameters Character files divided into parameter blocks Vitality properties Perception properties Search properties Weapon usage Etc. Blocks can be instantiated or not Hierarchy: children characters instantiate only significant variations from parent Root of tree is the “generic” character, which provides “reasonable” values for all parameters Remember Design Principle #4! (Variation from a stable base)

Static Control: Styles Styles are cool: Behavior mask Bias control parameters Superposable (Another reason why Impulses are great) VARIETY Another reason why separating different trigger conditions into different impulses is a great idea: expose those triggers to the designers Back to vehicle entry behavior

Dynamic Control: Organization Halo1: “Encounters” Groups of actors Groups of areas Problem: moving actors from one encounter to the next was “architecturally discouraged” Halo2: “Squads” Groups of actors “Zones” Groups of areas “Orders” A mapping between the two

Dynamic Control: Orders The Metaphor: “Take that hill!” “Hole up in that bunker!” Or “Occupy this space and behave this way!” Position direction Behavior direction

Blah blah blah Actor is a member of a squad Squad gets an order Actors get free range inside of region

Orders and Behavior Behavior direction Vehicle behaviors enabled/disabled Active camouflage enabled/disabled Follow player enabled/diabled Rules of engagement Style Behavior mask Bias control parameter A way that orders can directly constrain the decision space of the actors Tricky to author … but the nice thing is that you only need a few of them, like (assaulting, bunkering, harassing…) Only about 5 or 6 used in Halo2 NO SCRIPTING “Alright, men, engage active camouflage and move forward cautiously. And don’t open fire until the Master Chief does!”

Design Principle #5 : Work with your representations In summary Design Principle #5 : Work with your representations

Recap Design Principles: Always choose D (all of the above) Formalize complexity (don’t hide it) Embrace the hackery Variation from stable base Work with your representations

Technical Takeaways Dynamic behavior tree Binary relevancy Behavior masking Principled approach to memory Take smarts out of the behavior and put it in the knowledge model

Conclusions All systems need to “play ball” with the core decision mechanism Not looking for “smart” architecture, looking for expressive architecture

The Ultimate Goal Designer I want X to do Y whenever Z!

Questions? Damián Isla damiani@microsoft.com