Liquid War (v5.4.0) - Network game




Basics
======


  Since release 5.4.0, Liquid War includes network support, that's to say that
  people can play over a LAN (Local Area Network). However, due to limitations
  in Liquid War's legacy code, and also because of the lack of time I have, it
  might be a little tricky to set up a network game at first. So please read
  this section carefully.

  You should keep in mind that:

  * DOS only releases of Liquid War do not include network support, only
    Windows and Linux versions will allow you to do it.

  * The game should run fine on any LAN, but there's no garantee the game will
    be playable on the Internet. Indeed if your "ping delay" is not good
    enough, the game will be awfully slow. Bandwidth is not an issue, since
    Liquid War rarely needs more than 2 Kb/sec.

  * You'll need to know what an IP address is.

  * You don't need to set up a network game to run a multiplayer game. Liquid
    War was originally a multiplayer game without network support. Network
    support is here only for people who don't feel comfortable when playing at
    6 on the same keyboard 8-)



Getting started
===============


  What do you need?
  -----------------

    You'll basically need 2 computers connected on the same LAN. We'll call
    them computer A and B. You might be able to play over the Internet too, but
    the game can be harder to set up and - which is worse - very slow.

    You'll also need to know the IP address of computer A. Type "ipconfig"
    under Windows or "ifconfig" as root under Linux to get this information if
    you don't have it.

  Starting the server
  -------------------

    Liquid War uses a very traditionnal client/server approach. Basically, the
    server gets informations from all the clients and then dispatches the
    collected information to everybody.

    So you'll need to start a server on computer A by running
    "liquidwar-server" on Linux or "lwwinsrv.exe" on windows. This is a console
    application, ie it does not set up any graphic mode.

    Here's a small example of a server start on Linux:

    $ liquidwar-server
    How many teams will connect to this server?

    At this point you must enter a number between 2 and 6, and then press
    "ENTER". In this example we will answer 4. The server really needs to know
    how many teams will be in the game: when enough teams are connected, the
    game starts. It's possible to skip this question by typing
    "liquidwar-server -4" instead of a plain "liquidwar-server".

    Listening on port 8035...
    Waiting for 4 teams...

    Now the server is ready to accept clients. By default it listens to clients
    on port 8035. As of release 5.4.0, it's not possible to change this
    setting, but 5.4.1 should certainly allow it 8-)

  Starting the clients
  --------------------

    Start the client on computer A normally by typing "liquidwar" on Linux or
    double-click "lwwin.exe" on Windows.

    Go to the "Teams" menu and select 2 teams, red and blue for instance. If
    you don't know how to do this, then try and play Liquid War on a single
    computer first.

    Now come back to the main menu, and a "Net Game" button should be
    available. Click it. Now you should be able to:

    * Start the game.

    * Change the nickname.

    * Change the IP address of the server.

    * Change the default communication port.

    Since the server is also running on the same machine (A), you can leave the
    default IP address as is (127.0.0.1). Change the nickname to "A".

    Now you are ready to start the second client on computer B. Like with
    computer A, you'll have to:

    * Select 2 teams, green an yellow this time.

    * Select "Net Game" in the main menu.

    * Change the nickname to "B".

    But this time you'll also need to change the server address, since the
    client is not running on the same computer than the server.

    At this point, you are almost ready to play. Simply click on "Start game"
    on computer A and then on computer B. The server console should display the
    following:

    Waiting for 4 teams...
    Connection from 127.0.0.1:3098
    Accepted "A"
    Waiting for 2 teams...
    Connection from 192.168.1.2:3101
    Accepted "B"
    Talking to "A"
    Talking to "B"
    Start "A"
    Start "B"

    And the game should start on both computers A and B.

  Restart a new game
  ------------------

    Once the game is over, you can start another network game on the clients
    without touching the server, because the server automatically restarts and
    waits for players to connect.

    To restart the server - if you want to change its settings for instance,
    just go to the console where it's running and press CTRL-C.



Options
=======


  Server options
  --------------

    You can pass options to the server using the command line. The following
    parameters are accepted:

    * "-n" where "n" is a number between 2 and 6 : with this option you can
      tell the server how many teams will connect to the game. Beware, there
      can be several teams on the same computer, so if you want to have a
      computer with 2 players on it and 2 other computers with a single player,
      then you need to use the "-4" option.

    * "-netlog" : if you use this option, the server will dump all the network
      traffic on the standard output. This is usefull for debugging.

  Client options
  --------------

    The "-netlog" option works for the client too. Otherwise, all the options
    can be set from the "Net Game" menu.

    Note that when you play a network game, the settings such as those found in
    the "Rules" menu must be the same on every computer. However, Liquid War
    does this automatically. But a consequence is that after a network game,
    your settings might have changed if you were not on the machine from which
    the settings have been taken and then dispatched to every player.



Troubleshooting
===============


  Network support in 5.4.0 is still experimental in many ways, so you might get
  weird behaviors. Basically, if you have a problem, just do the following:

  * Stop and restart the server when something goes wrong. To stop it, use
    CTRL-C.

  * Check out that you have entered the correct IP addresses.

  * Try and start the client and the server using the "-netlog" option to have
    an idea about what's happening.

  * Send me a bug report at "ufoot@ufoot.org" so that I can fix the bugs if
    there are some.

