Net Worm Race 1.0 Documentation

Introduction

NWR screenshot Net Worm Race is a highly customizable on-line network game for up to 30 players. It is a variation on the well known "snake" theme. Several worms (one for each player) keep growing from somewhere, they can change their direction certain angle (set in the settings) or change their speed by certain amount in a given range. If the head of a worm A appears in a place where the game area ends or where a worm B is lying (A may be the same as B), the worm A dies. The game goes on until there is a single worm alive (or none alive if the game is in the training mode). The one who survived is the winner.

It runs on unix-like platforms and was succesfully compiled and tested on Linux and Solaris. The client uses GTK+ 2.0, so the requrements are GTK+ 2.0 and the programs GTK+ 2.0 requires.

The program is distributed under the GNU General Public License.

Compilation and instalation

The latest version can be dowloaded from here.

To compile the program on Linux, go to the source directory and type make. To compile it on Solaris, use make -f Makefile.sun instead. Then type make install to install it to $(PREFIX)/bin, where the PREFIX is set in the Makefile and can be changed as you wish by editing the Makefile.

The program

The program consists of two main parts: the client and the server. To run the program, run nwrace, which is the client. The client can run the server and thus became someone called "the gamemaster". As the gamemaster, you can change the game settings, accept or refuse new players, control starts and ends of the game etc. Instead of being the gamemaster, you can be an ordinary player if your client connects to the server run be someone else.

Starting the game as the gamemaster

After starting the program, choose the "Create a new game" menu item. Your client tries to start the server and connect to it. Follow the status bar or log window to see what is happening. If it succeeds, you are the gamemaster and you can do everything that ordinary players can plus some more things. They are:

Starting the game as an ordinary player

After starting the program, choose the "Join existing game" menu item. Then enter the name of host where the game is running and click "OK". Watch the status bar or log window to see what is hapenning. Your client will try to send your request to join the game to the server. According to the game settings, the server may forward your request to the gamemaster to accept or refuse you. If the connect succeeds, you have joined the game.

By default, your state is "not ready". To become "ready", click the "I am ready" button in the game settings window. When the gamemaster starts the game, all players who are ready will become playing. When your worm dies, you become "zombie" and stay zombie till the end of the game. After the end, all players become "not ready" again.

If you want to become ready automatically, choose "I am always ready" in my settings window.

Playing the game

After the game starts, the main window is raised and after a five second delay, the worms appear and start to move. Your worm has the colour you chose in my settings window. You can

where the direction changes are set in game settings and your speed is always in a certain interval (also in the game settings).

If your worm's head appears in a place where the game area ends or where a worm is lying, your worm dies. If there is a single worm alive and in the beginning there were more, the survivor is the winner. If living worms die at the same time, there is no winner. If you start the game with a single player, it goes on until his worm dies (the training mode).

The settings

The gamemaster can modify the game rules by setting the "game settings". They can be set in the configuration file ( [YOUR HOME]/.nwrace/game.settings ) or in the dialog window. The settings are:

Name Name in the settings file Minimum value Maximum value Meaning
Acceleration Acceleration 1255The value by which the speed changes
Accelerate continuously AccelerationMode 01 If the acceleration is continuous or not. If not, the speed changes every time you press the particular key (enter or space). If so, the speed changes every time a step of the game is performed and you are holding the key.
Authorize new players AuthorizeNewPlayers 0 1 If adding of a new player should be authorized bythe gamemaster
Area width GameAreaWidth 0 2000 The width of the game area in pixels.
Area height GameAreaHeight 0 2000 The height of the game area in pixels.
MovementIntervalUsec 10000 100000 The time delay in microseconds between game steps.
Speed minSpeedMin 10255The minimum speed. The speed of worms is initialized by this value. Its priority is greater than of Speed max, i.e. when max is lower than min, the minimum wins. If the speed is too small, the worm could die by crashing into himself during any step.
Speed maxSpeedMax 10255The maximum speed.
StartMiddlePercent10100Limits the middle area where starting worm positions can be. It is in percents of the total area.
Rotation RotationSpeed 190The angle in degrees by which the direction changes
Rotate continuously RotationMode 01 If the rotation is continuous or not. If not, the direction changes every time you press the particular key (left or right). If so, the direction changes every time a step of the game is performed and you are holding the key.
Worm fatnessWormWidth150The radius of the worm body circle.

Player settings are stored in the same place, file player.settings. The values are:

Name Name in the settings file Minimum value Maximum value Meaning
ColorColorBlue0255The blue component of the colour.
ColorColorGreen0255The green component of the colour.
ColorColorRed0255The red component of the colour.
I am always readyAlwaysReady01If 1, the player becomes ready automatically.
NicknameNicknameThe player nick.

The settings files consist of lines, where each line looks like this:

PropertyName = value

and for each property, the last line where it is contained is significant.

How does it work?

See the Developer documentation.

The netbuddy

If you do not have anyone to play with, you may want to use the "netbuddy" craated for testing purposes. To compile it, type make netbuddy (on Solaris use the other Makefile). Then use it like this:

./netbuddy -r 100 -g 20 -b 80 -n Bohous -h localhost

where the r, g, b options are the components of the buddy's colour, n is his nickname and h is the host to connect to. If you do not specify the options, the defaults are black colour, name Dummy and it connects to localhost.

The netbuddy connects to the server, does all necessary things to join the game and it is always ready. But is does not play too wisely, it just goes on moving forward until the crash. It keeps connected to the game until the gamemaster closes it.