Killzone’s AI:Dynamic Procedural TacticsArjen Beij & Remco Straatman August 31, 2005                          Killzone’s A...
Contents Dynamic procedural tactics    Position picking    Position Evaluation functions    Tactical path-finding    ...
Dynamic Procedural TacticsDynamic procedural tactics = Having the rules and concepts to  dynamically compute  solutions t...
AI TacticsCommon approach Level designer placed hints Triggered scripted behaviorAugust 31, 2005                        ...
Dynamic Procedural TacticsGame-play benefits Works for any number of players Fights anywhereProduction benefits Reuse o...
Position Picking                                  Outside                                                                 ...
Position Evaluation FunctionsDetermining the most appropriate position Given n potential destinations To compare positio...
Example: Picking an Attack       Position 1Example: Picking an attack position Multiple threats   Attack primary threat ...
Example: Picking an Attack       Position 2               Initial situation: three threats, some walls and a waypoint grap...
Example: Picking an Attack       Position 3              Selected nearby waypoints, annotated with proximity (weight 20)Au...
Example: Picking an Attack       Position 4         Annotations for LoF to primary threat (40 if partial cover, 20 otherwi...
Example: Picking an Attack       Position 5                   Annotations for cover from secondary threats (weight 20)Augu...
Example: Picking an Attack       Position 6              Annotations positions inside preferred fighting range (weight 10)...
Example: Picking an Attack       Position 7                                    +          Adding up all the annotations yi...
Example: Picking an Attack       Position 8              Single threat                                 Multiple threatsAug...
Configurable and Dynamic                                                                           Personality:Configurabl...
Tactical Path-findingShortest paths often aren’t tactically sound                                   1                     ...
Tactical Path-findingPosition evaluations functions in path finding In A*, add to the costs of traveling a link:    Trav...
Example: Tactical Path-finding       1             Costs to travel each waypoint link, and the resulting shortest path.Aug...
Example: Tactical Path-finding       2      Link costs now reflect being under fire, and the corresponding tactical path.A...
Example: Tactical Path-finding       3 B                  B                                     T                         ...
Suppression FireSuppression fire: Fire near hidden threats to pin them downNot: Firing into the wall behind which the th...
Example: Suppression Fire 1What we want Deny the threat use of good attack positions By shooting bursts at these positio...
Example: Suppression Fire 2         A hidden threat (left), attacker (right) and the intended suppression fire.August 31, ...
Example: Suppression Fire 3       Selecting the waypoints in close proximity to the presumed threat positionAugust 31, 200...
Example: Suppression Fire 4        Annotations (20, 30) for offering the threat a LoF to the attacker (right).August 31, 2...
Example: Suppression Fire 5  Annotation of 20 for positions offering the threat nearby cover from the attacker.August 31, ...
Example: Suppression Fire 6           Selecting those positions with score     40 yields the suppress targets.August 31, 2...
Example: Suppression Fire 7                   Merging suppression targets that overlap in yaw and pitch.August 31, 2005   ...
Example: Suppression Fire 8             The attacker’s view of suppression targets near the hidden threat.August 31, 2005 ...
Example: Suppression Fire 9                      attacker PoV                                target PoVAugust 31, 2005    ...
World RepresentationPre-conditions for dynamic procedural tactics1. Navigation info, with fine enough resolution   to repr...
Lines-of-Fire Representation 1Tactical decisions Involve hundreds of LoF checks Ray casts typically expensiveUse a small...
Lines-of-Fire Representation 2                                                                Compression:                ...
ConclusionsKillzone was released for PS2 late 2004 Tactical position picking Tactical path-finding Suppression by infan...
Conclusions - Killzone’s AIPros Share/reuse behavior across games Quick level prototyping Can be combined with scriptin...
Conclusions – Game AIPosition evaluation functions are powerful Robust decisions with many (dynamic) inputs Different be...
Further InfoOff-line Our proceedings paper provides more details, notably on the terrain   representation and grenade han...
Questions?August 31, 2005                          Killzone’s AI:Game Developer Conference Europe   Dynamic Procedural Tac...
Upcoming SlideShare
Loading in …5
×

Killzone's AI: Dynamic Procedural Tactics

4,082 views

Published on

Dynamic tactical position evaluation functions are procedures that use static and dynamic information about the world to make tactical decisions at run-time. By having NPCs use a procedural description of the solution to a tactical decision, the solution can vary depending on the inputs. Using static information about the world as input makes sure the tactics are applicable at any place on the map. Using dynamic inputs makes sure they are applicable in multiple situations.

  • Be the first to comment

Killzone's AI: Dynamic Procedural Tactics

  1. 1. Killzone’s AI:Dynamic Procedural TacticsArjen Beij & Remco Straatman August 31, 2005 Killzone’s AI: Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 1
  2. 2. Contents Dynamic procedural tactics Position picking Position Evaluation functions Tactical path-finding Suppression Fire World Representation ConclusionsAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 2
  3. 3. Dynamic Procedural TacticsDynamic procedural tactics = Having the rules and concepts to dynamically compute solutions to tactical problemsAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 3
  4. 4. AI TacticsCommon approach Level designer placed hints Triggered scripted behaviorAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 4
  5. 5. Dynamic Procedural TacticsGame-play benefits Works for any number of players Fights anywhereProduction benefits Reuse of AI behavior Quick level prototyping Roll out improvements game wideAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 5
  6. 6. Position Picking Outside Wall danger zone Hugging Nearby Picking a good position Partial Cover Cover is half the battle in ‘fire & maneuver’ combat Line of Fire Proximity Preferred Range Account for dozens of (dynamic) factors How to pick that position?August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 6
  7. 7. Position Evaluation FunctionsDetermining the most appropriate position Given n potential destinations To compare positions, need a single valueUse position evaluation function Weighted sum Combines basic factorsAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 7
  8. 8. Example: Picking an Attack Position 1Example: Picking an attack position Multiple threats  Attack primary threat  Cover from other threats preferred Partial cover from primary Proximity Preferred fighting range Combine into a single value per positionAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 8
  9. 9. Example: Picking an Attack Position 2 Initial situation: three threats, some walls and a waypoint graphAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 9
  10. 10. Example: Picking an Attack Position 3 Selected nearby waypoints, annotated with proximity (weight 20)August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 10
  11. 11. Example: Picking an Attack Position 4 Annotations for LoF to primary threat (40 if partial cover, 20 otherwise)August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 11
  12. 12. Example: Picking an Attack Position 5 Annotations for cover from secondary threats (weight 20)August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 12
  13. 13. Example: Picking an Attack Position 6 Annotations positions inside preferred fighting range (weight 10)August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 13
  14. 14. Example: Picking an Attack Position 7 + Adding up all the annotations yields the most promising attack positionAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 14
  15. 15. Example: Picking an Attack Position 8 Single threat Multiple threatsAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 15
  16. 16. Configurable and Dynamic Personality:Configurable Action: What factors are What kind of position? important? Position evaluation function Dynamic Current situation: Squad: Where are the threats? Additional constraints August 31, 2005 Killzone’s AI: Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 16
  17. 17. Tactical Path-findingShortest paths often aren’t tactically sound 1 2 3For example:1. Paths traversing friendly lines-of-fire2. Paths ignoring cover from hostile fire3. Paths leaving the AI exposed unnecessarilyAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 17
  18. 18. Tactical Path-findingPosition evaluations functions in path finding In A*, add to the costs of traveling a link:  Traversing a friendly lines-of-fire  Being under fire from one or more threatsAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 18
  19. 19. Example: Tactical Path-finding 1 Costs to travel each waypoint link, and the resulting shortest path.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 19
  20. 20. Example: Tactical Path-finding 2 Link costs now reflect being under fire, and the corresponding tactical path.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 20
  21. 21. Example: Tactical Path-finding 3 B B T T shortest path versus tactical path A AAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 21
  22. 22. Suppression FireSuppression fire: Fire near hidden threats to pin them downNot: Firing into the wall behind which the threat is hiding Firing into locations the threat cannot reachAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 22
  23. 23. Example: Suppression Fire 1What we want Deny the threat use of good attack positions By shooting bursts at these positionsHow we implement it using position evaluation Evaluate threat’s attack positions from his perspective Select those attack positions we can fire intoAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 23
  24. 24. Example: Suppression Fire 2 A hidden threat (left), attacker (right) and the intended suppression fire.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 24
  25. 25. Example: Suppression Fire 3 Selecting the waypoints in close proximity to the presumed threat positionAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 25
  26. 26. Example: Suppression Fire 4 Annotations (20, 30) for offering the threat a LoF to the attacker (right).August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 26
  27. 27. Example: Suppression Fire 5 Annotation of 20 for positions offering the threat nearby cover from the attacker.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 27
  28. 28. Example: Suppression Fire 6 Selecting those positions with score 40 yields the suppress targets.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 28
  29. 29. Example: Suppression Fire 7 Merging suppression targets that overlap in yaw and pitch.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 29
  30. 30. Example: Suppression Fire 8 The attacker’s view of suppression targets near the hidden threat.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 30
  31. 31. Example: Suppression Fire 9 attacker PoV target PoVAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 31
  32. 32. World RepresentationPre-conditions for dynamic procedural tactics1. Navigation info, with fine enough resolution to represent cover locations  Waypoints, nav meshes, cells: any will do2. Fast Line-of-Sight/Line-of-fire checksAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 32
  33. 33. Lines-of-Fire Representation 1Tactical decisions Involve hundreds of LoF checks Ray casts typically expensiveUse a small pre-computed look-up table Multiple stances, minor movement Pessimistic about cover Polar representationKillzone’s LoF table for 4000 waypoints: 64KBAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 33
  34. 34. Lines-of-Fire Representation 2 Compression: For every waypoint, per radial sector, record the largest distance from where an attacker within that sector can fire at the waypoint. Inaccurate, but consistent.August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 34
  35. 35. ConclusionsKillzone was released for PS2 late 2004 Tactical position picking Tactical path-finding Suppression by infantry and mounted MGs Indirect fire for hand grenades and tank shells Single and multiplayer AI Up to 14 AI characters fighting simultaneouslyAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 35
  36. 36. Conclusions - Killzone’s AIPros Share/reuse behavior across games Quick level prototyping Can be combined with scripting Fights anywhere, anytime, SP or MPCons Harder to control in detail Harder to testAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 36
  37. 37. Conclusions – Game AIPosition evaluation functions are powerful Robust decisions with many (dynamic) inputs Different behavior through configuration Many tactics can be implemented through position evaluationDynamic procedural tactics Responsive AI behavior Within reach of many gamesAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 37
  38. 38. Further InfoOff-line Our proceedings paper provides more details, notably on the terrain representation and grenade handling Lars Lidén, Strategic and Tactical Reasoning with Waypoints in AI Game Programming Wisdom, Charles River Media, 2002 Paul Tozour, Using a Spatial Database for Runtime Spatial Analysis in AI Game Programming Wisdom 2, Charles River Media, 2003 William van der Sterren, Tactical Path-Finding with A* in Game Programming Gems 3, Charles River Media, 2002On-line William van der Sterren’s collection of links to on-line papers at: www.cgf-ai.com/links.htmlAugust 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 38
  39. 39. Questions?August 31, 2005 Killzone’s AI:Game Developer Conference Europe Dynamic Procedural Tactics Guerrilla Games - 39

×