Ataxx32

A Basic Win32 Implementation of Ataxx

INTRODUCTION

Ataxx32 Screenshot

I had played the game Ataxx in the arcade and thought it was interesting. During collage, a few colleagues had written a few Java based implementation of the game. I liked it, but I wasn’t happy with the installation process of non-web based Java applications. I also wanted to see if I could add networking support. So I wrote a Win32 version of Ataxx called Ataxx32. I forgot about it for a very long time, then one day I decided to clean it up and put it on SourceForge.

Here are the features of Ataxx32

INSTALLATION AND PLAY

The Win32 executable and source code is hosted on SourceForge at this link.

Win32 Executable and Source Code

Unpack the zip file and click on Ataxx32.exe to start the game.

The game starts with red as a human and blue as the AI. To make a move, single click on the piece to move and then click on the destination. The move may be a distance of 1 or it may be a jump with a distance of 2. If the move is a distance of 1, a new piece is spawned in the destination. If the jump is a distance of 2, the piece is moved to the destination. In either case, all enemy pieces that are adjacent to the destination are claimed. The game ends when no more moves are possible. The player with the most number of pieces on the board at the end of the game wins.

The game has a number of options. The display menu is used to set the board size and turn on and off sound and animations. Selecting Game then Options, allows the board size, barrier density, and AI difficultly to be set.

To start a network game, select Game then Host Game. The other player selects Game then Join Game. When joining a game, it is necessary to type in the network name of the machine that is hosting the game.

NETWORKING

Networking is built on top of Windows Winsock sockets using TCP. Ataxx32 does not use a traditional client/server structure. The players are peers. Each player runs a full version of the game. Network players are treated just like local players to the game engine. When it is time for a network player to make a move, the other machine is queried for the move. When either player makes a move, the other machine is notified of the move. The disadvantage of this structure is that it’s very prone to cheating and corruption.

AI

The AI is based on an exhaustive depth first search with the minmax algorithm. The algorithm searches all possible moves. For each of those moves it computes a score which is the number of pieces minus the number of enemies. When computing the score, the algorithm recursively calls itself to compute the best move that the enemy can make. When comparing scores, the best move for the player is taken also known as the max. When comparing moves for the enemy, the best move for the enemy is taken or from the player’s perspective the min. The algorithm calls itself until a maximum depth is reached.

To implement difficultly levels, two parameters are adjusted. The first is the probably that the algorithm will take the best move at each step. The other parameter is the recursion depth. The recursion depth is never set to a large number due to the exponential growth of the required computation time.

CODE STRUCTURE

The design of Ataxx32 follows what is know in object oriented design as MVC( Model/View/Controller ). The class AtaxxBoard stores the current state of the board and is know as the model. The class AtaxxDisplay displays the board graphics or the view. The base class AtaxxPlayer represents a player either human, AI, or network. Human players coordinate with the AtaxxDisplay class to receive input. As mentioned in the networking section, a network player is modeled as an ordinary player by the NetworkProxy class.

AtaxxBoard Stores board state
AtaxxDisplay Graphs and UI
AtaxxPlayer Base class for a player
AtaxxAI AI player
AtaxxUIPlayer Local human player
NetworkProxy Remote network player

Major Classes

REFERENCES

Win32 Executable and Source Code

Wikipedia Article on Ataxx

armag1234@comcast.net

Back to Home Page