Embracing Emergent Behavior with Goal-Based AI Kevin Dill [email protected].
-
date post
19-Dec-2015 -
Category
Documents
-
view
238 -
download
0
Transcript of Embracing Emergent Behavior with Goal-Based AI Kevin Dill [email protected].
![Page 2: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/2.jpg)
Blue Fang Games
“To create compelling, emotionally engaging games, focused on the animal kingdom, that set the benchmark for broad-based family entertainment.”
![Page 3: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/3.jpg)
![Page 4: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/4.jpg)
The Plan• Motivation
• Kohan 2 Demo
• Common AI Techniques
• Goal-based AI
• Boxy-dog Demo
• Questions
![Page 5: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/5.jpg)
The Plan• What I Want:
– Cunning Opponents– Responsive Allies– Replayability– Organic Credibility – Emotional Appeal– Compelling Performances
• Or, more generally:– Situational Awareness– Emergent Behavior
![Page 6: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/6.jpg)
Motivation, cont.• Declarative AI (vs. Procedural AI)
– Wikipedia: A program is “declarative” if it describes what something is like, rather than how to create it.
– Developers role: not to tell the AI what to do, but to tell the AI how to decide for itself.
![Page 7: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/7.jpg)
![Page 8: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/8.jpg)
Techniques – Scripted AI• AI Follows a script, much like a movie
– Script specifies exactly what will happen, when it will happen, where it will happen
• Advantages:– Gives designers explicit control – Easy to write– Easy to balance
• Disadvantages– Repetitive and predictable
![Page 9: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/9.jpg)
Techniques – State Machines• A “state” is defined for every high-level
action the AI can take
• Transitions are defined to move from one state to another state
• Each state has custom code to control the character while in that state
![Page 10: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/10.jpg)
First Person Shooter Example
Get Ammo
Get Health
Run Away
Search For Enemy
Attack
Ene
my
Fou
nd
Enem
yLost
Low on A
mm
oLow
on
Hea
lth
Got
Aw
ay,
Low
on
Hea
lth
Got
Hea
lth
Got Ammo
Got
Aw
ay,
Low
on
Am
mo
![Page 11: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/11.jpg)
Techniques – State Machines• Advantages:
– Easy to conceptualize– Easy to implement– Middleware tools exist
• Disadvantages:– Complexity scales poorly as AI grows– Rampant duplication of code– Can only do one thing at a time
![Page 12: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/12.jpg)
Techniques – Goal Based AI• A “goal” is defined for every high-level
action that the AI can take
• Each goal is assigned a priority:– Base priority (evaluate current situation)– Allocate resources– Optimize resources and calculate final priority
• Highest priority goal(s) are executed
![Page 13: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/13.jpg)
Goal Types• Some common RTS goals:
– Attack – Construct Building– Defend – Repair Building– Explore – Upgrade Building– Recruit Unit – Sell Building– Recover Health – Give Resources To Ally– Research
![Page 14: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/14.jpg)
Techniques – Goal Based AI• Advantages
– Flexible and powerful– Complexity scales fairly well as AI grows– Can execute more than one goal at a time– Emergent behavior
• Disadvantages:– Priority calculations (“Bucket of Floats”)– Emergent behavior
![Page 15: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/15.jpg)
Goal Selection Basics• WWHD (What Would a Human Do?)
– Write down a list of the factors you would consider if you were playing the game
• Some common tricks:– Bonuses – Repeat Penalties– Multipliers – One-Time Bonuses– Exponents – Actor Categories– Fuzzy Factors – Templates
![Page 16: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/16.jpg)
Example: Attack Goal• Base priority:
– Actor value for the most desirable building or unit in the area (taking into account enemy’s economy if appropriate)
– Travel Distance– Intervening targets (attack goals only)
![Page 17: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/17.jpg)
Attack Goal, cont.• Priority Curve:
– Target CV ratio– Min CV to assign– Low CV exponent – Max advantage– Max multiplier
• Other considerations– Combined arms– Wall strength– Adjusting builder CV
My CV / Enemy CV
1.2 3.0
Mul
tiplie
r
1x
2x
Target CV Ratio
* CV = Combat Value
![Page 18: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/18.jpg)
Loose Ends• Goal Commitment
– IF: you can’t afford something now– BUT: you will be able to soon– THEN: don’t perform lower priority goals that
use the same resource
• Goal Inertia– Bonus to keep doing what you’re doing
• Locked Goals– Disable all other goals until current goal is
complete
![Page 19: Embracing Emergent Behavior with Goal-Based AI Kevin Dill kad@bluefang.com.](https://reader035.fdocuments.us/reader035/viewer/2022062506/56649d3f5503460f94a17db1/html5/thumbnails/19.jpg)
Jack the Terrier