Héctor MuñozAvila Some Interesting Facts About the Game Industry As of 2004 the game industry is at least as large measured in terms of revenue as the movie Hollywood industry As of 2007 the video game sector remains one of the aboveaverage growth segments of the US and global ente ID: 814764
Download The PPT/PDF document "Game AI versus AI: An Introduction to AI..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.
Slide1
Game AI versus AI: An Introduction to AI Game Programming
Héctor Muñoz-Avila
Some Interesting Facts About the Game Industry
As of 2004, the game industry is at least as large (measured in terms of revenue) as the movie (Hollywood) industry
As of 2007, the video game sector remains one of the above-average growth segments of the U.S. and global entertainment industries
Video game sales remains strong today. As an example, sales of the latest World of Warcraft expansion (November/2010) outpaced previous expansions
Slide3AI vs
Game AI
We need to
understand the connections and the misconceptions from both sides
AI
research
A
C
B
A
B
C
A
C
B
C
B
A
B
A
C
B
A
C
B
C
A
C
A
B
A
C
B
B
C
A
A
B
C
A
B
C
A
B
C
Game AI
as game practitioners implemented it
Slide4Game AI
Do you know what is attack Kung-Fu style?
http://
www.youtube.com/watch?v=q1yId7Ug2Mg
Slide5Half-Life: Gordon Freeman’s First Encounter with the Marines
Do they attack Kung-Fu style?
Slide6Half-Life Kung-Fu Attack
http://
www.youtube.com/watch?v=dKNGRuXVa4U
Actually no more than 2 marines are attacking at any time
The other marines take cover, move around etc.
When one of the attacking marines run out of ammo, is wounded, dies, etc., one of the others take his place
Some reactions are hard-coded and scenario-dependent
Slide7Game AI
Term refers to the algorithms controlling:
The computer-controlled units/opponents
Gaming conditions (e.g., weather)
Path finding
Attack Kung-Fu style is an example of game AI for the computer opponent
Programming intentional mistakes is also part of controlling the computer opponent “AI”
Slide8Programming “Good” AI Opponent
(according to Lars Liden; Ch. 2; AIWS1)
Enemies move before firing
Make mob/enemy visible
Announce enemy presence by sound or other means
http://www.youtube.com/watch?v=vL8YfqyU4Fo&feature=related
Slide9Programming “Good” AI Opponent (II)
(according to Lars Liden; Ch. 2)
Have horrible aim (rather than doing less damage)
Miss the first time
Warn the player (e.g., music, sound)
Kung-Fu attacks
Slide10Some AI Topics
Search
Planning
Game theory
Machine
learning
Case-based reasoning
RoboticsComputer vision
Neural networks
Some of which have been applied in commercial computer games
Slide11Using
AI
in Games
(1)
Path finding for
our units
using
heuristic search
(1)
Deliberative Planning of objectives with
automated planning
What-if analysis to counter the
opponent
using
game theory
(2)
Our units
avoid repeating mistakes by using
machine learning
and
case-based reasoning
(3)
(2)
(3)
Slide12Memory Capacity
Slide13The Power of Game Computing and Its Consequences
Every year, computers are made with more and more memory
This makes for bigger and bigger maps in games
Much effort must be spent on pathfinding which could be better utilized elsewhere
The amount of memory gained goes into the bigger maps and unfortunately a lot of it must be spent on navigation
Slide14Pathfinding
Frequently games use a collection of nodes (“waypoints”) and edges connecting those nodes
Algorithms are devised that find a
path
through the waypoints for two given nodes
Challenges arise when there are too many waypoints
Divide and Conquer the map
Slide15Area Based Path Look Up Tables: A Hierarchical Example
Slide16Game Theory
Idea
: Build a tree describing all possible gaming moves between two opponents
Analyze tree looking ahead N moves into the “horizon” and select best move
Well understood: Nash equilibrium
Challenge
: game tree can be too large
Parallelism & heuristics: Deep Blue
Abstract states: Poki-Poker
Restrictions
: perfect information and deterministic outcomes
Slide17Cutting Off Search
When to cutoff minimax expansion?
Potential problem with cutting off search:
Horizon problem
Solution:
Fixed depth limit
Iterative deepening until times runs out
Decision made by opponent is damaging but cannot be “seen” because of cutoff
Quiescent: states that are unlikely to exhibit wild swings in the values of the evaluation functions
Slide18Evaluation Function
Evaluation Function
Is an
estimate
of the actual utility
Typically represented as a linear function:
EF(state) = w1
f1(state) + w2f2(state) + … + wnfn(state) Example:
Chess
weight: Piece
Number(w1) Pawn
1 (w2
) Knight 3
(w3) Bishop 3
(w4) Rook 5
(w5) Queen 9
Function; state
Number
f1
= #(pawns,w) #(pawns,b)f
2 = #(knight,w) #(knight,b)
f3 = #(bishop,w) #(bishop,b)
f4 = #(rook,w)
#(rook,b)f5 = #(knight,w)
#(knight,b)
Slide19Example: Horizon Problem
“all things been equal”
White moves,
Who is winning?
Is this consistent with Evaluation function?
Black
No!
Slide20Machine Learning: An Example
A number of fixed
domination
locations.
When a team member steps into one of these locations, the status of the location changes to be under the control of his/her team.
The team gets a point for every five seconds that each domination location remains under the control of that team.
The game is won by the first team that gets a pre-specified amount of points.
We used
Unreal Tournament
©
a team-based FPS
Slide21The RETALIATE Algorithm
Uses Reinforcement Learning:
Agents learn behavior policies through rewards and punishments
Policy - Determines what action to take from a given state
Agent’s goal is to maximize some reward
Can be shown to converge to optimal policy (sort of equilibrium)
Slide22Before/After Policies
Before
After
Slide23AI in Commercial Games
Automated
Planning
Machine
Learning
Reasoning with Uncertainty
Slide24Interested?
CSE 348 AI Game Programming
CSE 42 Principles of Computer Game Design
CSE 327 AI Theory and Practice
Research:
Independent Studies (undergraduates): 30+
MS Thesis: 10
PhD Dissertations: 5