Diese Präsentation wurde erfolgreich gemeldet.
Wir verwenden Ihre LinkedIn Profilangaben und Informationen zu Ihren Aktivitäten, um Anzeigen zu personalisieren und Ihnen relevantere Inhalte anzuzeigen. Sie können Ihre Anzeigeneinstellungen jederzeit ändern.

Beyond Killzone: Creating New AI Systems for Horizon Zero Dawn

2.077 Aufrufe

Veröffentlicht am

Download the full presentation here: https://www.guerrilla-games.com/read/beyond-killzone-creating-new-ai-systems-for-horizon-zero-dawn

Abstract : Having established AI tech in your studio is great… until your next game adds demands well over and above what your existing systems were designed to handle. This session describes the changes that Guerilla made to switch from having to support a single human enemy in closed corridor spaces to a game with more than 25 wildly different characters in a large open world. Specifically, the lecture explains how they changed the navigation and animation systems that made the characters in Horizon Zero Dawn move realistically. Additionally, they detail how these changes impacted their workflow throughout the project.

Veröffentlicht in: Software
  • Als Erste(r) kommentieren

Beyond Killzone: Creating New AI Systems for Horizon Zero Dawn

  1. 1. Beyond 'Killzone': Creating New AI Systems for 'Horizon Zero Dawn' Julian Berteling
  2. 2. How do we make these characters move naturally?
  3. 3. Prototyping
  4. 4. Optimal vs Natural
  5. 5. Topics • Navigation & Planning – Navigation Mesh – NPC Avoidance – Path Following • Locomotion – Sampling – Melee Combat – Look at system
  6. 6. Navigation in Killzone • Waypoint grid with variable radius – Generated offline • Used for – Pathfinding – Position Picking – Covermap
  7. 7. Issues • Shrinking was uniform • Links could easily be blocked • Large clusters connected by few links
  8. 8. Issues • Not suited for large world • Hard to keep navigation data up to date – Some obstacles placed at runtime • Large physical differences between characters
  9. 9. Navigation in Horizon
  10. 10. Obstacles • Object related to navmesh are painted on mesh itself • Stealth areas • Avoid unless in combat • Danger areas • Destructible obstacles
  11. 11. Navigation Mesh • Switched from Waypoints to Navigation Mesh • Offline to Runtime generation • Multiple Meshes • Behavior influences obstacle costs
  12. 12. Killzone Avoidance • Few characters in same space • Move only short distances • Stay within pre-planned corridor path
  13. 13. Avoidance • Needs to work with elongated entities – So cant implement solutions that only rely on circles, needed support for rectangular obstacles
  14. 14. Velocity Obstacles • Tried and proven • Shape agnostic • Can be expensive for many obstacles • Optimizations such as ORCA did not work well with rectangular obstacle
  15. 15. Velocity Obstacles • Gather most relevant obstacles • Max 5 obstacles with lowest time till collision • Ignore character with a lower avoidance priority
  16. 16. VO Creation
  17. 17. Picking Avoidance Direction • Generate safe target velocities • Pick one target velocity according to a scoring function
  18. 18. Result • Desired avoidance velocity used as input in path smoothing
  19. 19. Notes on avoidance • Looked good for robots, not humans • Hard to find an optimal solution – Optimal does not always look natural • Looking into more natural avoidance solutions – Using machine learning to imitate real life avoidance patterns – Embrace failure when not easy to avoid. • More in depth in upcoming Game AI Pro 4: – Obstacle avoidance for robots of multiple sizes and forms in Horizon Zero Dawn by Carles Ros Martinez
  20. 20. Killzone Path Following
  21. 21. Horizon Path Following • Used Bezier Path Smoothing – Has been done before – Simple to implement – Worked for all types of characters
  22. 22. Bezier Path
  23. 23. Bezier Path • Tangent placement was based on: – Path polyline – Entity velocity or avoidance direction – Optional modifier that changes the length of the first tangent • Can make turns sharper or more shallow based on the NPC’s size
  24. 24. Bezier Path • Tangents and original path segment created a hull which was checked on the Navmesh
  25. 25. Notes on Bezier Smoothing • Smoothed path deviated a lot from the original straightened path.
  26. 26. Notes on Bezier Smoothing • Difficult to take characters max curvature (turning radius) into account.
  27. 27. Notes on Bezier Smoothing • Constraining the tangent length to the NavMesh means no curvature continuity.
  28. 28. New path following • Disclaimer, this didn’t make it in Horizon Zero Dawn!
  29. 29. Railroads!
  30. 30. Clothoid • Also known as Euler or Cornu spirals • Curvature increases with its length • Has support for number of constraints: – Maximum curvature – Curvature rate of change as parameter
  31. 31. • Create the default turn circle based on characters desired speed, maximum curvature and sharpness Max curvature Min curvature Clothoid Straight Line
  32. 32. • Next target to move towards: • Point in path • Avoidance direction Max curvature Min curvature Clothoid Straight Line
  33. 33. • Sharpness is calculated • Avoidance is always done at maximum sharpness • Follow the pre-calculated turn circle Max curvature Min curvature Clothoid Straight Line Circular Arc
  34. 34. String Pulling • Still deviate a lot from planned point path
  35. 35. Adjusted String Pulling Algorithm • Provides clearance of the NavMesh wall • Allows the character to cut off the corners, follow rest of polyline more exact • Based on simple funnel algorithm: – http://digestingduck.blogspot.nl/2010/0 3/simple-stupid-funnel-algorithm.html
  36. 36. • Create a funnel from starting position to portal points
  37. 37. • Check next 2 points, Set funnel side to each point if inside funnel
  38. 38. • Starts out the same way, until one side crosses the other
  39. 39. • Distance is approximated based on the default turn circle and wall angle • Offset is bounded by opposite wall
  40. 40. Topics • Navigation & Planning – Navigation Mesh – NPC Avoidance – Path Following • Locomotion – Sampling – Melee Combat – Look at system
  41. 41. Locomotion • AI needs information about it locomotion capabilities • Required to play full body animation correctly
  42. 42. Locomotion sampling • Sample relevant animation blend trees • Captures: – Rootbone transformations – Animation duration – Animation meta-data (triggers and events) • Stored in Motion Table
  43. 43. Motion Table
  44. 44. Motion Table Motion Table 1 2 Sample 1 1.5 -90 Sample 2 1.5 0 Sample 3 1.5 90 Sample 4 3.5 -
  45. 45. Motion Table Blend Values Motion Table 1 2 0 Sample 1 1.5 -90 0.75*0.5 Sample 2 1.5 0 0.75*0.5 Sample 3 1.5 90 0.25 Sample 4 3.5 - Motion when? • Direction = 45 • Speed = 2
  46. 46. Stop prediction • Stopping exactly at the right position – Requires lots of animations – Or animation adjustments • Use motion table to find right point to trigger stop
  47. 47. Motion Table • AI more informed of animation capabilities • Becomes more useful for large set characters • Gives control and freedom to Animators
  48. 48. Melee Combat • Killzone melee was limited
  49. 49. Stage 1: Triggering the Attack
  50. 50. Stage 2: Wind up
  51. 51. Step 3: Attack! • End up with target position • But how do we get there? – Most attacks only have one full body animation
  52. 52. Animation Warping • Adjust rootbone transformation of animation • Added over entire animation, or only part of it
  53. 53. More info • Paul van Grinsven @ GDC17: Player Traversal Mechanics In The Vast World Of Horizon: Zero Dawn • Jake Campbell @ GDC17: Bringing Hell to Life: AI and Full Body Animation in DOOM
  54. 54. Melee Combat • Motion Table informs AI of attack properties • Used in every stage of attack • Minimizes runtime adjustments
  55. 55. Look At • IK replaces all joint rotation in IK chain • Makes characters look unnatural
  56. 56. Look At • Replaced IK System • Use additive rotation • Define reference orientation • Calculate and spread out delta over desired bones • Note: Not Precise!
  57. 57. Look At • Variable preference between reference orientation and current rotation • Preferring current rotation will negate any rotation applied by source animation, making it more precise • This is used to make the look at more precise when the target is close.
  58. 58. Conclusion • Optimal vs Natural • Focus on the character

×