Chapter 6 - AI and Games
Chapter 6 - AI and Games
Chapter 6 - AI and Games
Artificial Intelligence
Chapter 6: Games in AI
1
Single-Person Game
• conventional search problem
– identify a sequence of moves that leads to a
winning state
– examples: Solitaire and Rubik’s cube
Imperfect Bridge,
Information poker
9
Assumptions
• In talking about AI game playing systems, we
make a number of assumptions:
• Example: Tic-Tac-Toe
– Root has 9 blank squares (MAX)
– Level 1 has 8 blank squares (MIN)
– Level 2 has 7 blank squares (MAX)
– …
computer’s
turn
opponent’s
turn
The computer is Max.
computer’s
The opponent is Min.
turn
Root has 9 blank squares
opponent’s (MAX)
turn Level 1 has 8 blank squares
(MIN)
Level 2 has 7 blank squares
leaf nodes (MAX)
…
are
evaluated
15
Minimax
• Minimax is a method used to evaluate game
trees.
• A static evaluator is applied to leaf nodes, and
values are passed back up the tree to
determine the best score the computer can
obtain against a rational opponent.
18
Problems with the Minimax Approach
• The problem with minimax search is that the
number of game states it has to examine is
exponential in the number of moves
23
Alpha-Beta Pruning
The idea behind the pruning process is to
recognize when a situation can never be chosen
in minimax no matter what its children-nodes
are:
– Max (3, Min(2,x,y) …) is always ≥ 3
– Min (2, Max(3,x,y) …) is always ≤ 2
– We reach these conclusions without knowing x
and y!
26
α-β pruning example
α= 3
Prune
β= 2
α= 3
β= 14
28
α-β pruning example
α= 3
β= 5
29
α-β pruning example
30
- Pruning
This technique recognizes when a game tree state can
never be reached in an actual play.
A B C
After looking ahead to here, MAX knows that the utility for
MIN of state B will be 2 or less. Since this cannot beat the
utility already found for state A, MAX knows that B will not
be chosen. So the rest of the subtree can be ignored (pruned)
Examples on AI Game Types
• Real Time Strategy (RTS)
• Role Playing Games (RPG)
• Action games
– First person shooter (FPS)
– Sports games
33