Presentation on theme: "Martin Boyd Christopher Hirunthanakorn"— Presentation transcript:
1 Martin Boyd Christopher Hirunthanakorn Nine Men's MorrisMartin BoydChristopher Hirunthanakorn
2 Game Overview Two player game RULES Players alternate turns placing pieces on the boardIf a mill is formed, player may remove an opponent's piecemill - three pieces formed along a lineAfter both players place nine pieces, players move their pieces to any free adjacent spotThe game is over when a player has less than 3 pieces or no legal moves remain
5 Game Classification Determinate Zero-sum Symmetric Perfect Information SequentialNormal
6 Background One of the oldest games played to date Game board carving from 1400 BCE found in EgyptAlso known as Mill, Merelles, or Cowboy CheckersPopular variants of the game include Three Men's, Six Men's, and Twelve Men's Morris
7 Research Goals/Questions Look for an optimal strategy for piece placementFind an optimal strategy for gameplayIs there a winning strategy for either player?Is the game fair?
8 Analyzing the Game Searched for previous work on the game Game States and CombinatoricsCreated program with a GUIAnalyzed Five Men's MorrisCreated an Adaptive ProgramCreated an AIUsed python as the programming language
9 Previous Publications Ralph Gasser (Swiss computer scientist)Proved that perfect play in Nine Men's Morris results in a draw and is impossible for humans to achieveAnalyzed the midgame and endgame by going through all possible game states and labeling them a win or lose positionDid not provide any advice on the optimal strategy or fairness of the game
10 Five Men's Morris Players have 5 pieces instead of 9 16 spots instead of 24
11 Game States and Combinatorics A game state is defined as the game board and all relevant information defining it such as Last player to move and position of last moveBoard to the right is the game state where player 1 just went but could have placed it on either sideUsed combinatorics to estimate the number of game states possibleAbout 1.74 * 10^11 states based on possible combinations of placement (16*15*14*13*12*11*10*9*8*7*6)Can be reduced using symmetry of game states to about 7.26 * 10^8 (31+14*13*12*11*10*9*8*7*6)
13 Basic Program Structure Data of the Game Board is stored in 3 arraysBasic Array[A1,A3,A5,B2,B3,B4,C1,C2,C4,C5,D2,D3,D4,E1,E3,E5]Mill Array[[0,A1,A3,A5],[0,B2,B3,B4],...,[0,E1,E3,E5]]Connection Array[[A1,A3,C1,0],[A3,A1,A5,B3],...,[E5,C5,E3,0]]
14 Adaptive Program Runs the Game MANY times Contains Matchboxes that punish a player if that player loses thus not repeating the same mistake twice.
16 Adaptive Program2 different Adaptive Programs written for Five Men's MorrisOpening Stage AdaptiveContains a Matchbox for each player to select spotsSecond Stage AdaptiveContains two Matchboxes for each player to move pieces and the other for removing pieces
17 Adaptive Results Opening Stage Adaptive After 60 million runs (On the last 10 million)72544 won by Player 144059 won by Player 2end in a drawPlayer 1 has 20% advantage on win/lossHowever most opening stages end in drawSecond Stage AdaptiveAfter 10 million runs still dead evenThe program requires more runs to draw a conclusion.
18 AI Logic (Minimax and Negamax) AI is based on the game theory decision rule of Minimax and NegamaxBoth determine the worth of a game state using a set of conditionsEfficiently searches through possible states and presents the best one.Negamax differs in how it eliminates certain states that can not be achieved to increase search speedsCurrent StateNext State25Next Next State9126
19 AI Logic (Scoring)Plays the game more intelligently by choosing the best move from all possible moves for that game boardMoves are scored based on the resultant game boardnext to open connection or own piece = +1next to opponent's piece = -1sets up 2/3 parts of a mill = +2blocks opponent's mill = +2makes a mill = +3
20 AI Results Player 1 using AI, Player 2 playing randomly After 1000 runs multiple times, Player 1 wins roughly about 70% of the timeBoth players using AIAfter 1000 runs multiple times, neither player has an advantage over the other (around 50% each)AI will require more improvements and test runs to get solid results
21 General Strategy Take spots on both rings Take spots with the most connectionsBlock your opponent's move in a way that you don't trap yourselfTry to force your opponent to allow you to make a millEx) player 1 takes outside corners and player 2 tries to blockIf possible, set up two potential mills next to each other so that a mill can be made by moving back and forth
22 Future WorkImprove AI and adaptive learning programs to be more efficientCurrently the Adaptive takes too long to run through the required number of gamesConfirm the patterns found apply to Nine Men's Morris by running the programs on itCome up with a more detailed strategy that will handle every situation