Go Siege Manual

Timothy Stranex


Table of Contents

1. Introduction
2. Installation
Requirements
The Monolithic Windows Distribution
Installation from Source
Installation on Gentoo Linux
Troubleshooting Installations on Microsoft® Windows
3. Rules
Terminology
Basic Rules
Limits
Stonerot
The Rule of Ko
4. The Client
The Login Dialog
The Board Window
Colours
Placing Stones
Chat
Autoscroll
High Scores
Server Information
5. Tools
gosiege_serverinfo
6. Server Administration
AI Players
The Journal
Server Options
7. Credits

List of Figures

3.1. Stone Diagram
3.2. Adjacent Stones
3.3. Unit Patterns
3.4. Unit Liberties
3.5. Unit with Twelve Liberties
3.6. Unit Capture
3.7. Scoring
4.1. Login Dialog
4.2. Board Window
4.3. Player Highlight
4.4. Ghost Stones
4.5. Chat
4.6. The Autoscroll Cursor
4.7. High Scores Dialog
4.8. Server Information Dialog

Chapter 1. Introduction

Go Siege is a transformation of the ancient Chinese game of Go into a massively muliplayer online game in which hundreds of players can compete simultaneously. Go Siege comes with a Twisted-based server and a GTK+ client.

Chapter 2. Installation

Requirements

Go Siege has been tested on the following platforms:

  • Gentoo Linux
  • Fedora Core 1
  • Debian (Unstable)
  • Debian (Stable) for the server only.
  • Microsoft® Windows Me
  • Microsoft® Windows XP

Go Siege requires the following software to run:

Here is a list of Microsoft® Windows installers for this software. You should install it in this order.

Note

You do not need to install these if you use the Monolithic Windows Installer.

If you already have any of this software installed, you should remove it before installing the newer versions.

The Monolithic Windows Distribution

The Monolithic Windows Distribution package is a .zip file that contains a ready-to-run distribution of Go Siege by including Python, Twisted, PyGTK and the GTK runtime. To use, simply unzip it in your favorite archiving application (like WinZip) and run the file gosiege.bat. The distribution includes a prebuilt server. To start the server, run the file start_server.bat.

Note

If you have any problems running Go Siege, read the section called “Troubleshooting Installations on Microsoft® Windows”.

Installation from Source

This section describes installing Go Siege from a source archive. If you are using Microsoft® Windows, you will need to open a command prompt and include the Python installation directory (usually C:\Python23) by typing the command PATH=C:\Python23.

  1. Make sure all the software listed in the section called “Requirements” is installed on the target computer. Remember that if you already have any of the required software installed, you should remove it before installing the newer version.

  2. Unpack your source archive. On UNIX you will probably do this in one of the following ways:

    # If you got the .tar.gz archive
    tar -xzf gosiege-0.1.tar.gz
    # If you got the .tar.bz2 archive
    tar -xjf gosiege-0.1.tar.bz2
    # If you got the .zip archive
    unzip gosiege-0.1.zip
  3. Set your current directory to the Go Siege source root. cd gosiege-0.2

  4. Run the installation program setup.py with the Python interpretor that you wish to use Go Siege with. Usually this means executing the command python setup.py install or python2 setup.py install. If you are using Debian Woody, you will need to run python2.2 setup.py install.

  5. The installation is now complete. On UNIX, you can run the Go Siege client by executing the command gosiege. On Microsoft® Windows, you must run the file C:\Python23\Scripts\gosiege_client.py. You can also start a Go Siege server, see Chapter 6, Server Administration).

    Note

    If you have any problems running Go Siege under Microsoft® Windows, read the section called “Troubleshooting Installations on Microsoft® Windows”.

Installation on Gentoo Linux

To install Go Siege on Gentoo Linux, download the ebuild, unpack it to your portage tree, and emerge it.

	# Assuming gosiege-ebuild-0.3.tar.gz is in /home/foo/.
	cd /usr/portage
	tar -xzf gosiege-ebuild-0.3.tar.gz
	emerge gosiege -p
	emerge gosiege
      

The Gentoo packages installs a script gosieged into /etc/init.d that can control a single Go Siege server. The server can be started by running /etc/init.d/gosieged start and stopped with /etc/init.d/gosieged stop. A sample server is installed into /etc/gosiege. To make the server startup and shutdown with the system, run rc-update add gosieged default. See the ‘Initscripts’ chapter of the Gentoo Handbook for more information.

Troubleshooting Installations on Microsoft® Windows

The most common problem is an incorrectly configured GTK+ runtime environment. Use the following procedure to fix it.

  1. Download helloworld.zip (mirror at gosiege.sourceforge.net). Unzip this file to produce helloworld.exe and helloworld.zip.

    If you are using the Monolithic Windows Distribution:

    1. Choose Run from the Start menu and type in command (or cmd on Microsoft® Windows Xp).

    2. Change to the directory containing helloworld.exe (cd c:\path\to\helloworld\).

    3. Set the PATH environmental variable to include the GTK+ runtime included with the Monolithic Windows Distribution: set PATH=c:\path\to\gosiege\gtk\bin;c:\path\to\gosiege\gtk\lib.

    4. Run helloworld.exe by entering the command helloworld.

    If you are not using the Monolithic Windows Distribution, run helloworld.exe from explorer.

    If the progam gives any errors, the GTK+ runtime environment is probably broken.

  2. Ensure that you have the latest versions of all the packages listed in the section called “Requirements”. The following combination is known to work:

  3. Ensure that you have no older versions of the GTK+ Windows Runtime or any other GTK+ runtimes installed. If you do, you must uninstall them.

  4. Ensure that you do not have any stale GTK+ DLL files in any system directories (like c:\windows\system\). This includes the following DLL files:

    • libatk-1.0-0.dll
    • libfontconfig-1.dll
    • libgdk_pixbuf-2.0-0.dll
    • libgdk-win32-2.0-0.dll
    • libglade-2.0-0.dll
    • libglib-2.0-0.dll
    • libgmodule-2.0-0.dll
    • libgobject-2.0-0.dll
    • libgthread-2.0-0.dll
    • libgtk-win32-2.0-0.dll
    • libpango-1.0-0.dll
    • libpangoft2-1.0-0.dll
    • libpangowin32-1.0-0.dll
    • inconv.dll
    • Any other DLLs mentioned in the errors messages of helloworld.exe

    If any of these files exist in system directories, you should first back them up and then remove or rename them.

Chapter 3. Rules

The rules of Go Siege are based on those of Go. Additional rules have been defined to adapt the game to online play with many players.

Terminology

To avoid confusion, any words that are defined here and are meant to mean their definition here are emphasized.

Board

A grid on the intersections of which stones can be put.

Stone

A single object that can be placed on a board.

Figure 3.1. Stone Diagram

A single stone centred on the intersection of a
		    vertical and horizontal line.
Adjacent

Two stones are adjacent when they are placed on a board such that they are connected by either one horizontal grid-line unit or one vertical grid-line unit.

Figure 3.2. Adjacent Stones

Two blue stones placed next to each other on the same
		    horizontal line and two blue stones placed next to each
		    other on the same vertical line.
Unit

A set of stones owned by the a single player arranged such that each stone is adjacent to the next. A single stone is itself a unit.

Figure 3.3. Unit Patterns

A single stone, three adjacent stones on the same
		    horizontal line and stones placed to form the shape of a
		    ‘C’.
Liberty

A unit is said to control a liberty when an adjacent position has no stone placed on it.

Figure 3.4. Unit Liberties

Three horizontally adjacent stones with their eight
		    liberties highlighted.
Liberty Count

The number of unique liberties controlled by a unit.

Figure 3.5. Unit with Twelve Liberties

A ‘C’-shaped unit with its twelve liberties
		    highlighted.

Basic Rules

Players share a board and may strategically place stones onto it, creating units . By placing a stones adjacent to another player's units, you can reduce their liberty count . When a unit's liberty count reaches zero, it is removed from the board. Each player that had stones adjacent to the unit receive points equal to the product of the fraction of adjacent stones they controlled and the number of stones in the unit. It is better to have a higher score.

In this figure, the red unit will be captured by if the blue player places a stone on the highlighted position.

Figure 3.6. Unit Capture

Two red vertically-adjacent stones surrounded on
	    all but one sides by blue stones. The remaining position is
	    highlighted.

In this figure, if the blue player places a stone on the highlighted position, the green unit will be captured. The blue player's score will increase by 2/6*2 = 0.66 points and the red player by 4/6*2 = 1.32 points.

Figure 3.7. Scoring

Two red vertically-adjacent stones surrounded on
	    all but one sides by red and blue stones. The remaining position is
	    highlighted.

Limits

Giving each player a separate turn in Go Siege would not be possible when there are many players. Having no turns and allowing players to place stones asynchronously discourages strategy and encourages players to madly place stones before the other players do.

Go Siege's solution is to limit the rate at which players can place stones. After a player places a stone on the board, a duration set by the server administrator must elapse before he can place another.

The server administrator may choose to disable Limits on his server.

Stonerot

Units begin to rot over time and they eventually die and are taken off the board. Adding new stones to an old unit does not slow down the rotting process. This rule was designed to prevent the board from being filled with stones.

The server administrator may choose to switch Turns off on his server.

The Rule of Ko

Some stone patterns (like the one shown below) allow players to fall into an infinite loop and capture a very large number of stones very quickly. The rule of Ko prevents players from exploiting this situation by not allowing any move that will reset the board's previous state.

This rule is not yet implemented in Go Siege.

Chapter 4. The Client

You can run the client on a UNIX-like operating system simply by executing the gosiege program. On Microsoft® Windows, you must run the file scripts/gosiege_client.py of your Python installation (which is usually in C:\Python23).

The Login Dialog

The login dialog allows you to connect to a Go Siege server. The values are persistent and stored in ~/.gosiege on POSIX and in the registry (in “HKEY_CURRENT_USER\\Software\\Go Siege\\0.0”) on Microsoft® Windows.

Warning

If you allow Go Siege to remember your password, it will be stored in plain-text on your computer. Therefore, any user with the necessary permissions will be able to read it.

Figure 4.1. Login Dialog

A screenshot of the login dialog.

Here are the meanings of the values:

Username
Your account's username.
Password
Your account's password.
Server
The address of the Go Siege server to connect to. This may be either a valid IP address or domain.
Port
The TCP port that the Go Siege server is running on. The default is 7777.
Remember Password
Whether to make the password value persist between sessions.
Register New Player
Whether to try to create a new account on the server using the specified username and password. This will fail if another player is already using the username.

The Board Window

This window allows you to interact with the board and access the high scores and server information dialogs.

Figure 4.2. Board Window

A screenshot of the board window.

Colours

Go Siege is designed to allow hundreds of players to play together simultaneously. Giving each player a different stone colour is impractical because the shades will be too subtle and become indistinguishable from one another. The Four colour theorem states that every possible geographical map can be coloured with at most four colors in such a way that no two adjacent regions receive the same color. Go Siege uses this idea to colour units using only a few colours. Different units that belong to the same player may be coloured differently.

However, knowing which player controls various units is also an important part of the gameplay. The Go Siege client allows you to see which units belong to the same player by highlighting all the units owned by a player when the mouse pointer hovers over one of the player's stones.

In this figure, all the translucent stones belong to the same players.

Figure 4.3. Player Highlight

A board with a few separate units rendered translucent.

Although the two highlighted units are of different colour, they belong to the same player.

Because the unit configuration is constantly changing, the stones are recoloured whenever the board changes. This means that sometimes, units may suddenly change to a different colour.

The stones that belong to you are always blue and are not highlighted when the mouse pointer hovers over them.

Placing Stones

You can place a stone on the board simply by clicking on the intersection onto which you wish to place your stone. If limits have been activated on the server, you will see a ghost stone will become real as soon as the rule allows. While your stone is still a ghost, you change its position by placing a stone somewhere else.

Figure 4.4. Ghost Stones

A translucent stones on the board.

Chat

If the server has chat enabled, players can talk to each other from the client. The chat system uses Unicode so different languages can be mixed.

Figure 4.5. Chat

The chat box with both English and Japanese text.

Autoscroll

You can activate autoscroll by pressing the middle mouse button on the board. Autoscroll works in a similar way to Mozilla Firebird and Microsoft® Internet Explorer's autoscroll. After autoscroll has been activated, the board moves in the direction of your mouse pointer at a velocity proportional to the distance between your mouse pinter and the autoscroll cursor. You can exit autoscroll mode by pressing any mouse button.

Figure 4.6. The Autoscroll Cursor

The autoscroll cursor.

High Scores

The high scores dialog shows you the usernames and scores of the players with the five highest scores on the server.

Figure 4.7. High Scores Dialog

A screenshot of the high scores dialog.

Server Information

The server information dialog shows you the server's settings. The following fields will always be present:

Server Name
The server's name.
Server Admin
Contact details for the server administrator. This is usually set to his e-mail address.
Put Limit
The duration each player must wait after placing a stone before he can place another. If it is set to zero, limits have not been activated on the server.
Unit Lifespan
The maximum lifespan of any unit in hours. If this is set to zero, then stonerot has not been activated on the server.

Figure 4.8. Server Information Dialog

A screenshot of the server information dialog.

Chapter 5. Tools

Table of Contents

gosiege_serverinfo

gosiege_serverinfo

gosiege_serverinfo host[:port]

gosiege_serverinfo is a console program that retrieves information from a Go Siege server and then prints it to the display. The information is the same as that given in the ‘Server Information’ dialog (see the section called “Server Information”).

Chapter 6. Server Administration

The Go Siege server is built in the Twisted framework. Here is the typical procedure for running a Go Siege server:

  1. Create a server by running the command mktap gosiege. This should create the file gosiege.tap.

  2. Run the server by running the command twistd -f gosiege.tap. This should create the files twistd.log, journal and twistd.pid.

  3. Stop the server by running the command kill `twistd.pid`. This should create the file gosiege-shutdown.tap.

  4. Restart the server by running the command twistd -f gosiege-shutdown.tap.

AI Players

Go Siege can add simple artificial intelligence players to the game when there are few real players online. Currently, they can be outwitted quite easily by even casual players although new players will need some time to form strategies to defeat them.

The Journal

The server keeps a journal of all changes to the board and the player database in a file. This is useful because if the server crashes for some reason, the game can be restored to the point of the last entry in the journal.

When the server starts, if there is data in the journal file, it is used to restore the state of the game. When the server is cleanly stopped, the game state is stored in the file qosiege-shutdown.tap and the journal is cleared.

Server Options

Here are the options you can pass to “mktap gosiege” when creating your server:

--port
The server port. Sets the TCP/IP port that the server will bind to. The default port is 7777.
--width
The width of the board. This is the number of columns of stones. The default width is 32.
--height
The height of the board. This is the number of rows of stone rows. The default height is 32.
--journal
The file to write journalling information to. The default is journal.
--limit
The maximum seconds that must elapse after a player has placed a stone before he is allowed to place another.
--lifespan
The maximum time in hours that a unit can be on the board for.
--name
The server name. The client displays this as the first part of its title.
--admin
Server admin contact information. The server administrator should put his e-mail address here.
--bots
The maximum number of AI players that can play the server.
--botplayers
The number of AI players to add when a player comes online. AI players will be added until the maximum set by --bots has been reached.
--chat
Flag indicating that chat should be disabled on the server.

Chapter 7. Credits

Go Siege was written by Timothy Stranex .

Thank you to Scot Cowley and Kishyr Ramdial for their testing and suggestions.