Improving Improving AI Decision Modeling AI Decision Modeling - - PowerPoint PPT Presentation

improving improving ai decision modeling ai decision
SMART_READER_LITE
LIVE PREVIEW

Improving Improving AI Decision Modeling AI Decision Modeling - - PowerPoint PPT Presentation

Improving Improving AI Decision Modeling AI Decision Modeling Through Through Utility Theory Utility Theory Dave Mark Kevin Dill Dave Mark Kevin Dill President & Lead AI Engineer President & Lead AI Engineer Designer


slide-1
SLIDE 1

Improving AI Decision Modeling Through Utility Theory Improving AI Decision Modeling Through Utility Theory

Dave Mark President & Lead Designer Intrinsic Algorithm LLC Dave Mark President & Lead Designer Intrinsic Algorithm LLC Kevin Dill AI Engineer Lockheed Martin Kevin Dill AI Engineer Lockheed Martin

slide-2
SLIDE 2

Dave Mark

  • President & Lead Designer of

Intrinsic Algorithm LLC, Omaha, NE

  • Independent Game Studio
  • AI Consulting Company
  • Author of

Behavioral Mathematics for Game AI

slide-3
SLIDE 3

AIGameDev.net:

Trends for 2009 in Retrospect

What's new in 2009 is:

  • 1. There's now an agreed-upon name for this architecture: utility-

based, which is much more reflective of how it works. Previous names, such as "Goal-Based Architectures" that Kevin Dill used were particularly overloaded already.

  • 2. A group of developers advocate building entire

architectures around utility, and not only sprinkling these old- school scoring-systems around your AI as you need them. The second point is probably the most controversial.

http://aigamedev.com/open/editorial/2009-retrospective/

slide-4
SLIDE 4

We do requests…

“Wow… you’ve got a lot of stuff on utility modeling in here… You should do a lecture on this stuff at the AI Summit.”

Daniel Kline Outside P. F. Chang’s Stanford Mall October 2009

slide-5
SLIDE 5

What is “Utility Theory”?

In economics, utility is a measure of the relative satisfaction from, or desirability of, consumption of various goods and services. Given this measure, one may speak meaningfully of increasing or decreasing utility, and thereby explain economic behavior in terms of attempts to increase

  • ne's utility.

http://en.wikipedia.org/wiki/Utility

slide-6
SLIDE 6

What is “Utility Theory”?

  • How much is something worth to me?
  • Not necessarily equal to “value”

– E.g. $20 might mean more or less than $20

  • Allows comparisons between concepts
  • Allows decision analyses between

competing interests

  • “Maximization of expected utility”
slide-7
SLIDE 7

What is “Utility Theory”?

  • Related to…

– Game theory – Decision theory

  • Used by…

– Economics – Business – Psychology – Biology

John von Neumann

slide-8
SLIDE 8

Value Allows Analysis

  • Converting raw numbers to usable concepts

– Distance – Ammo – Health

  • Converting raw numbers to useful concepts

– Distance → Threat – Ammo → Reload Necessity – Health → Heal Necessity

slide-9
SLIDE 9

Value Allows Comparisons

  • By assigning value to a

selection, we can compare it to others

  • Von Neumann and

Morgenstern’s game theory

  • Without value,

comparisons are difficult…

  • r even impossible!
slide-10
SLIDE 10

Marginal Utility

  • Utility isn’t always the same
slide-11
SLIDE 11

Marginal Utility

  • Decreasing Marginal Utility

– Each additional unit is worth less than the one before – The rate of increase of the total utility decreases – Utility of 20 slices != 20 * Utility of 1 slice

Utility per Slice of Pizza

1 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21

Total Utility

1 2 3 4 5 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
slide-12
SLIDE 12

Marginal Utility

  • Increasing Marginal Utility

– Each additional unit is worth more than the one before – The rate of increase of the total utility increases – Utility of 20 Lego != 20 * Utility of 1 Lego

slide-13
SLIDE 13

Converting Data to Concepts

  • What does the information say?
  • Raw data doesn’t mean much without context
  • If data is ambiguous, we can’t reason on it
  • Various techniques to make sense of raw data

– Conversion formulas – Response curves – Normalization (e.g. 0..1)

slide-14
SLIDE 14

Processing One Piece of Info

As the distance changes, how much anxiety do you have?

slide-15
SLIDE 15

Simple Rule

Binary Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Binary

If distance <= 30 then anxiety = 1

slide-16
SLIDE 16

Linear Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Linear

Linear Formula

Anxiety = (100 – distance) / 100

slide-17
SLIDE 17

Exponential Formula

Exponential Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Exponential

Anxiety = (100 – distance3) / (1003)

slide-18
SLIDE 18

Changing Exponents

Exponent Function Variations

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

k = 2, 3, 4, 6

Anxiety = (100 – distancek) / (100k)

slide-19
SLIDE 19

Shifting the Curve

Exponent Function Variations

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

slide-20
SLIDE 20

Threshold / Linear/ Exponential

Exponential Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Binary Linear Exponential
slide-21
SLIDE 21

Logistic Function

x

e y

+ = 1 1

(One of the sigmoid – or “s-shaped” – functions)

slide-22
SLIDE 22

Logistic Function

Logistic Function Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Logist ic

Anxiety = 1/(1+(2.718 x 0.45)distance+40 ) Soft threshold

slide-23
SLIDE 23

Variations on the Logistic Curve

Logistic Function Variations

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Anxiety = 1/(1+(2.718 x 0.45)distance+40 )

slide-24
SLIDE 24

Shifting the Logistic Function

Logistic Function Variations

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Anxiety = 1/(1+(2.718 x 0.45)distance+40 )

slide-25
SLIDE 25

Curve Comparison

Exponential Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Binary Linear Exponent ial Logist ic
slide-26
SLIDE 26

x y

e −

= 1 1 log

Logit Function

slide-27
SLIDE 27

Logit Function

y = loge(x/(1- x ))

Logit Function

  • 5
  • 4
  • 3
  • 2
  • 1

1 2 3 4 5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

slide-28
SLIDE 28

Logit Function

Logit Function Variations

  • 5
  • 4
  • 3
  • 2
  • 1

1 2 3 4 5 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Distance Anxiety

y = log?(x/(1- x ))

slide-29
SLIDE 29

Logit Function

y = loge(x/(1- x ))+5

Logit Function Shifted +5

1 2 3 4 5 6 7 8 9 10 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

slide-30
SLIDE 30

Logit Function Shifted +5 and Divided by 10

0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1

Logit Function

y = (loge(x/(1- x ))+5)/10

slide-31
SLIDE 31

How Do We Model Our Information?

  • Increasing or Decreasing?
  • Rates of change

–Steady or Variable? –Inflection Point?

  • Amount of change

–Constrained or Infinite? –Asymptotic?

slide-32
SLIDE 32

But What Good Is It?

Exponential Threshold

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety

Binary Linear Exponent ial Logist ic

When Anxiety > n then…

slide-33
SLIDE 33

Comparing Apples and Ammo

  • By using normalized utility values, we

can define relationships and comparisons that otherwise would have been obscure

–Risk vs. Reward (game theory) –Fear vs. Hate –Ammo vs. Health

slide-34
SLIDE 34

Comparing Apples and Ammo

  • 100 Health (Max)
  • 75 Health
  • 50 Health
  • 25 Health (??)
  • 5 Health (!!!)
  • 100 Ammo (Max)
  • 75 Ammo
  • 50 Ammo
  • 25 Ammo
  • 5 Ammo

Normalized Importance of Taking Action

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance

Heal Reload

slide-35
SLIDE 35

Comparing Apples and Ammo

  • As health decreases,

urgency to heal increases

  • Make sure we don’t get too

low on health!

  • As ammo decreases,

urgency to reload increases

  • Urgency hits maximum when

we are out of ammo

Normalized Importance of Taking Action

0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance

Heal Reload

slide-36
SLIDE 36

Comparing Apples and Ammo

  • Collect current states of independent

variables

  • Normalize using response curves
  • (Combine as necessary)
  • Compare normalized values and select:

– Highest scoring selection – Weighted random from all choices – Weighted random from top n choices

slide-37
SLIDE 37

Comparing Apples and Ammo

Normalized Importance of Taking Action

0.00 0.25 0.50 0.75 1.00 5 10 15 20

Enemy Strength Threat Level

Threat

0.684

slide-38
SLIDE 38

Comparing Apples and Ammo

Utility Value 0.125 0.118 0.684 50 50 5

Health Ammo Enemies

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 5 10 15 20 Enemy Strength Threat Level Threat

0.684

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance Heal Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 1 11 21 31 41 51 61 71 81 91 101 Value Importance Reload

0.118 0.125

slide-39
SLIDE 39

Comparing Apples and Ammo

Utility Value 0.732 0.118 0.684 35 50 5

Health Ammo Enemies

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 5 10 15 20 Enemy Strength Threat Level Threat

0.684

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance Heal Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 1 11 21 31 41 51 61 71 81 91 101 Value Importance Reload

0.118 0.732

slide-40
SLIDE 40

Comparing Apples and Ammo

Utility Value 0.003 0.729 0.684 85 10 5

Health Ammo Enemies

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 5 10 15 20 Enemy Strength Threat Level Threat

0.684

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance Heal Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 1 11 21 31 41 51 61 71 81 91 101 Value Importance Reload

0.729 0.003

slide-41
SLIDE 41

Comparing Apples and Ammo

Utility Value 0.125 0.016 0.000 50 75

Health Ammo Enemies

Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 5 10 15 20 Enemy Strength Threat Level Threat Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Value Importance Heal Normalized Importance of Taking Action 0.00 0.25 0.50 0.75 1.00 1 11 21 31 41 51 61 71 81 91 101 Value Importance Reload

0.016 0.125

slide-42
SLIDE 42

Comparing Apples and Ammo

  • Don’t simply process 1 potential action at a time

– Should I attack? – Should I reload? – Should I heal? – Should I have a beer?

  • Compare all potential actions to each other

– Of all of the things I could do, which is the most important at this moment?

slide-43
SLIDE 43

Beyond Apples and Ammo

  • Utility measurements can model more than

simply tangible data

  • They can model abstract concepts:

– Threat – Safety – Morale – Emotions

slide-44
SLIDE 44

Stacking Apples and Ammo

  • Individual utility value can be combined to

form new conceptual utilities

  • “Need to take cover”

– Amount of fire being taken (Threat)? – Is it almost time to reload? – Is it almost time to heal? Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3) Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3) Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

slide-45
SLIDE 45

Stacking Apples and Ammo

Relative Utilities 0.000 0.000 0.600 0.156

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

slide-46
SLIDE 46

Stacking Apples and Ammo

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

Relative Utilities 0.200 0.100 0.600 0.429

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

slide-47
SLIDE 47

Stacking Apples and Ammo

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

Relative Utilities 0.400 0.300 0.600 0.819

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

slide-48
SLIDE 48

Stacking Apples and Ammo

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

Relative Utilities 0.200 0.300 0.800 0.884

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

slide-49
SLIDE 49

Stacking Apples and Ammo

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

Relative Utilities 0.400 0.300 0.100 0.137

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

slide-50
SLIDE 50

Stacking Apples and Ammo

Cover = (0.2 + Reload + (Heal x 1.5)) x (Threat x 1.3)

Relative Utilities 0.900 0.900 0.050 0.159

0.000 0.250 0.500 0.750 1.000

Reload Heal Threat Cover

Normalized Utility

slide-51
SLIDE 51

Utility of Time

  • Time can be converted into a utility value

– Time to travel over distance – Time to complete something

  • Utility of time can be used for comparisons
  • Utility of time can modify other utilities
slide-52
SLIDE 52

Utility of Time

10 10

n 2n

=

All other things being equal, select the closest goal

slide-53
SLIDE 53

Utility of Time

10 20

n 2n

??? How does the 2x difference in the relative utility of the goals compare to the 2x difference in the distances?

<

Exponential Threshold 0.00 0.25 0.50 0.75 1.00 10 20 30 40 50 60 70 80 90 100 Distance Anxiety Binary Linear Exponent ial Logist ic
slide-54
SLIDE 54

Utility of Time

New goal Main goal Backtrack! Main goal

By taking the keys out of consideration as a potential action, we neglect to get them as we pass right by them.

slide-55
SLIDE 55

Utility of Time

  • Normalized distance utility as inverse of distance
  • Use as coefficient to modify base utility of getting keys

Utility of Grabbing Keys

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 20 18 16 14 12 10 8 6 4 2 2 4 6 8 10 12 14 16 18 20

Distance Utility

keys

Dist 1

slide-56
SLIDE 56

Utility of Time

Main goal

By keeping the keys in consideration at all times, and factoring in the utility of time, we get them as we pass by them.

Utility of Grabbing Keys 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 20 18 16 14 12 10 8 6 4 2 2 4 6 8 10 12 14 16 18 20 Distance Utility
slide-57
SLIDE 57

Stacking It All Up

Number

  • f Allies

Number

  • f Enemies

Threat Ratio My Health Proximity to Leader Strength

  • f Allies

Strength

  • f Enemies

Allied Strength Enemy Strength My Morale

Retreat Score

Proximity to Base Urgency

“Compartmentalized Confidence”

slide-58
SLIDE 58

???????

Spreading It All Out

Number

  • f Allies

Number

  • f Enemies

Threat Ratio My Health Proximity to Leader Strength

  • f Allies

Strength

  • f Enemies

Allied Strength Enemy Strength My Morale

Retreat Score

Proximity to Base Urgency ???????

??? Score

?????? ??? ?????? ???

??? Score

??????? ?????? ??? ?????? ???

Data processing != Decision processing

slide-59
SLIDE 59

Managing Scalability

  • Don’t perform all calculations every frame

– Every n frames – Use triggered updates

  • Split data calculation off into separate processes

– Used by multiple utility calculations for same agent – Used by decision calculations for multiple agents – Blackboard architecture to manage and store

  • Lends itself well to multi-threading
slide-60
SLIDE 60

Everything is Relative

  • Many AI decision processes (BTs, FSMs):

– Examine one choice at a time and ask “should I do this one thing?” – Are certain parameters met to justify that choice? – If not, move on to the next one in a pre-specified

  • rder
  • What happens if no options meet their criteria?

– Fall back (idle) behavior may not be appropriate – Very susceptible to edge cases

slide-61
SLIDE 61

Everything is Relative

  • Utility-based architectures:

– Continuously analyze all options (rather than just one) – Rate all options based on their respective factors – Select the option that is most appropriate at the time

  • Not based on arbitrary, independent thresholds
  • Handles situational edge cases better
  • Easier to manage potentially conflicting logic
slide-62
SLIDE 62

Dave Mark

Intrinsic Algorithm LLC

Dave Mark

Intrinsic Algorithm LLC

Dave@IntrinsicAlgorithm.com www.IntrinsicAlgorithm.com

(402) 208–7054

IADaveMark

  • n:

Yahoo – AIM – Skype – Twitter IADaveMark

  • n:

Yahoo – AIM – Skype – Twitter

slide-63
SLIDE 63

Kevin Dill

  • 9 year industry veteran
  • Staff Software Engineer, Lockheed Martin
  • Lecturer, Boston University
  • Technical Editor, Charles River Media
slide-64
SLIDE 64

Example: Apartment Shopping

  • Close to work
  • No off-street parking
  • Convenient shopping district
  • Great view… of a used car lot
  • Beautiful loft apartment

Cons Pros 606 Automobile Way, Apt 316

  • Landlady lives upstairs
  • Beautiful wooded lot
  • Nearby parks, bike trails
  • No shopping nearby
  • Electricity & water included
  • 45 minute commute
  • Low rent

Cons Pros 10-B Placid Avenue

slide-65
SLIDE 65

Key Insight

  • We have 12 distinct pros and cons, but only 4

types of considerations:

– Cost – Distance to __________

  • Could be the distance to work, shopping, parking, etc.

– Aesthetic (i.e. how nice looking is the place)

  • Could be interior or exterior
  • Obviously, there is a lot of variability in what people

consider to be “nice”

– Noise restrictions

  • Many of these are reusable in other contexts!!
slide-66
SLIDE 66

Example: Apartment Shopping

  • Close to work
  • No off-street parking
  • Convenient shopping district
  • Great view… of a used car lot
  • Beautiful loft apartment

Cons Pros 606 Automobile Way, Apt 316

  • Landlady lives upstairs
  • Beautiful wooded lot
  • Nearby parks, bike trails
  • No shopping nearby
  • Electricity & water included
  • 45 minute commute
  • Low rent

Cons Pros 10-B Placid Avenue

slide-67
SLIDE 67

Executive Joe

  • Joe is a high-powered executive at a big bank
  • Joe makes lots of money

– Cost doesn’t matter

  • Joe works late most every night

– Exterior aesthetics don’t matter when the sun is down – Distance to recreation doesn’t matter – who has time? – Distance to work, shopping, and parking matter a lot

  • Joe likes to throw big parties

– Interior aesthetics are very important – Joe is not fond of noise restrictions

slide-68
SLIDE 68

Example: Apartment Shopping

  • Close to work
  • No off-street parking
  • Convenient shopping

district

  • Great view… of a used car

lot

  • Beautiful loft apartment

Cons Pros 606 Automobile Way, Apt 316

  • Landlady lives upstairs
  • Beautiful wooded lot
  • Nearby parks, bike trails
  • No shopping nearby
  • Electricity & water included
  • 45 minute commute
  • Low rent

Cons Pros 10-B Placid Avenue

slide-69
SLIDE 69

Stan the Family Man

  • Stan goes to work to put in his time and get home

to his family

  • Stan’s wife wants a nice place with lots of

recreation for the kids… Stan wants something he can afford

  • The apartment needs to be kid-friendly
  • Stan likes to drive – it gives him some quiet time
  • Stan’s family is in bed by 10:00
slide-70
SLIDE 70

Example: Apartment Shopping

  • No off-street parking
  • Great view… of a used car

lot

  • Close to work
  • Beautiful loft apartment
  • Convenient shopping

district Cons Pros 606 Automobile Way, Apt 316

  • Landlady lives upstairs
  • Beautiful wooded lot
  • Nearby parks, bike trails
  • No shopping nearby
  • Electricity & water included
  • 45 minute commute
  • Low rent

Cons Pros 10-B Placid Avenue

slide-71
SLIDE 71

High Principles

  • Modular

– A decision is made up of atomic pieces of logic, called “considerations” – We can easily add and remove considerations

  • Extensible

– We can easily create new types of considerations

  • Reusable

– From decision to decision – From project to project

slide-72
SLIDE 72

Terminology & Architecture

  • Reasoner has a list of possible choices

– E.G. play with a ball, build a swordsman unit, select a particular weapon, play a particular animation, etc.

  • Each choice has a list of considerations

– Considerations evaluate one aspect of the situation

  • Considerations generate appraisals
  • Appraisals inform our final selection
slide-73
SLIDE 73

Consideration

  • Encapsulates one aspect of a larger

decision

– Distance – Selection History – Cost – Benefit – Etc.

  • Parameterized for easy customization

– For this decision and for this character

slide-74
SLIDE 74

Consideration Interface

class IConsideration { public: // Load the data that controls our decisions void Load(const DataNode& node) = 0; // Evaluate this consideration Appraisal Evaluate(const Context& c) = 0; }

Relies on:

– DataNode – Context – Appraisal

slide-75
SLIDE 75

DataNode

  • XML (or equivalent) that contains the

parameterization

  • May be tool-generated (not hand-generated)
  • May be part of a larger AI specification
slide-76
SLIDE 76

Context

  • Contains all of the information the AI needs to

make a decision

  • Provides an abstraction layer between the AI

and the game

– If well implemented, can facilitate porting your considerations from game to game

slide-77
SLIDE 77

Appraisal

  • Generated by the Evaluate() function
  • Drives our final decision
  • Common techniques include:

– Boolean logic (e.g. all appraisals must return TRUE) – Highest score – Weight-based random – Optimize resource allocation to maximize utility

  • Experience has taught me to start as simple as

possible, extend only when necessary

slide-78
SLIDE 78

Simple Utility-Based Appraisals

  • Each appraisal contains two components:

– Base Score: a floating point indicating how good we think this choice is (based on our one consideration) – Veto: a Boolean allowing each consideration to prevent us from selecting the associated choice

  • Calculating total utility for a choice:

– If any consideration sets Veto to false, utility is 0 – Otherwise, add all of the base scores together

slide-79
SLIDE 79

Example: Weapon Selection

  • “Tuning consideration” provides a base score

– A tuning consideration always returns the values specified in data, regardless of the situation

  • “Range consideration” can add utility or veto as needed

– Pistols are better at short ranges, sniper rifles at long

  • “Inertia consideration” adds utility to current choice

– So we don’t change without a good reason

  • “Random noise consideration” has a random base score

– So we don’t always pick the same thing

  • “Ammo consideration” checks if we have ammo
  • “Indoors consideration” prevents grenade use indoors
  • Select the weapon with the best total score
slide-80
SLIDE 80

Appraisal With A Multiplier*

  • Replace Veto parameter with a “Final Multiplier”

– Add all base scores together, then multiply by each of the final multipliers – A multiplier of 0 is still a veto

  • Allows you to scale utility more smoothly/cleanly

– For example, scale sniper rifle utility at short range

  • Other things you could add:

– Exponents – Polynomials – Etc.

* (This is Kevin’s preferred approach.)

slide-81
SLIDE 81

Multi-Utility Appraisals

  • Add a Priority attribute to the appraisal
  • When combining appraisals, take the max Priority

– In other words, if one consideration sets the priority to be high, keep that priority

  • Only consider choices with max priority

– Allows you to say “If X is true, only consider this small set of options.” – For example, force the use of a melee weapon at short range, a ranged weapon at long range

slide-82
SLIDE 82

Summary

  • Modular
  • Extensible
  • Reusable
  • Applicable to a wide variety of game genres and

reasoner architectures

– Kohan 2: Kings of War and Axis & Allies – Prototype dog AI – Iron Man boss AI – Red Dead Redemption

  • Weapon Selection
  • Dialog Selection

– Event selection in All Heroes Die

slide-83
SLIDE 83

References

Dill, Kevin, “Prioritizing Actions in a Goal-Based RTS AI,” AI Game Programming Wisdom 3 Dill, Kevin, “A Pattern-Based Approach to Modular AI for Games,” AI Game Programming Gems 8 Mark, Dave, Behavioral Mathematics for Game AI Alexander, Bob, “The Beauty of Response Curves,” AI Game Programming Wisdom Harmon, Vernon, “An Economic Approach to Goal-Directed Reasoning in an RTS,” AI Game Programming Wisdom Orkin, Jeff, “Constraining Autonomous Character Behavior with Human Concepts,” AI Game Programming Wisdom 2 Garces, Sergio, “Extending Simple Weighted Sums,” AI Game Programming Wisdom 3

slide-84
SLIDE 84

Questions?

Dave Mark

Intrinsic Algorithm LLC

Dave Mark

Intrinsic Algorithm LLC

Dave@IntrinsicAlgorithm.com www.IntrinsicAlgorithm.com

(402) 208–7054 IADaveMark

  • n:

Yahoo – AIM Skype – Twitter IADaveMark

  • n:

Yahoo – AIM Skype – Twitter

Kevin Dill

Lockheed Martin

Kevin Dill

Lockheed Martin

kdill4@gmail.com