DM810 Computer Game Programming II: AI Lecture 13
Tactical and Strategic AI
Marco Chiarandini
Department of Mathematics & Computer Science University of Southern Denmark
Tactical and Strategic AI Marco Chiarandini Department of - - PowerPoint PPT Presentation
DM810 Computer Game Programming II: AI Lecture 13 Tactical and Strategic AI Marco Chiarandini Department of Mathematics & Computer Science University of Southern Denmark Board game AI MiniMaxing Alpha-beta pruning Transposition Tables
Department of Mathematics & Computer Science University of Southern Denmark
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
2
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
3
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
4
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
5
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
6
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
7
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
8
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
9
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
10
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
11
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms 12
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
13
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
14
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
15
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
class Board: def getMoves() def makeMove(move) def evaluate(player) def currentPlayer() def isGameOver()
16
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
A 13 A 12 A 11 A 21 A 23 A 22 A 33 A 32 A 31
17
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
18
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
19
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
20
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
21
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
22
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
23
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
24
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
25
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
26
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
27
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
28
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
29
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
30
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
31
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
zobristKey[9*2] def initZobristKey(): for i in 0..9*2: zobristKey[i] = rand32() def hash(ticTacToeBoard): result = 0 for i in 0..9: piece = board. getPieceAtLocation(i) if piece != UNOCCUPIED: result = result xor zobristKey[i*2+ piece] return result
32
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
33
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
34
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
35
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
36
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
37
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
def mtd(board, maxDepth, guess): for i in 0..MAX_ITERATIONS: gamma = guess guess, move = text(board, maxDepth, 0, gamma-1) # If there’s no more improvement, stop looking if gamma == guess: break return move
38
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
39
Board game AI MiniMaxing Alpha-beta pruning Transposition Tables and Memo Memory-Enhanced Test Algorithms
40