1 / 72

The Art of Game AI: Sculpting Behavior with Data, Formulas, and Finesse

The Art of Game AI: Sculpting Behavior with Data, Formulas, and Finesse. Dave Mark President & Lead Designer Intrinsic Algorithm LLC. Kevin Dill R* New England Blue Fang Boston University. Dave Mark. President & Lead Designer of Intrinsic Algorithm LLC Game Studio AI Consulting Company

Download Presentation

The Art of Game AI: Sculpting Behavior with Data, Formulas, and Finesse

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. The Art of Game AI:Sculpting Behavior withData, Formulas, and Finesse Dave MarkPresident & Lead DesignerIntrinsic Algorithm LLC Kevin DillR* New England Blue Fang Boston University

  2. Dave Mark • President & Lead Designer ofIntrinsic AlgorithmLLC • Game Studio • AI Consulting Company • Author of Behavioral Mathematics for Game AI • Co-founder ofAI Game Programmers Guild • Organizer and co-host of theAI Summit at GDC 2009 (soon to be 2010!)

  3. Premises/Disclaimers The examples you will see are only scratching the surface. There is no way to show concrete implementation in a 1-hour lecture. We want to make you thinkaboutwhat you can do.

  4. What makes a game a game? “A game isa series of interesting choices.” - Sid Meier

  5. AI is Your World! Boring AI = Boring World Deep AI = Immersive World Repetitive AI = Monotonous World Dynamic AI = Dynamic World

  6. What is your reaction? • Want to pet • Want to meet • Just curious • Annoyed • Want to kick • Want to run screaming

  7. Now what is your reaction? • Want to pet • Want to meet • Just curious • Annoyed • Want to kick • Want to run screaming

  8. Varieties of Reactions

  9. Same Model for All Agents Extreme Reactions

  10. Varieties of Reactions • Differences Exist • Don’t need to know why • Need to simulate that difference do exist • Not completely random selection • Must be reasonable

  11. How Can We Express Differences? • Not that information exists (e.g. yes or no) but what that information says. • Identifying more than one factor for input • Allowing for more than one possible result

  12. How Can We Express Differences? • Not that information exists (e.g. yes or no) but what that information says. • Identifying more than one factor for input • Allowing for more than one possible result

  13. Processing One Piece of Info Simple example:As the distance changes,how much anxiety do you have?

  14. Simple Rule If distance <= 30

  15. Linear Formula Anxiety = (100 – distance) / 100

  16. Exponential Formula Anxiety = (100 – distance3) / (1003)

  17. Threshold / Linear/ Exponential

  18. Changing Exponents Exponents of 2, 3, 4, 6

  19. Shifting the Curve

  20. Logistic Function

  21. Logistic Function Anxiety = 1/(1+(2.718 x 0.45)distance+40 )

  22. Curve Comparison

  23. Variations on the Logistic Curve

  24. Shifting the Logistic Function

  25. How Can We Express Information? • Increasing or Decreasing? • Rates of change • Steady or Variable? • Inflection Point? • Amount of change • Constrained or Infinite? • Asymptotic?

  26. Know when to walk away… • Design Decision: “Enemies don’t always fight to the death” • Enemies can sometimes retreat • Flat % chance • Is random… therefore looks random • Not realistic • Situational random • Based on circumstances • Circumstances are flexible and dynamic

  27. Know when to walk away…

  28. Know when to walk away… How many on my side are still fighting? 8 1.6 5 How many of my enemies are still fighting?

  29. Know when to walk away… PercentChance = (4 – Ratio)4 / (44)

  30. Know when to walk away… PercentChance = (4 – Ratio)4 / (44) PercentChance = (4 – 1.6)4 / (44) PercentChance = 13%

  31. Know when to walk away…

  32. Know when to walk away… How many on my side are still fighting? 7 1.4 5 How many of my enemies are still fighting?

  33. Know when to walk away… PercentChance = (4 – Ratio)4 / (44) PercentChance = (4 – 1.4)4 / (44) PercentChance = 18%

  34. Know when to walk away… PercentChance = (4 × Ratio)4 / (44)

  35. Know when to walk away…

  36. How Can We Express Differences? • Not that information exists (e.g. yes or no) but what that information says. • Identifying more than one factor for input • Allowing for more than one possible result

  37. Know when to walk away… PercentChance = ( ( MaxRatio – Ratio )k× MaxPct)/ (MaxRatio k )

  38. Know when to walk away… ( ( 4 – Ratio )4 × 1.00 ) / ( 44 ) ( ( 4 – Ratio )6 × 0.75 ) / ( 46 ) ( ( 4 – Ratio )8 × 0.50 ) / ( 48 )

  39. Know when to walk away… • Factors to Consider • Number of allies • Number of enemies • Proximity to Base • Strength of allies • Strength of enemies • My own health • Proximity of my leader

  40. Know when to walk away… Numberof Allies Strengthof Allies Numberof Enemies Strengthof Enemies Allied Strength Enemy Strength Proximityto Leader My Health Proximityto Base Threat Ratio My Morale “Compartmentalized Confidence” Urgency Retreat %

  41. How does this look to the players? • Enemies aren’t completely fearless • They are slightly unpredictable • They are still reasonable • Curiosity: “Where is he going?” • “If we show force, they might break and run.” • “If we back them up, they are more aggressive.” • We have to react to their reactions.

  42. How Can We Express Differences? • Not that information exists (e.g. yes or no) but what that information says. • Identifying more than one factor for input • Allowing for more than one possible result

  43. More than “Fight or Flight” • Fight normally • Flee • Charge

  44. More than “Fight or Flight”

  45. Fight Melee weapon Ranged weapon Special rare weapon Advance Press forward Berserker charge Retreat Fighting withdrawal Find Cover Organized pull back Flee in abject terror Surrender More than “Fight or Flight” Too many individual curves!!

  46. More than “Fight or Flight”

  47. More than “Fight or Flight”

  48. More than “Fight or Flight” “Normal” “Wounded” How do we get to this point?

  49. Selecting from Multiple Actions • We can’t run one check for each possible action • Too cumbersome • Each action is mathematically independent • Structure to place all possible actions in play at the same time. • Auto-balancing • Expandable • Easy to select one action

  50. Preferences = Differences

More Related