Next Previous Contents

3. Quake II

To install Quake II on your Linux system, you'll need some flavor of the official Quake II distribution from id. This will be either the retail Windows CD-ROM that you bought at your favorite software store, or the demo version you downloaded from the net. See Download the Necessary Files for details on acquiring the demo version. Alternatively, if you've already got Quake installed on a Windows machine, you can use the relevant files from that installation.

3.1 Prerequisites

You will need, as a bare minimum, the following:

Optional:

3.2 Installing Quake II

Download the Necessary Files

All the necessary files for Linux Quake II are available at id Software's ftp site, ftp.idsoftware.com. This site can be quite busy at times,so you may want to use one of these mirror sites instead:

The Quake II files mentioned in in this section are:

Other software mentioned:

Create the Installation Directory

The first thing you'll need to do is decide where you want to install Quake II. Lots of folks like to put it in /usr/games/quake. Anal system administrator that I am, I choose to install anything that's not part of my Linux distribution under /usr/local. So for me, Quake II goes in /usr/local/games/quake2. If you choose to install somewhere else, please substitute the appropriate path wherever /usr/local/games/quake2 is mentioned.

So go ahead and create the directory you'll install Quake II in, and cd to it. The rest of these instructions will assume that this is your current directory.

     mkdir /usr/local/games/quake2
     cd /usr/local/games/quake2
     

Installing from CD

Place your Quake II CD in your CD ROM drive, and mount it:

     mount -t iso9660 /dev/cdrom /mnt/cdrom
     

If your CDROM is typically mounted elsewhere, substitute its location for /mnt/cdrom. If you're not sure where your CDROM is mounted, please see the documentation for your particular distribution.

Windows to Linux install

If you have Quake II installed under Windows on a different machine, you can transfer the files in quake2\baseq2\ to your Linux system via FTP or some other mechanism. Keep in mind that the filenames on your Linux system must be in lower case for Quake II to find them, so you may have to rename them after the transfer. Also note that it may be necessary to delete your Windows installation after you do this to remain in compliance with the terms of id's software license. It's not my fault if you do something illegal.

If your Windows and Linux systems are on the same machine, you have two options: copy the files from your Windows partition to your Linux partition, or link to the necessary files from Linux. Both options will work equally well. You'll just save a lot of disk space when you link instead of copy. As usual, replace /win95/games/quake2 in the examples above with the correct path to your Windows partition and Quake II installation.

You're done installing the Quake II data files. Move ahead to " Installing the Linux Binaries".

Installing the demo version

id Software has a freely available demo version of Quake II at their ftp site. It's a 40 megabyte download. I can't speak for its features or lack thereof at this time, because I don't have it to install on my system.

See the section Download the Necessary Files above for the location of the Quake II demo. Download it and place it in your Quake II directory.

The demo distribution is a self-extracting zip file (it's self-extracting in other OS's anyway). You can extract it with the unzip(1) command, which should be included in most modern distributions. If you don't have unzip, it's available at http://sunsite.unc.edu/pub/Linux/utils/compress/unzip-5.31.tar.gz.

cd to your Quake II directory and extract the archive:

     cd /usr/local/games/quake2
     unzip q2-314-demo-x86.exe
     

Now we've got to delete some things and move some other things around:

     rm -rf Splash Setup.exe
     mv Install/Data/baseq2 .
     mv Install/Data/DOCS docs
     rm -rf Install
     rm -f baseq2/gamex86.dll
     

The Quake II demo is now installed. You just need to add the Linux binaries.

3.3 Adding the Linux Binaries

Download the Quake II Linux distribution and extract it to your Quake II directory like so:

     cd /usr/local/games/quake2
     tar -xzf quake2-317-i386-unknown-linux2.0.tar.gz
     

Note about the 3.17 distribution

Two text files (quake2.conf and fixperms.sh) in the 3.17 distribution were inadvertently saved in MS-DOS CR/LF text-file format instead of the unix LF format. This means there's an extra carriage return character at the end of each line in these files and they're not going to behave right until you fix them.

Fix the first one by deleting it. We'll re-create it in just a second.

     rm -f quake2.conf
     

The other file we'll run through tr(1) to strip out the CR's.

     mv fixperms.sh fixperms.bak
     tr -d '\r' < fixperms.bak > fixperms.sh
     

3.4 Setting Permissions **

The fixperms.sh script sets permissions on the quake2 executable and the ref_*.so libraries. It makes quake2 setuid root, so that the SVGAlib renderer can access your graphics card. Run the fixperms.sh script now to set proper permissions on quake2 and the libraries:

    sh fixperms.sh
    
If you plan to only run Quake II with the GL or X renderers, you quake2 doesn't need to be setuid root. See Running X and GL games without setuid in the Tips and Tricks section below for information on running Quake II without root permissions.

Quake2.conf

For security reasons, there is a quake2.conf file, which tells Quake II where to find certain files it needs (ref_*.so). It has only one line in it, which should be the path to your Quake II installation. Quake II looks for this file in /etc. Create it like so:

     cd /usr/local/games/quake2
     pwd > /etc/quake2.conf
     

3.5 The X Renderer

Quake II should be ready to run under X now. Give it a try:

     cd /usr/local/games/quake2
     ./quake2 +set vid_ref softx
     

If all is well, after a pretty significant pause, a small Quake II window should appear with the first demo running in it. You should hear sound effects and possibly music, if the CD is mounted. If any of this fails to occur, please see section Troubleshooting for help.

3.6 The SVGAlib Renderer **

You need SVGAlib installed and configured if you're going to use either the ref_soft or ref_gl renderers. (Quake II uses SVGAlib to process keyboard and mouse input, in case you're wondering why you'd need it for the GL renderer). SVGAlib comes with most modern distributions, and must be properly configured before Quake II will run correctly outside of X.

libvga.config is SVGAlib's configuration file. On most systems you'll find it in either /etc or /etc/vga. Make sure the mouse, monitor, and video card settings in this file are correct for your system. See the SVGAlib documentation for more details.

If you don't already have SVGAlib on your system, it's available at http://sunsite.unc.edu/pub/Linux/libs/graphics/svgalib-1.3.0.tar.gz If you have a RedHat 5.x or other glibc-based Linux distribution, see Glibc, RedHat 5.x, Debian 2 considerations in the Troubleshooting/FAQs section for important information about compiling libraries for Quake.

Note: you should run Quake from a virtual console when using the ref_soft or ref_gl renderers. It won't run from X unless you're root when you start it, and that's not advisable. So if you're in X, do a CTRL+ALT+F1, login and then:

     cd /usr/local/games/quake2
     ./quake2
     

3.7 The OpenGL Renderer

Hardware-accelerated OpenGL Quake is Quake the way God intended it to be. There is no substitute, and once you've experienced it there's no going back.

You need a 3D card with the Voodoo, Voodoo2 or Voodoo Rush graphics chipset on it. There are specific issues to be dealt with if you have a Voodoo Rush card, and I won't go into them now because frankly, I wouldn't know what I was talking about. A future version of this HOWTO will cover Rush issues (If somebody wants to write about Voodoo Rush, I'll glady include it here).

As of this writing, the 3Dfx HOWTO ( http://sunsite.unc.edu/LDP/HOWTO/3Dfx-HOWTO.html) is somewhat out of date, but it may still prove helpful. And although some people there will hate me for saying this, the 3dfx.glide.linux newsgroup on the 3dfx news server (news.3dfx.com) is another good source of information about the intersection of Linux, glide, Mesa and Quake.

SVGAlib

Quake II uses SVGAlib to get input from the mouse and keyboard, so you'll need to configure it as outlined in section SVGAlib Renderer section.

Glide

Glide is a library that provides an API for programming 3Dfx based cards. If you want the Mesa graphics library to use your 3Dfx card, you've gotta have it.

The latest version of glide can always be found at http://glide.xxedgexx.com/3DfxRPMS.html. Select the package(s) appropriate for your system, and install according to the instructions on the web page. 3dfx.glide.linux on 3dfx's news server (news.3dfx.com) is a great source of information for Linux glide-specific problems.

Note that unless you download the 3Dfx device driver package in addition to the Glide library, you will only be able to run Glide applications (like GLQuake) as root. Install the /dev/3dfx module and you can play GLQuake as a regular user.

Once you have glide installed, try out the test program that comes with it. Remember this program: it's a good way to reset your display if you ever have a glide application (like GLQuake) crash and leave your screen switched off. NOTE: run this test from a VC, not X! It's possible for the test app to lose mouse and keyboard focus in X, and then you'll have no way of shutting it down.

     /usr/local/glide/bin/test3Dfx
     

Your screen should turn blue and prompt you to hit any key. After you press a key you should be returned to the prompt.

Mesa **

Once glide's installed, you need to install Mesa, a free OpenGL implementation by Brian Paul (brianp@elastic.avid.com). Luckily, you won't have to look far, because Mesa 2.6 is included with the Quake II binaries. All you have to do is move it to the right place:

     cd /usr/local/games/quake2
     cp libMesaGL.so.2.6 /usr/local/lib
     ldconfig
     

If you want to upgrade Mesa to a more recent version (Mesa 3.0 should be released very soon), you can download the latest from ftp://iris.ssec.wisc.edu/pub/Mesa If you have a RedHat 5.x or other glibc-based Linux distribution, see Glibc, RedHat 5.x, Debian 2 considerations in the Troubleshooting/FAQs section for important information about compiling libraries for Quake.

After you've built it according to the instructions, you will have to do two things:

Now switch to a VC (CTRL+ALT+F1) and start Quake II:

     cd /usr/local/games/quake2
     ./quake2 +set vid_ref gl
     

3.8 Linux-Specific Command Line Options

This section will cover command line options that are specific to the Linux version of Quake II. There are plenty of other Quake II options, but they're beyond the scope of this HOWTO. Check out some of the sites listed in section General Quake Information for this kind of information.

These are actually cvars (client variables) that you can set in the Q2 console, but it makes the most sense to set them on the command line. Set them with +set on the command line, like:

     ./quake2 +set cd_dev /dev/hdc
     

cd_dev device

Name of the CD-ROM device.

nocdaudio value

Disable CD audio if value is nonzero

sndbits num

Set sound bit sample size. Default is 16.

sndspeed num

Set sound sample speed. Usual values are 8000, 11025, 22051 and 44100. If set to zero, causes the sound driver to attempt speeds in the following order: 11025, 22051, 44100, 8000.

sndchannels num

Indicates stereo or mono sound. Defaults to 2 (stereo). Use 1 for mono.

nostdout value

Don't do any output to stdout. Use this if you don't want all the console output dumped to your terminal.

3.9 Quake II Servers

Linux's strength as an internet server make it a perfect platform for running an internet Quake II server. This section will touch on the basics and Linux-specific aspects of starting up a Quake II server. More detailed information about running Quake II servers is available elsewhere (see section Other Sources of Information earlier in this document.

Listen Servers

You can start a Quake II "Listen" server from within the game via the Multiplayer menu. This allows you to host a game and participate in it at the same time.

To start a Listen server, start Quake II, bring up the Quake II menu with the ESC key, and select Multiplayer. It should be pretty self-explanatory from there.

Dedicated Servers

For a permanent, stand-alone Quake II server that needs to run without constant attention, using the Listen server is impractical. Quake II has a Dedicated server mode that is better suited to this type of use. A dedicated server is started from the command line and uses fewer system resources than a Listen server because it doesn't start the graphical client piece at all.

To start a dedicated server, use the command line option +set dedicated 1. You can set additional server parameters either on the command line or in a config file that you +exec on the command line. Your config file should reside in the baseq2 directory.

A few common server options are listed below. To set options on the command line, do +set fraglimit 30. Options are set the same way in a config file, only you don't want the + before the set. Invoke your config file like this: +exec server.cfg.

fraglimit

Number of frags required before the map changes

timelimit

Time in minutes that must pass before the map changes

hostname

The name of your Quake II server. This is an arbitrary string and has nothing to do with your DNS hostname.

maxclients

The maximum number of players that can connect to the server at once.

For enough Quake II console and command line information to choke a horse, see Farenheit 176 ( http://www.planetquake.com/f176).

Other Sources of Server Information

3.10 Mods & Addons

Quake II modifications like Capture the Flag, Jailbreak, and Lithium II are very popular extensions of the original Quake II game. Some mods reside entirely on the server (Lithium), and some require changes to your client (CTF). For server only mods, you just connect normally and play. Client-side mods require you to install additional files in your quake2 directory before you can play.

Client Side Mods

Generally, installation of a client-side mod consists of just downloading the client package and upacking it in your Quake II directory, but you should refer to the mod's documentation for specific details. It may be necessary to download a Linux-specific package in addition to the main client package. Also be aware that all mods may not be available for Linux.

Client-side mod packages usually contain a new gamei386.so file and one or more .pak files. Other new files may be included as well. These new files will be installed in a subdirectory below your Quake II directory. Use +set game mod-dir on the command line to run the mod. Rocket Arena 2, for example, gets installed in a directory called arena. To play RA2, start your client like so:

      ./quake2 +set game arena
      

Capture the Flag

Since this is by far the most popular variation of multiplayer Quake II, I've included specific instructions for installing this mod. Capture the Flag for Quake II is available from id's ftp site. Download it and install like so:

     cd /usr/local/games/quake2
     mkdir ctf
     cd ctf
     unzip -L /wherever/you/put/it/q2ctf102.zip
     

Start Quake II with +set game ctf to play CTF.

Server Side Mods

Running a Quake II mod on a server isn't much different than running one on the client side. Generally you'll need to install gamei386.so and server.cfg files in a new subdirectory and then start your server like

     ./quake2 +set game XXXX +set dedicated 1 +exec server.cfg
     
Where XXXX above is the name of the mod's new subdirectory. The exact procedure will vary from mod to mod, of course. See the mod's documentation for specific details.

Game Source

The entire game, with the exception of the engine itself, resides in a shared library, gamei386.so. Quake II mods are created by changing the contents of this file. The C source is freely available (section Download the Necessary Files above) for anyone to download and modify.

After you've downloaded the source, here's how to get started with it:

      cd /usr/local/games/quake2
      mkdir mymod
      cd mymod
      gunzip /wherever/you/put/it/q2source-3.14.shar.Z
      sh /wherever/you/put/it/q2source-3.14.shar
      

You'll be presented with a bunch of legalese that you must answer yes to, then the game source will be extracted. Building a new gamei386.so out of these sources is accomplished with a simple make. You can run Quake II with the newly compiled library like so:

      cd /usr/local/games/quake2
      ./quake2 +set game mymod
      

Not too exciting yet, since what you just built is identical to the "stock" gamei386.so, but this should be good information for aspiring mod authors.

Mission Packs


Next Previous Contents