This game was more practice for understanding and implementing Monte Carlo Tree Search (MCTS) in a completely observable, turn-based game. The game itself is a variation of Tic Tac Toe that appeared in this video.
The way you play is that you and the computer are both playing as X's across three 3x3 grids. When one player places an X that causes a 3-in-a-row, the grid is no longer playable. The loser is the player to cause a 3-in-a-row in the last playable grid.
A detailed explanation can be found here. However, here is a brief explanation:
The AI looks at all possible actions it can take and tries to figure out the action that will most likely lead to a victory. Let's say it looks at taking action a, it will map that action onto a new state. It will then look at all actions from this new state that the player will take. After exploring so many states (i.e. the number of iterations), it will evaluate all possible actions and how many times they led to a victory and choose what it sees as the optimum action.
This is visualised in the (rather crude) tree included in the game. The top (i.e. root) node is the current state of the board. All the squares (i.e. nodes) immediately below the root is the new states after choosing an action to take. Subsequently the layer below that is the computers turn etc. It does not visualise what the states represent, but it shows the values of the nodes and edges through colour (green = computer wins, red = human wins) and edge size. It can also be used to see how the the tree changes over the course of the game, the number of iterations, and the searching constant (1.0 = searches all possibilities as much as possible, 0.0 = searches what it thinks is the best node as much as possible).
Leave a comment
Log in with your itch.io account to leave a comment.