URCS Quagents Home


Quagents: Running the System

Prerequisites for Quake II

You must obtain the contents of the baseq2 directory which contains the game's graphical resources (pak files). We are not able to distribute these. Please see Prerequisites for Running the System for details.

How to Run

  1. Use the quake2ur script to start the game engine and display and load the quagents mod (which starts the quagents server). The default location of this script is /usr/local/bin unless you specified otherwise when you built the distribution.
    /usr/local/bin/quake2ur
    
    Alternatively you can use the run target in the Makefile to find the script for you:
    make run
    
  2. Hit the return key as needed to advance through the opening screens and cinematics. Choose a game difficulty level. (Just choose "easy" as monster violence has been removed anyway.)
  3. Once the game is launched your mouse will control the "player" view and allow you to move around through the scene. To release the mouse focus in that window so that you can access your desktop and open or access other windows hold the SHIFT-key down and drag the mouse out of the game window.
  4. The Quagents server should now be up and running. You may now launch Quagent clients to create and control bots in the game.

  5. For example, try the QuagentControl demo. The default location of this script is /usr/local/bin unless you specified otherwise when you built the distribution.
    /usr/local/bin/quagent-demo
    
    This example demonstrates a minimal Quagent client application. The Java source code for this demo is in src/examples/QuagentControl.

  6. You should see your bot appear in the game. You can control it using the GUI.

  7. Quitting: A quagent bot will die if its controlling application is closed and disconnected from the server. You can exit the Quake II game engine entirely by hitting ESC and choosing quit or by opening the console with " ` " and typing quit at the prompt.

Commands and Options

The quagents system requires two environment variables to be set so that the engine can find the resource data pak files and it's base install directory. This was added to the original game code so that special configuration files do not have to be installed on your system with adminstrator permissions and has the added benefit of allowing the game to be launched from any location instead of only from the installation directory.

These can be set on the command line but it is usually easier to set them is a launch shell script. The launch script quake2ur that we've provided takes care of this for you. The game executable, quake2, will be installed in /usr/local/lib by default or "prefix"/lib if you used the --prefix argument with configure to set an alternative installation directory when building the source code. Additionally the shared object file for the graphics rendering subsytem will also be placed there. Our code currently uses the soft_x video subsystem.

Aside:
There is also code available for the openGL video subsystem but it is not built with our current Makefile. Using the openGL subsystem may require users to run the game executable as root or require the game executable to be suid root. We intend to investigate the openGL rendering subsystem further in the future.

The game is launched by executing quake2 with some arguments that tell the engine which video subsystem to use and which mod to load if any among other things.

There are a number of commandline options you can pass the quake2 executable. Here are a few: +set vid_ref <graphics rendering subsystem>
+set game <game mod to load>
+map <map level to open>
+cmd notarget
(avoid angry monsters chasing you)
+cmd noclip (walk through walls)
See console commands for lots more.

A typical command would look like the following: (peek at the bin/quake2ur script for our launch shell script)

    quake2 +set vid_ref softx +set game quagent
When using the +set game argument quake2 will look for a directory by that name in the QUAKE2_CONF directory that contains the quake2 executable to load a game shared object file.

Tips for Running quake2ur for Demos and Video Capture

It is often useful to position the point of view into a room or map overhead or in some optimal viewing area so that a better vantage can be had for viewing quagent activities. An overhead vantage point it also nice when video capturing a run for a demo. So how do you do that? First turn clipping off so that you are free to 'fly' the camera anywhere you want (up above, through walls, etc...). Use the movement controls to position the view.

Setting noclip ON

To set noclip to ON do one of the following: Using the quake2ur startup script simply add the noclip argument
    quake2ur +noclip
If the game engine has already been launched you can turn clipping on and off by typing 'noclip' at the prompt in the game console.
    '
    noclip		

Setting the display size on the fly

To set a smaller or larger display window use the +sw_mode argument (if openGL is eventually enabled you would use +gl_mode instead. +gl_mode works on the windows build). Available screen dimensions are indexed 0 (smallest 320x240) through 10 (largest 2048x1536). Sizes: 320x240, 400x300, 512x384, 640x480, 800x600, 960x720 1024x768, 1152x864, 1280x1024, 1600x1200, 2048x1536
    quake2ur +map demo1 +noclip +sw_mode 2 

Configuration

Quagents can optionally make use of configuration files to pre-define quagent character and item spawns and locations. Placing a file called quagent.config in the same directory you launch the game from will cause it to be read. See Configuration Files for the details of the format and available options for using quagent configs.

Console Commands

The QuakeII console is invabuable when developing in quake. It provides and in game command prompt that allows settings and commands to be executed.
To open the QuakeII console hit the " ` " key. Any text that is not actually a command is broadcast to players as a text message. There are hundreds of commands. See Console Commands for a console command reference.


Last change: 22 Oct 2004 by ferguson