# The KAbalone Handbook

Josef
Weidendorfer
09/09/1999
1.04.00

This documentation was last updated for kabalone version 1.04. Please make any comments and additions to the author.

KDE
game
abalone
linux

## Introduction

Abalone is a simple board strategy game that is played by two players. There are red and yellow pieces for each player. Beginning from a start position where each player has 14 pieces, moves are drawn until one player has pushed 6 pieces of his opponent out of the board.

The original program was developed in 1993 for DOS and pure Xlib. For KDE there was a major rewrite.

Notice: The game idea is not by me. It is a real board game vendored by a German game producing firm (I believe).

## Rules of the Game

Red always moves first.

Two types of moves are allowed:

- Normal One, two or three pieces of yours in a row can be moved be one in the 6 directions. Side moves are also allowed.

  Press the left mouse button on the first piece you want to move. The piece will then be highlighted. Now drag the mouse in the desired direction. If the move is valid, the cursor will change to an arrow in that direction and all the pieces of the move will be highlighted. If this is the move you want to draw release the mouse button.

  Side moves are handled another way: For two adjacent pieces click between them and drag; for three pieces press the middle mouse button on the middle piece - if a side move is allowed for the pieces they will be highlighted. Otherwise only the middle one is highlighted and you draw a normal move.

- Pushing You can push a maximum of two pieces of the opponent in front of your own pieces as long as the number of the drawn pieces of yours is greater than that of the opponent pieces. That means with three own pieces you can push one or two of the opponent and with two pieces one.

  Special pushing moves are those which push a piece of the opponent out of the board. If you have drawn 6 of those moves you have won.

If you still do not know what kabalone is all about, look at a game where the computer plays both sides. After executing kabalone, select Options/Computer plays/Both and start a new game.

## The User Interface

Drawing moves is explained unter Rules of the Game. The buttons in the toolbar have the same meaning as entries in the File/Edit menu.

The File Menu

- `New Game` - Start a new game even if a game is currently in play.

- `Stop Search` - When the computer is thinking, his depth search is interrupted and he draws the best move he has found so far.

- `Take Back` - Take back your previous move. Two (!) moves are undone: the opponents move and your last move. So it's your turn again. 100 moves are remembered; so don't hesitate to take back moves until you are at the beginning of the game (faster with the F2 key). When in Modify mode (see Menu Edit/Modify below), decrement move number of this position.

- `Forward` - Only usefull in Modify mode: Increment move number of this position.

- `Hint` - A hint for your next move is shown. Only possible if you play at level normal or above, the move number is 2 or greater and you do not undone your move.

- `Network` - If this toggle is switched on, the application is in Network Mode. All running Abalone programs which are in Network Mode broadcast changed positions to each other. This way two humans can play against each other on different computers or one can observe the game play of another Abalone program.

  To exchange positions, the Abalone programs have to know each other. If running on the same machine, nothing is needed (apart from switching to Network Mode). If running on different computers you have to specify the others machine on the command line with the `-h` switch.

  For insiders: Abalone, when in Network Mode, listens on a TCP socket for position change commands by other Abalone programs. You can specify the port number with the `-p` command line switch. You need this if you want to play two different Abalone Network games.

  Examples:

  - Chris on machine1 and Mary on machine2 want to play again each other: Mary simple starts Abalone, sets "Options/Computer plays" to "None" and switches to Network Mode. Chris starts Abalone with `kabalone -h machine2`, otherwise does the same. Now one of the two can start the game and draw a red move. Each time the position is changed in one program, it automatically changes in the other one too.

  - John wants to observe the game: He does the same as Chris, but doesn't draw a move himself.

  - Two different Abalone Network Games shall run among machines `m1` and `m2`. To distinguish the games, we choose port number 12345 for one. On `m1` we start as usual `kabalone` and (not so usual) `kabalone -p 12345`. On `m2` we start `kabalone -h m1` and `kabalone -h m1:12345` (The dot separates host and port as in an URL).

- `Quit` Quits the game.

The Edit Menu

- `Modify` - Switches Abalone to Modify Mode. Now you can edit the actual board position by adding red or yellow pieces or deleting them. The status line shows the number of red and yellow pieces, the move number, the side which is to draw the next move, and if the position is valid: A exclamation sign means no, a checked symbol yes. If the position is invalid and you switch back to normal Play Mode, you can't play! Only valid positions can be used as a starting position for a game. Remark: When in Network mode, the position is broadcast when switching back to Play Mode. `Take back` and `Forward` simple decrement and increment the move number, but don't change any piece.

  Usage: By pressing the left or the right mouse button on an empty or yellow field, you get in "Red piece Adding" mode; by pressing the middle button on an empty or red field, you get in "Yellow piece Adding" mode. Finally be pressing the left or the right mouse button on an red piece, or the middle mouse button on an yellow piece, you get in "Piece Deleting" Mode. While holding the mouse button down and dragging around, you will act on each field your mouse goes over. You end the modifying step be releasing the mouse button.

- `Copy`

  Copy an ASCII representation of the actual board position into the X clipboard. Now you can paste it into any text editor by pressing the middle mouse button there.

- `Paste`

  Interpret the content of the X clipboard as ASCII representation of an Abalone board the set the board position corresponding. A valid ASCII representation is generated by `Copy`.

  This way you can exchange board positions of two Abalone programs by pressing `Copy` in one program and `Paste` in the other, but this is better done with Network Mode (see above). Another usage is to save positions into a text file (using `Copy` and your Editor of choice) and retrieve a position later by selecting it in the editor and press `Paste` in the Abalone program.

- `Save Position` - You can save the actual position and retrieve it later with `Restore position`. The position is stored into the Abalone Configuration file.

The Options Menu

- `Level` - The computer can play at four different levels. This influences the number of moves he searching in advance to calculate the best move. You can interrupt the search by pressing the S key.

- `Computer Plays` - You can make the computer play Red, Yellow or both sides. Choose between these options before starting a new game. Of course it works in a game too if you want to change sides. Choose "None" to play against another human. This is very usefull in Network Mode.

- `Moving Slow` - A move drawn by the computer normally (when this option is checked) is shown by blinking and highlighting of the pieces used in this move. Uncheck this option if you don't want to wait for this animation: Then only a quick highlighting is done.

- `Render balls` - If checked, the pieces are rendered online by an internal simple ray tracer when needed (e.g. when resizing the window).

- `Spy` - If option Spy is checked: If it is your turn, you can see the computer's rating of the move you want to play in the status bar. If it's the computer's turn you can see (in status bar and hightlighted pieces) the move he actually thinks is the best to play. Of course this changes along his search.

- `Save` - Save options in the application's config file. Options are restored at the start of kabalone.

## Command line options

`kabalone [-p MyPortNumber] [-h host[:Port]]*`

With `-p` you specify the port number of the listening TCP socket when in Network Mode.

With `-h` you specify a remote Abalone process (with optinal port number, when not using the default port on the remote machine) to communicate with when in Network mode. You can specify multiple remote processes.

## Epilogue

### Developer

`Josef Weidendorfer`

### Authors

`Josef Weidendorfer`

`Robert Williams` - Editor

### Copyright

kabalone is released under the GPL License.