
Mercury and Colyseus Software Distribution 

Copyright (C) 2004-2007 Ashwin Bharambe (ashu@cs.cmu.edu)
              2004-2007 Jeffrey Pang    (jeffpang@cs.cmu.edu)
                   2004 Mukesh Agrawal  (mukesh@cs.cmu.edu)

http://www.cs.cmu.edu/~ashu/gamearch.html

-------------------------------------------------------------------------------

INTRODUCTION

This software package contains a snapshot of Colyseus and Mercury, an
architecture for distributed multiplayer games and a range-based DHT,
respectively. See the URL above for more information.


INSTALLATION

This software currently only compiles and runs on Linux x86. You must
use gcc 3.2-3.4 (we have only extensively tested gcc 3.2.2). In addition,
you need GNU make and perl >= 5.8.0.

(1) First, you must install the following development libraries and headers:

    * glibc >= 2.3.2 (with pthreads)
    * libgmp >= 4.1.2
    * zlib >= 1.1.4
    * XFree86 >= 4.2.0 or xorg equivalent (for the vizualizer)
    * SDL >= 1.2.4 (for the vizualizer)
    * SDL_TTF >= 2.0 (for the visualizer)
    * SDL_image >= 1.2.2 (for the visualizer)

(2) Place Merc/, Colyseus/, Data/, id-source/, quake3/, in your home 
    directory.

(3) To compile the colyseus, enter the Merc/ directory and type
    'make'.  Enter Colyseus/ and type 'make'.  If something fails, it
    is possible that we missed a dependency in the list above. Please
    let us know.

(4) Enter Colyseus/run/ and untar lib-5.8.0-i686-linux.tar.gz which will
    create Colyseus/run/lib/.

(5) To compile quake 2, enter id-source/ and type 'make'.

(6) To compile quake 3, enter quake3/src/ and type 'make'.

DEMO

To run a small demo which shows the model workload in action, take the 
following steps:
	
(1) Ensure that you can ssh into 'localhost' without a password using
    ssh version 1 (or version 2 if version 1 is disabled). E.G.,
    add your public key to ~/.ssh/authorized_keys and load it into
    ssh-agent (or have a key without a passphrase).

(2) Enter the Colyseus/demo/ directory.

(3) Run the modelgame.demo.sh script by typing 'sh modelgame.demo.sh'.

(4) If everything worked, you should see it starting up 4 nodes on the
    localhost and then it should run the vizualizer to show you the
    bots in action. Left-click to toggle between server views. Red dots
    are bots, blue dots are missiles, and the light-red boxes around each
    bot is its visible area. Maroon dots are replicated bots and yellow dots
    are the locations of bots on the other servers which are not
    replicated. Close the window to exit.

(5) When you exit the visualizer, the script should automatically kill all
    the running servers.

QUAKE 3

Here is one example of how to start the distributed version of quake 3:

(0) Make sure you can ssh into localhost without a password (see the DEMO
    instructions above).

(1) Enter Colyseus/run/

(2) Run the following command:

    ./RunV2.pl Quake3Conf.pl -v 4 -A -t $HOME localhost

    If the command complains that it can not find some perl library, then
    you must install the required library. See the perl documentation for
    details (all libraries are in CPAN).

    This command runs 4 virtual servers of the quake 3 application on
    localhost where $HOME is the top directory where everything is located.
    The -A flag disables artificial latency emulation. You should see 
    messages indicating that it is starting up the bootstrap server, then
    a master quake3 server, and then 3 slave servers. If you get
    "*** Everything started!" then it worked. Some logs are placed in /tmp
    which you can examine to try to debug problems.

(3) You should be able to connect to each quake3 server using a vanilla
    quake3 client. They are running on ports 27960, 27961, 27962, and
    27963.

(4) To kill the servers run:
    
    ./RunV2.pl Quake3Conf.pl -k localhost


To see what other options are available for starting up quake3 (and for
a description of how to start up servers on multiple machines, run:

./RunV2.pl Quake3Conf.pl


Similar instructions can be used to start quake2 usin QuakeConf.pl
instead of Quake3Conf.pl. The DEMO game can be started using
TestgameConf.pl instead.
