A.I. in Board Games

Only available on StudyMode
  • Topic: Board game, Game, Monopoly
  • Pages : 162 (53631 words )
  • Download(s) : 102
  • Published : May 3, 2013
Open Document
Text Preview
Bachelor Thesis
A.I. in board games

Aron Lindberg, s042422

Technical University of Denmark
Informatics and Mathematical Modelling Thesis tutored by Thomas Bolander August 19, 2007

i

Abstract
In this thesis, a board game named Kolibrat is implemented in the Objective-C programming language and Apple Computers Cocoa API. Besides from documenting this work, the thesis focus on the development of artificial players.

ii

Resum´ e
I denne afhandling bliver et brætspil Kolibrat implementeret i programmerings sproget Objective-C og Apple Computers Cocoa API. Udover at dokumenterer dette arbejde fokuserer denne afhandling p˚ arbejdet med a udviklingen af kunstigt intelligente spillere.

iii

Contents
1 Preface 1.1 Preconditions . . . . 1.2 Aims and limitations 1.2.1 Limitations . 1.3 Structure of thesis . 1 2 3 3 4 5 5 6 6 6 6 6 7 8 9 11 16 16 18 19 20 20 20 23 25 27

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

. . . .

2 Game Development 2.1 Concept design . . . . . . . . . 2.1.1 Graphical user interface 2.1.2 Game Controller . . . . 2.1.3 Game Engine . . . . . . 2.1.4 Players . . . . . . . . . 2.2 User Interface . . . . . . . . . . 2.2.1 Flow control . . . . . . 2.2.2 GUI implementation . . 2.3 Game Implementation . . . . . 2.3.1 Class details . . . . . . 2.3.2 Kolibrat flow diagrams . 2.3.3 C data structures . . . . 2.4 Testing . . . . . . . . . . . . . 2.4.1 Test summery . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

. . . . . . . . . . . . . .

3 Artificial intelligence 3.1 Game Analysis . . . . . . . . . . . . 3.1.1 Game state space . . . . . . . 3.1.2 Branching factor . . . . . . . 3.1.3 Complete analysis of Kolibrat 3.1.4 Analyzing forced loops . . . . iv

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

. . . . .

CONTENTS 3.2 AI in Kolibrat games . . . . . . . . . . . . . . . . . . 3.2.1 Mini-Max agent . . . . . . . . . . . . . . . . 3.2.2 Optimizing the Mini-Max agent . . . . . . . . Implementing the Mini-Max agent . . . . . . . . . . 3.3.1 Additional possible Mini-Max enhancements Optimizing the Heuristic function . . . . . . . . . . . 3.4.1 Neural network utility function . . . . . . . . 3.4.2 Weighted linear evaluation function . . . . . 3.4.3 Choosing the heuristic parameters . . . . . . 3.4.4 Determining the parameters weight . . . . . . Simulated annealing Implementation . . . . . . . . . 3.5.1 Simulated annealing results . . . . . . . . . . Heuristics Comparison . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

v 29 29 30 32 33 35 35 36 37 38 39 42 44 48 49 50 51 51 54 58 58 58 59 61 64 69 70 80 81 88 89 92 93 98 99

3.3 3.4

3.5 3.6

4 Conclusions 4.1 Future prospects . . . . . . . . . . . . . . . . . . . . . . . A Kolibrat Rulebook A.1 Game Objectives . . . . . . . . . . . . . . . . . . . . . . . A.2 Rules for movement . . . . . . . . . . . . . . . . . . . . . B Tests Details C Source Code C.1 Kolibrat Source Code . . . . . . . . C.1.1 HumanPlayer.h . . . . . . . . C.1.2 HumanPlayer.m . . . . . . . C.1.3 Datastructures.h . . . . . . . C.1.4 Datastructures.m . . . . . . . C.1.5 GameLogic.h . . . . . . . . . C.1.6 GameLogic.m . . . . . . . . . C.1.7 GameEngine.h . . . . . . . . C.1.8 GameEngine.m . . . . . . . . C.1.9 GameController.h . . . . . ....
tracking img