GF2 (Gipf for two)

Kurt Van den Branden ( kurtvdb@village.uunet.be)


This document is a description of the next stage of GF1-development. The goal is to make it possible to play Gipf over the internet in real-time with GF1 as the user-interface.

1. The general idea

For playing Gipf over the internet you will need 2 things, a client and a server.

The client will be GF1. You will make your moves on the gipf-board as you are used to now, but instead of handling the moves internally the moves will be sent to the server.

The server (which I have called GF2 for the moment) will do all the administrative tasks: connect players with each other, start games, ...

2. How to pla2>2. How to play

The following is a scenario of how to play against an opponent over the internet.

  1. Connect to the server
  2. Start a new game
  3. Play

2.1 Connect to the server

GF1 will have a new option: Networkgame.

When you choose this option, a window will open asking you to enter the following information:

When you choose the OK-button, GF1 will attempt to make a connection to the server you entered. If the connection succeeds, he will try to login with the username and password you entered. If this is also successfull you will be shown the main network-dialog.

If the connection fails, you have to check the server+port you entered for any typo's. If you are sure this is correct you e sure this is correct you will have to try to contact the person who is responsable for the server.

If you get a connection but your login-attempt fails, there are 2 possibilities:

  1. You typed the wrong username and/or password: correct it and try again.
  2. This is the first time you log on to the server so you don't have a username and a password.

If the second option is the case, the you can click on the 'new user'-button to create your own username on the server. this will open a new window where you have to enter some information about yourself.

GF1

GF1 will save all this information in a configuration-file so you don't have to enter it every time.

2.2 Start a new game

When you are connected to the server a new window will open showing you a list of all the other players currently connected to the server. This list will show their name and if they are currently playing a game.

You will also see a list of all the games in progress and the people participating in them.

You can then select a name from the list of people who are not currenly playing a game. The server will ask the other player if (s)he wants to play against you. If the answer is yes the game can start.

REMARK: I don't know at what point or who will decide what type of game to play or if it will be a timed game. (the first version will have no possibility to choose what game to play. all games will be untimed tournament games.)

2.3 Play

Playing will be just as normal. But instead of everything beingd of everything being handled internally in GF1, all moves will be sent to the server which will see what the result of your move is and send you the new board-situation.

extra possibilities while playing:

3. Extras

4. development stages

4.1 step 1: basic

this will allow you to:

step 2

step 3: the sky is the limit

5. Comments

If you have comments about this document, send a mail to kurtvdb@village.uunet.be.

Please send all your reactions:

6. Technical information

If you're not interested in how GF2 will work internally, then you can skip the following part.

6.1 Connection states

This is a list of the different states a connection between GF1 and GF2 can be in. (I think these states should be the same on client and server.)

NOTCONNECTED

there is no connection between client and server.

CONNECTED

TCP/IP connection has been established between client and server. (the client can do nothing on the server yet because he still has to login)

possible client actions:

possible server actions:

LOGGEDIN

the client logged in with an existing name or made a new user. you now get a list of players and games on the server

possible client actions:

possible server actions:

PLAYING_MOVE

you are involved in a game and it is your move.

possible client actions:

possible server actions:

PLAYING_WAIT

You are involved in a game and it is your opponents move.

possible client actions:

possible server actions:

WATCHING

possible client actions:

possible server actions:

WAITING_RECONNECT

Waiting for a reconnect when your opponent has unexpectedly disconnect from the server.

possible client actions:

possible server actions:

6.2 messages

All messages between the server and the client will be in the xmlite-format. this makes them a little larger but it makes sure there will be no problems with special characters and spaces in the parameters.

messages have a 3-digit number to identify them. the rest of the data depends on this number.

messages from the server to the client:

messages from the client to the server:

6.3 Classes

network class

Low level handling of the connection between the server and the client.

I started writing this myself and normal connections and data sending and receiving worked, but I have no idea how to handle all possible errors.

That's why I started looking for an exist's why I started looking for an existing library. Candidates at the moment are:

  1. easynet-1.2: very simple, very understandable

networkgame class

High level interpretation of the messages being sent to and received from the server.

will be kind of a state-machine.

must be called when:

security class

Used for encrypting passwords

ascii85 class

Used for converting binary data to ascii. (This uses the ASCII85 algorithm)

6.4 data kept by the server

6.5 random notes

  1. usernames should always be compared case-insensitive.
  2. passwords are compared case-sensitive. (correction, passwords are never compared directly, the encrypted passwords are compared on the server)
  3. zlib can be used to compress the data sent between server and client. (a saved game file can be up to 10 KB large.)
  4. protocolversion: In case the connection-protocol between server and client changes, during startup communication they should check what protocol each is using.
  5. view list of people watching your game. (maybe just show there names in the logwindow when they start watching.)

P>