Professional Documents
Culture Documents
THE LIGHT OF AI
Computer Game Playing
Presented by:
Anwesha Das, Prachi Garg
and Asmita Sharma
1
OUTLINE
1. BACKGROUND
3. INTRODUCTION - GAME
DESCRIPTION
4. AI – PERSPECTIVE
1. MINIMAX ALGORITHM
2. ALPHA – BETA PRUNING
5. HEURISTICS
7. CONCLUSION
8. REFERENCES
Computer Games &
AI
Game playing was one of the earliest researched
AI problems since
games seem to require intelligence (heuristics)
state of games are easy to represent
only a restricted number of actions are allowed
and outcomes are defined by precise rules
It has been studied for a long time
Babbage (tic-tac-toe)
Turing (chess)
Sole Motive is to get a game solved, meaning
that the entire game tree can be built and
outcome of the game can be determined even
before the game is started.
3
Class of Chinese
Checkers
It falls under the category of zero-sum
discrete finite
deterministic games of perfect
information.
5
History of Chinese
Checkers
Developed by Chinook
Used alpha-beta search
Used a pre computed perfect end
game by means of a database
In 1992 Chinook won the US Open
….. And challenged for the World
Championship
6
History of Chinese
Checkers
Dr Marion Tinsley had been the world
champion for over 40 years
… only losing three games in all that time
Against Chinook he suffered his fourth and
fifth defeat
….. But ultimately won 21.5 to 18.5
In August 1994 there was a re-match but
Marion Tinsley withdrew for health reasons
Chinook became the official world
champion
7
History of Chinese
Checkers
Chinook did not use any learning
mechanism.
Kumar in 2000- Learning was done
using a neural network with the
synapses being changed by an
evolutionary strategy.
The best program beat a commercial
application 6-0
The program was presented at CEC
2000 (San Diego) and remain
undefeated
8
Components of the
The gameGame
can be defined as a kind of
search problem
problem with the following
with the following
components :
1. A finite set of states.
2. The initial state: board position, indication
of whose move it is
3. A set of operators: define the legal moves
that a player can make
4. A terminal test: determines when the
game is over (terminal states)
5. A utility (payoff) function: gives a numeric
9
Introduction – How to
play?
2 to 6 players can play the game ,having 10
same-colored marbles
At the start - player's marbles are in the ten
holes of the star point that has the same color
as his marbles
Goal - move all marbles of one color from
starting point to the star point on the opposite
side of the board
No game pieces are removed from the board.
Introduction - Constraints
marble can move by rolling to a hole next to it
12
Minimax - Example
1 A
MAX
1 B -3 C
MIN
4 D 1 E 2 F -3 G
MAX
H I J K L M N O
4 -5 -5 1 -7 2 -3 -8
= agent = opponent
13
Minimax to a Fixed Ply-
Depth
Usually not possible to expand a game to
end-game status
have to choose a ply-depth that is
achievable with reasonable time and
resources
absolute ‘win-lose’ values become
heuristic scores
heuristics are devised according to
knowledge of the game
14
Minimax - Example
1 A 8
0
MAX
14 B -3 8 C
0 -3
MIN
43 D 10 E 24 F -3-3 G
MAX
H I J K L M N O
4 -5 -5 1 -7 2 -3 -8
= agent = opponent
15
Alpha-Beta Pruning
Fixed-depth Minimax searches entire
space down to a certain level, in a
breadth-first fashion. Then backs values
up. Some of this is wasteful search
16
Alpha-Beta Pruning
Traverse the search tree in depth-first order
At each MAX node n, alpha(n) = maximum
value found so far
At each MIN node n, beta(n) = minimum value
found so far
Note: The alpha values start at -infinity and only
increase, while beta values start at +infinity and only
decrease.
<=6 B C
MIN
6 D >=8 E
MAX
H I J K
6 5 8
= agent = opponent
18
Alpha-beta Pruning
>=6 A
MAX
6 B <=2 C
MIN
6 D >=8 E 2 F G
MAX
H I J K L M
6 5 8 2 1
= agent = opponent
19
Alpha-beta Pruning
>=6 A
MAX
6 B 2 C
MIN
6 D >=8 E 2 F G
MAX
H I J K L M
6 5 8 2 1
= agent = opponent
20
Alpha-beta Pruning
6 A
MAX
6 B 2 C alpha
cutoff
MIN
6 D >=8 E beta 2 F G
cutoff
MAX
H I J K L M
6 5 8 2 1
= agent = opponent
21
We use α-β pruning, which can optimize move. Here
white balls may take 20 & black 22 moves - α-β pruning
chooses the better move.
Heuristics
Chinese Checker, possible heuristics :-
Random- the computer makes a move randomly
without taking into consideration the current board
configuration
Caveat - the random player may not leave its
triangle at all -denying the chance to the opponent
to occupy its winning triangle
26
Quiescence Search
Always search to limited depth - blind to states
just beyond this boundary
Might chose a path on the basis that it
terminates in a good heuristic … but next
move could be catastrophic
Overcome by quiescence search – positions in
which favourable captures are avoided by
extending search depth to a quiescent
position.
27
Chinese
Checker