UNR Logo
QUAKE2AI

Starting the Quake2 Server

You use the Quake II client to start the Quake II server with the +set dedicated switch. Here is an example for the Linux command line:

   ./quake2 +set dedicated 1 +game ctf +map room_ctf +set port 24880

where:

   ./quake2    invokes the client program in the present working directory
   +set dedicated 1    tells it to start in server mode
   +game ctf    tells it to use the game files in the ctf directory rather than the default baseq2 subdirectory
   +map room_ctf    tells it to use the map called room_ctf.bsp (in the ctf/maps subdirectory)
   +set port 24880    tells it which port to use for communication

You probably do not have that map, so just use this to get started:

   ./quake2 +set dedicated 1 +set port 24880

For a complete list of commands see the Quake II Console Commands page. Most of the variables described there can be set using the +set command-line option.

Connecting to the Server

Manually

For now run ./quake2 without the options described above, and open the console by pressing the tilde (~) key. Then type in:

   connect localhost:24880

This will connect you to the server, configured for playing the first level of the game in deathmatch mode.

Automatically

Connecting automatically should be very easy, but unfortunately the command that ought to work:

   ./quake2 +set port 24880 +connect localhost

will give you a bind: Address already in use. error message.

Apparently the only way to automatically connect is to use the AI_command function from the API (or AI.command in Scheme, or q2ai.command in Python), passing any necessary parts of the console command as the argument, e.g.:

   "connect localhost:24880"

You cannot call this function immediately when the game loads or you may get an error. As a workaround, use a counter and wait until AImain has been called 20 times before attempting to connect.