SlideShare ist ein Scribd-Unternehmen logo
1 von 95
Downloaden Sie, um offline zu lesen
The AI Systems of Left 4 Dead
             Michael Booth, Valve
What is Left 4 Dead?


 Left 4 Dead is a
  replayable, cooperative,
  survival-horror game
  where four Survivors
  cooperate to escape
  environments swarming
  with murderously enraged
  “Infected” (ie: zombies)
Left 4 Dead: The Survivor Team
Left 4 Dead: Enraged Infected Mob
Left 4 Dead: The Special Infected
Left 4 Dead: The Boss Infected
Left 4 Dead
Left 4 Dead
Left 4 Dead
Goals of Left 4 Dead AI


 Deliver Robust Behavior Performances
 Provide Competent Human Player Proxies
 Promote Replayability
 Generate Dramatic Game Pacing
Goals of Left 4 Dead AI


 Deliver Robust Behavior Performances
 Provide Competent Human Player Proxies
 Promote Replayability
 Generate Dramatic Game Pacing
Goal: Deliver Robust Behavior Performances

 Moving through the Environment
   • A* through Navigation Mesh
   • Creates jagged path
   • How to move fluidly?
Goal: Deliver Robust Behavior Performances

 Path Optimization
   • Collapse redundant path
     nodes
   • Good
      • Creates minimal and direct
           path
   • Bad
       • Nontrivial CPU cost at path
         build time
       • Paths are recomputed
         often in the game
       • Following path directly
         looks robotic
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
    • Move towards “look ahead”
      point farther down path
    • Use local obstacle avoidance
    • Good
        • (Re)pathing is cheap
        • Local avoidance handles small
           physics props, other bots,
           corners, etc
         • Superposes well with mob
           flocking behavior
         • Resultant motion is fluid
    • Bad
         • Can avoid off path too much,
            requiring repath
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Reactive Path Following
Goal: Deliver Robust Behavior Performances

 Path Optimization vs
  Reactive Path Following
   • Resultant path is reasonably
     close to optimized path
   • Reactive Path Following is
     used for all actors in Left 4
     Dead
Goal: Deliver Robust Behavior Performances


 Reactive Path Following: Climbing
   • To ensure the Common Infected horde are always
     dangerous, they have the ability to rapidly climb
   • Climbing is algorithmic, using a similar technique to local
     obstacle avoidance
   • Algorithmic climbing solves two major issues
      • Navigating the complex geometry of the post apocalyptic world
         of Left 4 Dead
       • Navigating over movable physics props
Goal: Deliver Robust Behavior Performances
Goal: Deliver Robust Behavior Performances

 Approach
   • Bot periodically tests for
     obstacles immediately
     ahead as it follows its path
Goal: Deliver Robust Behavior Performances

 Find Ceiling
   • Once an obstacle has been
      detected, another hull trace
      determines the available
      vertical space above the bot
Goal: Deliver Robust Behavior Performances

 Find Ledge
   • The vertical space is then
     scanned via a series of hull
     traces from lowest to
     highest to find the first
     unobstructed hull trace
Goal: Deliver Robust Behavior Performances

 Find Ledge Height
   • Another hull trace
     downward from the
     unobstructed trace finds the
     precise height of the ledge
     to be climbed
Goal: Deliver Robust Behavior Performances

 Find Ledge Forward Edge
   • A final series of downward
     hull traces that step
     backwards determine the
     forward edge of the ledge
Goal: Deliver Robust Behavior Performances

 Perform Climb
   • Pick closest match
     animation from dozens of
     motion captured climb                             G rr. A rg h .


     animations of various height
     increments
Goal: Deliver Robust Behavior Performances

 Behaviors and decision making
Goal: Deliver Robust Behavior Performances

 Locomotion                                                                            A c to r
    Owns moving the actor to a new
    position in the environment (collision        L o c o m o ti o n



    resolution, etc)
   Body                                          B ody

    Owns animation state
   Vision
    Owns line-of-sight, field of view, and
                                                  V i si o n



    “am I able to see <X>” queries.
    Maintains recognized set of entities.          In te n ti o n

   Intention
    Contains and manages a system of                    B e h a vi o r                        B e h a vi o r


    concurrent Behaviors (HFSM+Stack)                          A c ti o n                          A c ti o n

      • Behavior
         Contains and manages a system of                                   A ct i on                           A ct i on



         Actions                                                  A ct i on                           A ct i on



     •   Action
         The building blocks of intentional
         actions. An Action can contain a child
         Action, which executes concurrently.
Goal: Deliver Robust Behavior Performances

 Encapsulation of Action processing
   • OnStart
        • Executed when the Action is transtioned into
        • Can return an immediate transition
   •   Update
        • Does the “work” of the Action
        • Update can return a transition to a new Action
   •   OnEnd
        • Is executed when the Action is transitioned out of
   •   OnSuspend
        • Executed when Action has been put on hold for another Action
        • Can return a transition
   •   OnResume
        • Executed when Action resumes after being suspended
        • Can return a transition (perhaps Action is no longer valid)
Goal: Deliver Robust Behavior Performances

 Action Transitions
   • Continue()
       No transition, continue this Action next frame.
   •   ChangeTo( NextAction, “reason” )
       Exit the current Action and transition into NextAction.
   •   SuspendFor( NextAction, “reason” )
       Put the current Action “on hold” (bury it) and enter NextAction.
   •   Done( “reason” )
       This Action is finished. Resume the “buried” Action.
   •   “reason”
       A string documenting the reason why the transition occurred (ie:
       “The player I was chasing died”). Reason strings help clarify the
       Action system and are invaluable for realtime debug output.
Goal: Deliver Robust Behavior Performances


 Encapsulation of Action Transitions
   • Returning ActionResults enforces atomic transitions since no
     behavior code can be run between the decision to change to a new
     Action and the actual change
   • The only way to go from Action A to Action B is for Action A to
     return a transition to Action B
   • There is no way to force a transition from Action A to Action B
     without Action A’s “knowledge”
   • Keeps related behavior code encapsulated within the Action
Goal: Deliver Robust Behavior Performances

 Event Propagation                E v e n t: O n In ju re d




 Events propagate to all             A c to r
  components                                L o c o m o ti o n




 In the Intention subsystem,
  events are                                B ody




   • First handled by the                   V i si o n


     innermost child Action
   • If child has no response,               In te n ti o n



     event is sent to buried                      B e h a vi o r                  B e h a vi o r


     Action                                              A c ti o n                   A c ti o n




   • If no buried Actions have a                                      A ct i on                    A ct i on




     response, event is sent to
                                                            A ct i on                     A ct i on




     parent
Goal: Deliver Robust Behavior Performances

 Example events
   • OnMoveToSuccess, OnMoveToFailure,
     OnStuck, OnUnStuck,
     OnAnimationActivityComplete,
     OnAnimationEvent,
     OnContact, OnInjured,
     OnKilled, OnOtherKilled,
     OnSight, OnLostSight,
     OnSound,
     OnPickUp, OnDrop
 Actions can implement event handler
  methods, providing context-specific
  reactions to game events
Goal: Deliver Robust Behavior Performances

 Contextual Query System
 Actions can implement query methods, providing context-
  specific answers to questions
 Defines queries that can be asked of the Behavior/Action system
  as a “black box”
 Queries propagate from childmost Action outward until an
  answer is given, identically to Event propagation
 Allows concurrent Behaviors to coordinate
   • ie: We are able to opportunistically able to pick up an object,
      should we?
Goal: Deliver Robust Behavior Performances


 Example Queries
  • SelectMoreDangerousThreat( me, subject, threat1, threat2 )
     • Allows bot to find the most dangerous threat to someone else
       (ie: an incapacitated player it wants to help)
  • ShouldPickUp
  • ShouldHurry
  • IsHindrance
Goals of Left 4 Dead AI


 Deliver Robust Behavior Performances
 Provide Competent Human Player Proxies
 Promote Replayability
 Generate Dramatic Game Pacing
Goal: Provide Competent Human Player Proxies

 Survivor Bots
    • Allowed us to assume 4 player Survivor team for game tuning and balance
    • Drop in/out (“Take a Break”) incredibly valuable in the wild
    • Automated stress testing with 4 SurvivorBots and accelerated game time
Goal: Provide Competent Human Player Proxies

 Believability/Fairness
    • Players need to believe bot
        replacements are “fair”
    •   Imperfect knowledge –
        simulated senses
    •   Simulated aiming
    •   Reaction times
    •   Reliable and predictable
        decision making
          • Difficult issue: Rescuing
            incapacitated humans
Goal: Provide Competent Human Player Proxies

 Trust
   • Cooperative nature of game
     requires close collaboration of
     Survivor team and implicit trust
     in teammate’s action choices
   • SurvivorBots prioritize human
     teammates over bots
   • Game “cheats” to guarantee
     some undesirable events
     cannot occur
       • SurvivorBots cannot deal
            friendly fire damage
          • SurvivorBots never use
            Molotovs
          • If a SurvivorBot ever gets far
            out of place for any reason, it
            is teleported near the team
            when no human is looking at it
Goal: Provide Competent Human Player Proxies

 SurvivorBots exercised complexity encapsulation
    • Two concurrent Behavior systems: Main and Legs
          • Main: Primary decision making, attention, target
            selection and attack
          • Legs: Slaved to Main, responsible for staying near
            team unless otherwise directed
    • Many hierarchical behavior states reacting to
        dozens of game events
          • Interrupting, resuming
    •   Complex contextual decision making
          • Tank, Witch, Boomer, Smoker, Hunter, Mob rushes,
             wandering horde, Survivor teammates, item
             scavenging, healing self, healing teammates,
             weapon selection, Rescue Closets, incapacitation,
             limping, complex 3D terrain, movable physics
             obstacles, transient fires, ladders, elevators, in any
             combination
    • Replicating human performance based on actual
        gameplay experience
          • Behavior system built to reproduce decisions and
             actions players make while playing the game
Goals of Left 4 Dead AI


 Deliver Robust Behavior Performances
 Provide Competent Human Player Proxies
 Promote Replayability
 Generate Dramatic Game Pacing
Goal: Promote Replayability

 Replayability promotes long-term engagement with the game,
  resulting in growth of the game’s community
   • Growing online community results in ongoing sales
   • Creates exposure opportunities for other related content
 Examples: Counter-Strike, Team Fortress, Day of Defeat
   • Thriving online communities with ongoing sales revenue
   • Comparatively few maps, played repeatedly for years on end
   • Unpredictable experience created by interactions between teams of
      players drives replayability
Goal: Promote Replayability


 In Left 4 Dead, Procedural Population of enemies
  and loot strongly promotes replayability
   • Creates unpredictable encounters analogous to CS, TF, DoD
   • Game session is viewed as a skill challenge instead of a
     memorization exercise
Goal: Promote Replayability

 Static placement of enemies and loot hinders
  replayability
   • Players are good at memorizing all static locations
   • Removes suspense of not knowing what will happen next
   • Results in “optimal strategy” that works every time
   • Players expect everyone to have memorized all encounters
   • Kills cooperation and degenerates into a race
 Even multiple sets of manually placed triggers/scripts
  fails
   • Players learn all of them, and if they don’t see A, they
      prepare for B or C, etc.
Goal: Promote Replayability
                    Procedurally Populated Environments

 How do we procedurally populate the environment
  with interesting distributions of enemies?
   • Using Structured Unpredictability
   • Part of the collection of systems called the “AI Director”
Goal: Promote Replayability
                  Procedurally Populated Environments

 First, a short summary of tools used to generate
  Structured Unpredictability
   • Navigation Mesh
   • Flow Distance
   • Potential Visibility
   • Active Area Set
Goal: Promote Replayability
                            Procedurally Populated Environments

 The Navigation Mesh
   • Represents “walkable space”
   • Originally created for Counter-
     Strike Bot pathfinding
   • Useful for general spatial
     reasoning and spatially
     localized information
       • Has area A ever been seen by
          actor B?
        • Is area X potentially visible by
          area Y?
        • Where is a spot near the
          Survivors, not visible to any of
          them?
        • How far have we traveled to
          reach this area?
Goal: Promote Replayability
                      Procedurally Populated Environments

 “Flow Distance”
   • Travel distance from the
     starting safe room to each
     area in the navigation mesh
   • Following increasing flow
     gradient always takes you to
     the exit room
   • “Escape Route” = shortest
     path from start safe room to
     exit
   • Used as a metric for
     populating enemies and loot,
     and for answering questions
     such as “is this spot ahead or
     behind the Survivor group”
Goal: Promote Replayability
                     Procedurally Populated Environments

 The Active Area Set (AAS)
                                                                  E X IT




   • The set of Navigation Areas
     surrounding the Survivor team
   • The AI Director creates/destroys
     population as the AAS moves
     through the environment
   • Allows for hundreds of enemies
     using a small set of reused entities




                                                       E NT E R
Goal: Promote Replayability
                     Procedurally Populated Environments

 Potentially Visible Areas
                                                                  E X IT




   • The set of Navigation Areas
     potentially visible to any Survivor




                                                       E NT E R
Goal: Promote Replayability
                 Procedurally Populated Environments

 The Active Area Set
Goal: Promote Replayability
                 Procedurally Populated Environments

 The Active Area Set
Goal: Promote Replayability
                 Procedurally Populated Environments

 The Active Area Set
Goal: Promote Replayability
                      Procedurally Populated Environments

 Populating via Structured Unpredictability
   • Not purely random, nor deterministically uniform
   • Population functions where space and/or time varies based
     on designer-defined amount of randomization
      • Example: Mob spawns
           • Occur at randomized interval between 90 and 180 seconds
           • Located at randomized spot “behind” the Survivor team
   • Structured Unpredictability = Superposition of several of
     these population functions
Goal: Promote Replayability
                          Procedurally Populated Environments

 Structured Unpredictability in Left 4 Dead
    • Wanderers (high frequency)
         • Common Infected that wander around in a daze until alerted by a
           Survivor
    • Mobs (medium frequency)
         • A large group (20-30) of enraged Common Infected that periodically
           rush the Survivors
    • Special Infected (medium frequency)
       • Individual Infected with special abilities that harass the Survivor team
    • Bosses (low frequency)
       • Powerful Infected that force the Survivors to change their strategy
    • Weapon Caches (low frequency)
       • Collections of more powerful weapons
    • Scavenge Items (medium frequency)
       • Pipe bombs, Molotovs, Pain Pills, Extra Pistols
Goal: Promote Replayability
                            Procedurally Populated Environments

 Populating Wandering Infected
    • Stored as a simple count (N) in each area
    • Counts are randomly determined at map
      (re)start based on Escape Route length
      and desired density
    • When an area enters the AAS
        • Create N Infected (if possible)
    • When an area leaves the AAS, or a
      pending Mob needs more members
        • Wanderers in the area are deleted and N is
            increased accordingly
    • Wanderer count (N) is zeroed:
         • When an area becomes visible to any
           Survivor
         • When the Director is in Relax mode
Goal: Promote Replayability
                     Procedurally Populated Environments

 Example                                                  E X IT




   • Green areas are entering
     the AAS and wanderers are
     being spawned
   • Red areas are leaving the
     AAS, and the Infected
     within will be de-spawned




                                                E NT E R
Goal: Promote Replayability
                     Procedurally Populated Environments

 Populating Mobs
   • Created at randomized
     intervals (90-180 seconds on
     Normal difficulty)
   • Boomer Vomit forces Mob
     spawn, resets random
     interval
   • Mob size grows from
     minimum just after spawn to
     maximum after a duration to
     balance difficulty of
     successive, frequent Mobs
Goal: Promote Replayability
                       Procedurally Populated Environments

 Populating the Special Infected
   • Created at individually randomized intervals
   • Use valid area in the AAS not visible by the Survivor team
      appropriate to Special’s class
       • Boomers spawn ahead, since they are slow and can’t chase well
       • Smokers attempt to select areas above the Survivor team
Goal: Promote Replayability
                    Procedurally Populated Environments

 Where to spawn
                                                                 E X IT




  • Behind Survivors
     • Only select valid areas in the AAS
       that are at or behind the Survivor
       team’s “flow” distance
     • 75% of Mobs come from behind,
       since wanderers and
       Special/Boss Infected are usually
       engaged ahead of the team




                                                      E NT E R
Goal: Promote Replayability
                    Procedurally Populated Environments

 Where to spawn
                                                                 E X IT




  • Ahead of Survivors
     • Only select valid areas in the AAS
       that are at or greater than the
       Survivor team’s “flow” distance




                                                      E NT E R
Goal: Promote Replayability
                    Procedurally Populated Environments

 Where to spawn
                                                                 E X IT




  • Near Boomer Vomit Victim
     • Only select valid areas in the AAS
       that are near the Boomer Vomit
       Victim’s “flow” distance




                                                      E NT E R
Goal: Promote Replayability
                     Procedurally Populated Environments

 Where to spawn
                                                                  E X IT




  • Anywhere
     • Any valid area in the AAS
     • Default if there are no valid
       areas in the more specific sets




                                                       E NT E R
Goal: Promote Replayability
                    Procedurally Populated Environments

 Boss Population
   • Positioned every N units along
     “escape route” +/- random
     amount at map (re)start.
   • Three Boss events are shuffled
     and dealt out: Tank, Witch, and
     Nothing.
   • Successive repeats are not
     allowed (ie: Tank, then Tank
     again)

Tank   Witch         Witch             Tank           Witch   Tank
Goal: Promote Replayability
                          Procedurally Populated Environments

 Weapon Caches
   • Map designer creates several possible weapon
      caches in each map, the AI Director chooses
      which will actually exist
 Scavenge Items
   • Map designer creates many possible item groups
      throughout the map, the AI Direction chooses
      which groups actually exist
 Why designer-placed?
   • Prediction of possible locations beneficial in this
     case
   • Allows visual storytelling/intention
   • Solves item placement issues (leaning against
     wall, mounted in gun rack, etc)
Goal: Promote Replayability


 Procedural Content
   •   Promotes replayability
   •   Solution for linear, yet replayable multiplayer experiences
   •   Greatly multiplies output of development team
   •   Improves community created content
Goals of Left 4 Dead AI


 Deliver Robust Behavior Performances
 Provide Competent Human Player Proxies
 Promote Replayability
 Generate Dramatic Game Pacing
Goal: Generate dramatic game pacing


 What do we mean by “dramatic game pacing”?
   • Algorithmically adjusting game pacing on the fly to maximize
       “drama” (player excitement/intensity)
 Inspired by Observations from Counter-Strike
   • Natural pacing of CS is "spiky”, with periods of quiet tension
       punctuated by unpredictable moments of intense combat
   •   Constant, unchanging combat is fatiguing
   •   Long periods of inactivity are boring
   •   Unpredictable peaks and valleys of intensity create a powerfully
       compelling and replayable experience
   •   Same scenario, often the same map, yet different and compelling
       experience each round
Goal: Generate dramatic game pacing


 Adaptive Dramatic Pacing algorithm
   • Creates peaks and valleys of intensity similar to the proven
     pacing success of Counter-Strike
   • Algorithm:
      • Estimate the “emotional intensity” of each Survivor
      • Track the max intensity of all 4 Survivors
      • If intensity is too high, remove major threats for awhile
      • Otherwise, create an interesting population of threats
   • Another key system of the “AI Director”
Goal: Generate dramatic game pacing
                                      Adaptive Dramatic Pacing

 Estimating the “emotional intensity” of each
   Survivor
    • Represent Survivor Intensity as a value
    • Increase Survivor Intensity
         • When injured by the Infected, proportional to
           damage taken
         • When the player becomes incapacitated
         • When player is pulled/pushed off of a ledge
           by the Infected
         • When nearby Infected dies, inversely
           proportional to distance
    • Decay Survivor Intensity towards zero over
      time
    • Do NOT decay Survivor Intensity if there are
      Infected actively engaging the Survivor
Goal: Generate dramatic game pacing
                                          Adaptive Dramatic Pacing

 Use Survivor Intensity to modulate the Infected population
    • Build Up
         • Create full threat population until Survivor Intensity crosses peak
            threshold
    • Sustain Peak
         • Continue full threat population for 3-5 seconds after Survivor
           Intensity has peaked
         • Ensures minimum “build up” duration.
    • Peak Fade
         • Switch to minimal threat population (“Relax period”) and monitor
            Survivor Intensity until it decays out of peak range                           B uild
         • This state is needed so current combat engagement can play out                   Up
            without using up entire Relax period. Peak Fade won’t allow the
            Relax period to start until a natural break in the action occurs.
    • Relax                                                                      R e lax
                                                                                                    S us tain
         • Maintain minimal threat population for 30-45 seconds, or until                            P e ak
            Survivors have traveled far enough toward the next safe room,
            then resume Build Up.
                                                                                           P e ak
                                                                                           F ad e
Goal: Generate dramatic game pacing
                                Adaptive Dramatic Pacing

 Full Threat Population (Build Up)
   • Wanderers
   • Mobs
   • Special Infected
 Minimal Threat Population (Relax)
   • No Wanderers until team is “calm”
   • No Mobs
   • No Special Infected (although existing Specials may attack)
 Boss Encounters NOT affected by adaptive pacing
   • Overall pacing affected too much if they are missing
   • Boss encounters are intended to change up the pacing anyhow
Goal: Generate dramatic game pacing
                           Adaptive Dramatic Pacing

 An example procedurally generated population
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                            Adaptive Dramatic Pacing

 How the AI Director modulates the population based
  on the Survivor team’s “emotional intensity”
Goal: Generate dramatic game pacing
                           Adaptive Dramatic Pacing

 Comparing population after modulation by the AI
  Director
Goal: Generate dramatic game pacing

 Adaptive Dramatic Pacing reacts to Survivor team
    • Generates reliable peaks of intensity without completely
      overwhelming the team
    • Because of player variation and procedural threat population,
      timing and location of peaks will differ
      each time the game is played
 Algorithm adjusts pacing, not difficulty
   • Amplitude (difficulty) is not changed, frequency (pacing) is
 Simple algorithms can generate compelling pacing schedules
   • Survivor Intensity estimation is crude, yet the resulting pacing
       works
Future Work


 Just the beginning…
   • Expand repertoire of verbs
     available to the AI Director
   • Explore further procedural
     content generation
     opportunities
   • How to utilize these systems in
     other game projects?
For more information…


 www.L4D.com
 www.valvesoftware.com
 mike.booth at valvesoftware dot com
THANK YOU!

Weitere ähnliche Inhalte

Ähnlich wie AI в Left 4 Dead

Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
Player Traversal Mechanics in the Vast World of Horizon Zero DawnPlayer Traversal Mechanics in the Vast World of Horizon Zero Dawn
Player Traversal Mechanics in the Vast World of Horizon Zero DawnGuerrilla
 
No, we can't do continuous delivery
No, we can't do continuous deliveryNo, we can't do continuous delivery
No, we can't do continuous deliveryKris Buytaert
 
Intro to Reinforcement Learning
Intro to Reinforcement LearningIntro to Reinforcement Learning
Intro to Reinforcement LearningUtkarsh Garg
 
GSWC Workshop, Week 3
GSWC Workshop, Week 3GSWC Workshop, Week 3
GSWC Workshop, Week 3kkeintz
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfMrRRThirrunavukkaras
 
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Numenta
 
Utah Code Camp 2014 - Learning from Data by Thomas Holloway
Utah Code Camp 2014 - Learning from Data by Thomas HollowayUtah Code Camp 2014 - Learning from Data by Thomas Holloway
Utah Code Camp 2014 - Learning from Data by Thomas HollowayThomas Holloway
 

Ähnlich wie AI в Left 4 Dead (7)

Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
Player Traversal Mechanics in the Vast World of Horizon Zero DawnPlayer Traversal Mechanics in the Vast World of Horizon Zero Dawn
Player Traversal Mechanics in the Vast World of Horizon Zero Dawn
 
No, we can't do continuous delivery
No, we can't do continuous deliveryNo, we can't do continuous delivery
No, we can't do continuous delivery
 
Intro to Reinforcement Learning
Intro to Reinforcement LearningIntro to Reinforcement Learning
Intro to Reinforcement Learning
 
GSWC Workshop, Week 3
GSWC Workshop, Week 3GSWC Workshop, Week 3
GSWC Workshop, Week 3
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdf
 
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
Brains@Bay Meetup: The Increasing Role of Sensorimotor Experience in Artifici...
 
Utah Code Camp 2014 - Learning from Data by Thomas Holloway
Utah Code Camp 2014 - Learning from Data by Thomas HollowayUtah Code Camp 2014 - Learning from Data by Thomas Holloway
Utah Code Camp 2014 - Learning from Data by Thomas Holloway
 

Mehr von Apps4All

Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Apps4All
 
Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Apps4All
 
Аудитория мобильного Интернета
Аудитория мобильного ИнтернетаАудитория мобильного Интернета
Аудитория мобильного ИнтернетаApps4All
 
Goal number one
Goal number oneGoal number one
Goal number oneApps4All
 
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...Apps4All
 
Александра Кочеткова Touch'anka
Александра Кочеткова Touch'ankaАлександра Кочеткова Touch'anka
Александра Кочеткова Touch'ankaApps4All
 
Измерение мобильной аудитории: в поисках валюты рынка
Измерение мобильной аудитории: в поисках валюты рынкаИзмерение мобильной аудитории: в поисках валюты рынка
Измерение мобильной аудитории: в поисках валюты рынкаApps4All
 
Ваща аудитория в мобильных социальных сетях
Ваща аудитория в мобильных социальных сетяхВаща аудитория в мобильных социальных сетях
Ваща аудитория в мобильных социальных сетяхApps4All
 
Использование мобильных приложений
Использование мобильных приложенийИспользование мобильных приложений
Использование мобильных приложенийApps4All
 
Аудитория мобильного Интернета
Аудитория мобильного ИнтернетаАудитория мобильного Интернета
Аудитория мобильного ИнтернетаApps4All
 
Сурен Макарян Mobile Info
Сурен Макарян  Mobile InfoСурен Макарян  Mobile Info
Сурен Макарян Mobile InfoApps4All
 
Игорь Еремен iVengo
Игорь Еремен iVengoИгорь Еремен iVengo
Игорь Еремен iVengoApps4All
 
Елена Пикунова Opera Mediaworks
Елена Пикунова Opera MediaworksЕлена Пикунова Opera Mediaworks
Елена Пикунова Opera MediaworksApps4All
 
Андрей Шатров WapStart
Андрей Шатров WapStartАндрей Шатров WapStart
Андрей Шатров WapStartApps4All
 
Cергей Джейгало Major Domo
Cергей Джейгало Major DomoCергей Джейгало Major Domo
Cергей Джейгало Major DomoApps4All
 
Григорий Ситнин Z-Wave.me
Григорий Ситнин Z-Wave.meГригорий Ситнин Z-Wave.me
Григорий Ситнин Z-Wave.meApps4All
 
Сергей Коренев Zoomby
Сергей Коренев ZoombyСергей Коренев Zoomby
Сергей Коренев ZoombyApps4All
 
Сергей Быков ivi.ru
Сергей Быков ivi.ruСергей Быков ivi.ru
Сергей Быков ivi.ruApps4All
 
Аркадий Левин Антология русской поэзии
Аркадий Левин Антология русской поэзииАркадий Левин Антология русской поэзии
Аркадий Левин Антология русской поэзииApps4All
 
Алена Соснина Enaza
Алена Соснина EnazaАлена Соснина Enaza
Алена Соснина EnazaApps4All
 

Mehr von Apps4All (20)

Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013
 
Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013Презентация хакатона Apps4All 13-14 декабря 2013
Презентация хакатона Apps4All 13-14 декабря 2013
 
Аудитория мобильного Интернета
Аудитория мобильного ИнтернетаАудитория мобильного Интернета
Аудитория мобильного Интернета
 
Goal number one
Goal number oneGoal number one
Goal number one
 
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...
Лучшие практики подготовки к переводу мобильных приложений к выпуску качестве...
 
Александра Кочеткова Touch'anka
Александра Кочеткова Touch'ankaАлександра Кочеткова Touch'anka
Александра Кочеткова Touch'anka
 
Измерение мобильной аудитории: в поисках валюты рынка
Измерение мобильной аудитории: в поисках валюты рынкаИзмерение мобильной аудитории: в поисках валюты рынка
Измерение мобильной аудитории: в поисках валюты рынка
 
Ваща аудитория в мобильных социальных сетях
Ваща аудитория в мобильных социальных сетяхВаща аудитория в мобильных социальных сетях
Ваща аудитория в мобильных социальных сетях
 
Использование мобильных приложений
Использование мобильных приложенийИспользование мобильных приложений
Использование мобильных приложений
 
Аудитория мобильного Интернета
Аудитория мобильного ИнтернетаАудитория мобильного Интернета
Аудитория мобильного Интернета
 
Сурен Макарян Mobile Info
Сурен Макарян  Mobile InfoСурен Макарян  Mobile Info
Сурен Макарян Mobile Info
 
Игорь Еремен iVengo
Игорь Еремен iVengoИгорь Еремен iVengo
Игорь Еремен iVengo
 
Елена Пикунова Opera Mediaworks
Елена Пикунова Opera MediaworksЕлена Пикунова Opera Mediaworks
Елена Пикунова Opera Mediaworks
 
Андрей Шатров WapStart
Андрей Шатров WapStartАндрей Шатров WapStart
Андрей Шатров WapStart
 
Cергей Джейгало Major Domo
Cергей Джейгало Major DomoCергей Джейгало Major Domo
Cергей Джейгало Major Domo
 
Григорий Ситнин Z-Wave.me
Григорий Ситнин Z-Wave.meГригорий Ситнин Z-Wave.me
Григорий Ситнин Z-Wave.me
 
Сергей Коренев Zoomby
Сергей Коренев ZoombyСергей Коренев Zoomby
Сергей Коренев Zoomby
 
Сергей Быков ivi.ru
Сергей Быков ivi.ruСергей Быков ivi.ru
Сергей Быков ivi.ru
 
Аркадий Левин Антология русской поэзии
Аркадий Левин Антология русской поэзииАркадий Левин Антология русской поэзии
Аркадий Левин Антология русской поэзии
 
Алена Соснина Enaza
Алена Соснина EnazaАлена Соснина Enaza
Алена Соснина Enaza
 

Kürzlich hochgeladen

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Mark Simos
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 

Kürzlich hochgeladen (20)

Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
Tampa BSides - Chef's Tour of Microsoft Security Adoption Framework (SAF)
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 

AI в Left 4 Dead

  • 1. The AI Systems of Left 4 Dead Michael Booth, Valve
  • 2. What is Left 4 Dead?  Left 4 Dead is a replayable, cooperative, survival-horror game where four Survivors cooperate to escape environments swarming with murderously enraged “Infected” (ie: zombies)
  • 3. Left 4 Dead: The Survivor Team
  • 4. Left 4 Dead: Enraged Infected Mob
  • 5. Left 4 Dead: The Special Infected
  • 6. Left 4 Dead: The Boss Infected
  • 10. Goals of Left 4 Dead AI  Deliver Robust Behavior Performances  Provide Competent Human Player Proxies  Promote Replayability  Generate Dramatic Game Pacing
  • 11. Goals of Left 4 Dead AI  Deliver Robust Behavior Performances  Provide Competent Human Player Proxies  Promote Replayability  Generate Dramatic Game Pacing
  • 12. Goal: Deliver Robust Behavior Performances  Moving through the Environment • A* through Navigation Mesh • Creates jagged path • How to move fluidly?
  • 13. Goal: Deliver Robust Behavior Performances  Path Optimization • Collapse redundant path nodes • Good • Creates minimal and direct path • Bad • Nontrivial CPU cost at path build time • Paths are recomputed often in the game • Following path directly looks robotic
  • 14. Goal: Deliver Robust Behavior Performances  Reactive Path Following • Move towards “look ahead” point farther down path • Use local obstacle avoidance • Good • (Re)pathing is cheap • Local avoidance handles small physics props, other bots, corners, etc • Superposes well with mob flocking behavior • Resultant motion is fluid • Bad • Can avoid off path too much, requiring repath
  • 15. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 16. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 17. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 18. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 19. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 20. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 21. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 22. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 23. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 24. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 25. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 26. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 27. Goal: Deliver Robust Behavior Performances  Reactive Path Following
  • 28. Goal: Deliver Robust Behavior Performances  Path Optimization vs Reactive Path Following • Resultant path is reasonably close to optimized path • Reactive Path Following is used for all actors in Left 4 Dead
  • 29. Goal: Deliver Robust Behavior Performances  Reactive Path Following: Climbing • To ensure the Common Infected horde are always dangerous, they have the ability to rapidly climb • Climbing is algorithmic, using a similar technique to local obstacle avoidance • Algorithmic climbing solves two major issues • Navigating the complex geometry of the post apocalyptic world of Left 4 Dead • Navigating over movable physics props
  • 30. Goal: Deliver Robust Behavior Performances
  • 31. Goal: Deliver Robust Behavior Performances  Approach • Bot periodically tests for obstacles immediately ahead as it follows its path
  • 32. Goal: Deliver Robust Behavior Performances  Find Ceiling • Once an obstacle has been detected, another hull trace determines the available vertical space above the bot
  • 33. Goal: Deliver Robust Behavior Performances  Find Ledge • The vertical space is then scanned via a series of hull traces from lowest to highest to find the first unobstructed hull trace
  • 34. Goal: Deliver Robust Behavior Performances  Find Ledge Height • Another hull trace downward from the unobstructed trace finds the precise height of the ledge to be climbed
  • 35. Goal: Deliver Robust Behavior Performances  Find Ledge Forward Edge • A final series of downward hull traces that step backwards determine the forward edge of the ledge
  • 36. Goal: Deliver Robust Behavior Performances  Perform Climb • Pick closest match animation from dozens of motion captured climb G rr. A rg h . animations of various height increments
  • 37. Goal: Deliver Robust Behavior Performances  Behaviors and decision making
  • 38. Goal: Deliver Robust Behavior Performances  Locomotion A c to r Owns moving the actor to a new position in the environment (collision L o c o m o ti o n resolution, etc)  Body B ody Owns animation state  Vision Owns line-of-sight, field of view, and V i si o n “am I able to see <X>” queries. Maintains recognized set of entities. In te n ti o n  Intention Contains and manages a system of B e h a vi o r B e h a vi o r concurrent Behaviors (HFSM+Stack) A c ti o n A c ti o n • Behavior Contains and manages a system of A ct i on A ct i on Actions A ct i on A ct i on • Action The building blocks of intentional actions. An Action can contain a child Action, which executes concurrently.
  • 39. Goal: Deliver Robust Behavior Performances  Encapsulation of Action processing • OnStart • Executed when the Action is transtioned into • Can return an immediate transition • Update • Does the “work” of the Action • Update can return a transition to a new Action • OnEnd • Is executed when the Action is transitioned out of • OnSuspend • Executed when Action has been put on hold for another Action • Can return a transition • OnResume • Executed when Action resumes after being suspended • Can return a transition (perhaps Action is no longer valid)
  • 40. Goal: Deliver Robust Behavior Performances  Action Transitions • Continue() No transition, continue this Action next frame. • ChangeTo( NextAction, “reason” ) Exit the current Action and transition into NextAction. • SuspendFor( NextAction, “reason” ) Put the current Action “on hold” (bury it) and enter NextAction. • Done( “reason” ) This Action is finished. Resume the “buried” Action. • “reason” A string documenting the reason why the transition occurred (ie: “The player I was chasing died”). Reason strings help clarify the Action system and are invaluable for realtime debug output.
  • 41. Goal: Deliver Robust Behavior Performances  Encapsulation of Action Transitions • Returning ActionResults enforces atomic transitions since no behavior code can be run between the decision to change to a new Action and the actual change • The only way to go from Action A to Action B is for Action A to return a transition to Action B • There is no way to force a transition from Action A to Action B without Action A’s “knowledge” • Keeps related behavior code encapsulated within the Action
  • 42. Goal: Deliver Robust Behavior Performances  Event Propagation E v e n t: O n In ju re d  Events propagate to all A c to r components L o c o m o ti o n  In the Intention subsystem, events are B ody • First handled by the V i si o n innermost child Action • If child has no response, In te n ti o n event is sent to buried B e h a vi o r B e h a vi o r Action A c ti o n A c ti o n • If no buried Actions have a A ct i on A ct i on response, event is sent to A ct i on A ct i on parent
  • 43. Goal: Deliver Robust Behavior Performances  Example events • OnMoveToSuccess, OnMoveToFailure, OnStuck, OnUnStuck, OnAnimationActivityComplete, OnAnimationEvent, OnContact, OnInjured, OnKilled, OnOtherKilled, OnSight, OnLostSight, OnSound, OnPickUp, OnDrop  Actions can implement event handler methods, providing context-specific reactions to game events
  • 44. Goal: Deliver Robust Behavior Performances  Contextual Query System  Actions can implement query methods, providing context- specific answers to questions  Defines queries that can be asked of the Behavior/Action system as a “black box”  Queries propagate from childmost Action outward until an answer is given, identically to Event propagation  Allows concurrent Behaviors to coordinate • ie: We are able to opportunistically able to pick up an object, should we?
  • 45. Goal: Deliver Robust Behavior Performances  Example Queries • SelectMoreDangerousThreat( me, subject, threat1, threat2 ) • Allows bot to find the most dangerous threat to someone else (ie: an incapacitated player it wants to help) • ShouldPickUp • ShouldHurry • IsHindrance
  • 46. Goals of Left 4 Dead AI  Deliver Robust Behavior Performances  Provide Competent Human Player Proxies  Promote Replayability  Generate Dramatic Game Pacing
  • 47. Goal: Provide Competent Human Player Proxies  Survivor Bots • Allowed us to assume 4 player Survivor team for game tuning and balance • Drop in/out (“Take a Break”) incredibly valuable in the wild • Automated stress testing with 4 SurvivorBots and accelerated game time
  • 48. Goal: Provide Competent Human Player Proxies  Believability/Fairness • Players need to believe bot replacements are “fair” • Imperfect knowledge – simulated senses • Simulated aiming • Reaction times • Reliable and predictable decision making • Difficult issue: Rescuing incapacitated humans
  • 49. Goal: Provide Competent Human Player Proxies  Trust • Cooperative nature of game requires close collaboration of Survivor team and implicit trust in teammate’s action choices • SurvivorBots prioritize human teammates over bots • Game “cheats” to guarantee some undesirable events cannot occur • SurvivorBots cannot deal friendly fire damage • SurvivorBots never use Molotovs • If a SurvivorBot ever gets far out of place for any reason, it is teleported near the team when no human is looking at it
  • 50. Goal: Provide Competent Human Player Proxies  SurvivorBots exercised complexity encapsulation • Two concurrent Behavior systems: Main and Legs • Main: Primary decision making, attention, target selection and attack • Legs: Slaved to Main, responsible for staying near team unless otherwise directed • Many hierarchical behavior states reacting to dozens of game events • Interrupting, resuming • Complex contextual decision making • Tank, Witch, Boomer, Smoker, Hunter, Mob rushes, wandering horde, Survivor teammates, item scavenging, healing self, healing teammates, weapon selection, Rescue Closets, incapacitation, limping, complex 3D terrain, movable physics obstacles, transient fires, ladders, elevators, in any combination • Replicating human performance based on actual gameplay experience • Behavior system built to reproduce decisions and actions players make while playing the game
  • 51. Goals of Left 4 Dead AI  Deliver Robust Behavior Performances  Provide Competent Human Player Proxies  Promote Replayability  Generate Dramatic Game Pacing
  • 52. Goal: Promote Replayability  Replayability promotes long-term engagement with the game, resulting in growth of the game’s community • Growing online community results in ongoing sales • Creates exposure opportunities for other related content  Examples: Counter-Strike, Team Fortress, Day of Defeat • Thriving online communities with ongoing sales revenue • Comparatively few maps, played repeatedly for years on end • Unpredictable experience created by interactions between teams of players drives replayability
  • 53. Goal: Promote Replayability  In Left 4 Dead, Procedural Population of enemies and loot strongly promotes replayability • Creates unpredictable encounters analogous to CS, TF, DoD • Game session is viewed as a skill challenge instead of a memorization exercise
  • 54. Goal: Promote Replayability  Static placement of enemies and loot hinders replayability • Players are good at memorizing all static locations • Removes suspense of not knowing what will happen next • Results in “optimal strategy” that works every time • Players expect everyone to have memorized all encounters • Kills cooperation and degenerates into a race  Even multiple sets of manually placed triggers/scripts fails • Players learn all of them, and if they don’t see A, they prepare for B or C, etc.
  • 55. Goal: Promote Replayability Procedurally Populated Environments  How do we procedurally populate the environment with interesting distributions of enemies? • Using Structured Unpredictability • Part of the collection of systems called the “AI Director”
  • 56. Goal: Promote Replayability Procedurally Populated Environments  First, a short summary of tools used to generate Structured Unpredictability • Navigation Mesh • Flow Distance • Potential Visibility • Active Area Set
  • 57. Goal: Promote Replayability Procedurally Populated Environments  The Navigation Mesh • Represents “walkable space” • Originally created for Counter- Strike Bot pathfinding • Useful for general spatial reasoning and spatially localized information • Has area A ever been seen by actor B? • Is area X potentially visible by area Y? • Where is a spot near the Survivors, not visible to any of them? • How far have we traveled to reach this area?
  • 58. Goal: Promote Replayability Procedurally Populated Environments  “Flow Distance” • Travel distance from the starting safe room to each area in the navigation mesh • Following increasing flow gradient always takes you to the exit room • “Escape Route” = shortest path from start safe room to exit • Used as a metric for populating enemies and loot, and for answering questions such as “is this spot ahead or behind the Survivor group”
  • 59. Goal: Promote Replayability Procedurally Populated Environments  The Active Area Set (AAS) E X IT • The set of Navigation Areas surrounding the Survivor team • The AI Director creates/destroys population as the AAS moves through the environment • Allows for hundreds of enemies using a small set of reused entities E NT E R
  • 60. Goal: Promote Replayability Procedurally Populated Environments  Potentially Visible Areas E X IT • The set of Navigation Areas potentially visible to any Survivor E NT E R
  • 61. Goal: Promote Replayability Procedurally Populated Environments  The Active Area Set
  • 62. Goal: Promote Replayability Procedurally Populated Environments  The Active Area Set
  • 63. Goal: Promote Replayability Procedurally Populated Environments  The Active Area Set
  • 64. Goal: Promote Replayability Procedurally Populated Environments  Populating via Structured Unpredictability • Not purely random, nor deterministically uniform • Population functions where space and/or time varies based on designer-defined amount of randomization • Example: Mob spawns • Occur at randomized interval between 90 and 180 seconds • Located at randomized spot “behind” the Survivor team • Structured Unpredictability = Superposition of several of these population functions
  • 65. Goal: Promote Replayability Procedurally Populated Environments  Structured Unpredictability in Left 4 Dead • Wanderers (high frequency) • Common Infected that wander around in a daze until alerted by a Survivor • Mobs (medium frequency) • A large group (20-30) of enraged Common Infected that periodically rush the Survivors • Special Infected (medium frequency) • Individual Infected with special abilities that harass the Survivor team • Bosses (low frequency) • Powerful Infected that force the Survivors to change their strategy • Weapon Caches (low frequency) • Collections of more powerful weapons • Scavenge Items (medium frequency) • Pipe bombs, Molotovs, Pain Pills, Extra Pistols
  • 66. Goal: Promote Replayability Procedurally Populated Environments  Populating Wandering Infected • Stored as a simple count (N) in each area • Counts are randomly determined at map (re)start based on Escape Route length and desired density • When an area enters the AAS • Create N Infected (if possible) • When an area leaves the AAS, or a pending Mob needs more members • Wanderers in the area are deleted and N is increased accordingly • Wanderer count (N) is zeroed: • When an area becomes visible to any Survivor • When the Director is in Relax mode
  • 67. Goal: Promote Replayability Procedurally Populated Environments  Example E X IT • Green areas are entering the AAS and wanderers are being spawned • Red areas are leaving the AAS, and the Infected within will be de-spawned E NT E R
  • 68. Goal: Promote Replayability Procedurally Populated Environments  Populating Mobs • Created at randomized intervals (90-180 seconds on Normal difficulty) • Boomer Vomit forces Mob spawn, resets random interval • Mob size grows from minimum just after spawn to maximum after a duration to balance difficulty of successive, frequent Mobs
  • 69. Goal: Promote Replayability Procedurally Populated Environments  Populating the Special Infected • Created at individually randomized intervals • Use valid area in the AAS not visible by the Survivor team appropriate to Special’s class • Boomers spawn ahead, since they are slow and can’t chase well • Smokers attempt to select areas above the Survivor team
  • 70. Goal: Promote Replayability Procedurally Populated Environments  Where to spawn E X IT • Behind Survivors • Only select valid areas in the AAS that are at or behind the Survivor team’s “flow” distance • 75% of Mobs come from behind, since wanderers and Special/Boss Infected are usually engaged ahead of the team E NT E R
  • 71. Goal: Promote Replayability Procedurally Populated Environments  Where to spawn E X IT • Ahead of Survivors • Only select valid areas in the AAS that are at or greater than the Survivor team’s “flow” distance E NT E R
  • 72. Goal: Promote Replayability Procedurally Populated Environments  Where to spawn E X IT • Near Boomer Vomit Victim • Only select valid areas in the AAS that are near the Boomer Vomit Victim’s “flow” distance E NT E R
  • 73. Goal: Promote Replayability Procedurally Populated Environments  Where to spawn E X IT • Anywhere • Any valid area in the AAS • Default if there are no valid areas in the more specific sets E NT E R
  • 74. Goal: Promote Replayability Procedurally Populated Environments  Boss Population • Positioned every N units along “escape route” +/- random amount at map (re)start. • Three Boss events are shuffled and dealt out: Tank, Witch, and Nothing. • Successive repeats are not allowed (ie: Tank, then Tank again) Tank Witch Witch Tank Witch Tank
  • 75. Goal: Promote Replayability Procedurally Populated Environments  Weapon Caches • Map designer creates several possible weapon caches in each map, the AI Director chooses which will actually exist  Scavenge Items • Map designer creates many possible item groups throughout the map, the AI Direction chooses which groups actually exist  Why designer-placed? • Prediction of possible locations beneficial in this case • Allows visual storytelling/intention • Solves item placement issues (leaning against wall, mounted in gun rack, etc)
  • 76. Goal: Promote Replayability  Procedural Content • Promotes replayability • Solution for linear, yet replayable multiplayer experiences • Greatly multiplies output of development team • Improves community created content
  • 77. Goals of Left 4 Dead AI  Deliver Robust Behavior Performances  Provide Competent Human Player Proxies  Promote Replayability  Generate Dramatic Game Pacing
  • 78. Goal: Generate dramatic game pacing  What do we mean by “dramatic game pacing”? • Algorithmically adjusting game pacing on the fly to maximize “drama” (player excitement/intensity)  Inspired by Observations from Counter-Strike • Natural pacing of CS is "spiky”, with periods of quiet tension punctuated by unpredictable moments of intense combat • Constant, unchanging combat is fatiguing • Long periods of inactivity are boring • Unpredictable peaks and valleys of intensity create a powerfully compelling and replayable experience • Same scenario, often the same map, yet different and compelling experience each round
  • 79. Goal: Generate dramatic game pacing  Adaptive Dramatic Pacing algorithm • Creates peaks and valleys of intensity similar to the proven pacing success of Counter-Strike • Algorithm: • Estimate the “emotional intensity” of each Survivor • Track the max intensity of all 4 Survivors • If intensity is too high, remove major threats for awhile • Otherwise, create an interesting population of threats • Another key system of the “AI Director”
  • 80. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  Estimating the “emotional intensity” of each Survivor • Represent Survivor Intensity as a value • Increase Survivor Intensity • When injured by the Infected, proportional to damage taken • When the player becomes incapacitated • When player is pulled/pushed off of a ledge by the Infected • When nearby Infected dies, inversely proportional to distance • Decay Survivor Intensity towards zero over time • Do NOT decay Survivor Intensity if there are Infected actively engaging the Survivor
  • 81. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  Use Survivor Intensity to modulate the Infected population • Build Up • Create full threat population until Survivor Intensity crosses peak threshold • Sustain Peak • Continue full threat population for 3-5 seconds after Survivor Intensity has peaked • Ensures minimum “build up” duration. • Peak Fade • Switch to minimal threat population (“Relax period”) and monitor Survivor Intensity until it decays out of peak range B uild • This state is needed so current combat engagement can play out Up without using up entire Relax period. Peak Fade won’t allow the Relax period to start until a natural break in the action occurs. • Relax R e lax S us tain • Maintain minimal threat population for 30-45 seconds, or until P e ak Survivors have traveled far enough toward the next safe room, then resume Build Up. P e ak F ad e
  • 82. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  Full Threat Population (Build Up) • Wanderers • Mobs • Special Infected  Minimal Threat Population (Relax) • No Wanderers until team is “calm” • No Mobs • No Special Infected (although existing Specials may attack)  Boss Encounters NOT affected by adaptive pacing • Overall pacing affected too much if they are missing • Boss encounters are intended to change up the pacing anyhow
  • 83. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  An example procedurally generated population
  • 84. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 85. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 86. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 87. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 88. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 89. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 90. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  How the AI Director modulates the population based on the Survivor team’s “emotional intensity”
  • 91. Goal: Generate dramatic game pacing Adaptive Dramatic Pacing  Comparing population after modulation by the AI Director
  • 92. Goal: Generate dramatic game pacing  Adaptive Dramatic Pacing reacts to Survivor team • Generates reliable peaks of intensity without completely overwhelming the team • Because of player variation and procedural threat population, timing and location of peaks will differ each time the game is played  Algorithm adjusts pacing, not difficulty • Amplitude (difficulty) is not changed, frequency (pacing) is  Simple algorithms can generate compelling pacing schedules • Survivor Intensity estimation is crude, yet the resulting pacing works
  • 93. Future Work  Just the beginning… • Expand repertoire of verbs available to the AI Director • Explore further procedural content generation opportunities • How to utilize these systems in other game projects?
  • 94. For more information…  www.L4D.com  www.valvesoftware.com  mike.booth at valvesoftware dot com