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 following examples 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. The demo includes all features of the full version, including multiplayer, but it only comes with three levels, so it may be difficult to find a server to play on.

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, you can download it from the location listed in the Download the Necessary Files section.

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 **

There are four Linux Quake II packages available for download:

Install just one of these packages. Each contains the same files, they're just linked against different libraries. Redhat 5.x users should choose the the glibc rpm package. Users of glibc based systems without rpm support should use the glibc tar package. The libc5 rpm is for Redhat distributions prior to 5.0 and other distributions that use the rpm package format. The libc5 tar.gz package is for Slackware and everyone else.

See the Download the Necessary Files section for the location of the Linux Quake II files.

Installing the RPM packages **

Installation of the rpm packages should be as simple as:


     su root
     rpm -Uvh quake2-xxxxx.i386.rpm
     

Rpm may complain that it can't find libglide2x.so. The Glide library is only necessary if you have a 3Dfx card and want to run Quake II in GL mode. If you don't plan to use the GL mode, you can override the glide dependency with the --nodeps option:


     su root
     rpm -Uvh quake2-xxxxx.i386.rpm --nodeps
     

Installing the tar.gz packages **

To install, just untar the file in your Quake II directory. Do it as root so the proper file permissions get set:


     cd /usr/local/games/quake
     su root
     tar -xzf qwcl2.21-i386-unknown-linux2.0.tar.gz
     

3.4 Setting Permissions **

If you ran rpm or tar as root when installing the Quake II package on your system, the file permissions should be properly set already. The quake2 executable was installed setuid root so that it can access the graphics devices on your system. For security, the ref_*.so rendering libraries are owned by root and writeable only by him. If root doesn't own the libraries, or they're world writeable, quake2 will refuse to run.

If you plan to only run Quake II with the GL or X renderers, your 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 the rendering libraries it needs (ref_*.so). It contains only one line, which should be the path to your Quake II installation. Quake II looks for this file in /etc. If you installed Quake II from an .rpm file, this file was installed for you. If you installed from a .tar package, you need to create it like so:


     su root
     cd /usr/local/games/quake2
     pwd > /etc/quake2.conf
     chmod 644 /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 will 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, download it from the location mentioned in the files section above. 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 II. A precompiled libc5 SVGAlib binary is available at http://sunsite.unc.edu/pub/Linux/libs/graphics/svgalib-1.3.0.libc5.bin.tar.gz for those who don't want to deal with the hassle of compiling for libc5.

You should run Quake II 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
     

Running SVGA and GL games from X in the Tips & Tricks section below explains how to launch SVGA and GL Quake II from X without manually switching to a virtual console.

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.

To run Quake II in GL mode, 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 issues, I'll gladly include it here).

The SVGAlib, Glide, and Mesa libraries must all be installed and configured properly on your system for quake2 to work. The following sections will very briefly cover what you need to do to get them going.

Bernd Kreimeier's ( ) Linux 3Dfx HOWTO ( http://www.gamers.org/dEngine/xf3D/howto/3Dfx-HOWTO.html) is good source for further information.

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.

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. 3dfx.glide.linux on 3dfx's news server (news.3dfx.com) is a great source of information for Linux glide-specific problems.

Mesa

Once glide's installed, you need to install Mesa, a free OpenGL implementation by . 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 is the most recent version as of this writing), 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
     

lib3dfxgl.so **

With Quake II version 3.19, an alternative to the Mesa library is available. lib3dfxgl.so is a mini-GL driver optimized for Quake that provides slightly better framerates than Mesa. This is a port of a driver that 3Dfx developed for Quake under Windows, and apparently not all of its features work properly yet. So hopefully we can expect its performance to improve with time.

Like Mesa, lib3dfxgl.so requires Glide in order to access your 3Dfx card. The Quake II packages come with a script, quake2.3dfxgl for running Quake II with this library on glibc systems. The next paragraph explains how to run Quake II with lib3dfxgl.so on a libc5 system. On a glibc system, the glqwcl executable must not be setuid, nor should you run it as root. glqwcl will silently load Mesa rather than lib3dfxgl.so if it runs with root permissions. This non-root requirement implies that you have the /dev/3dfx driver installed.

On a libc5 system, the non-root requirements mentioned above apply, but you also need to create a symbolic link to lib3dfxgl.so called libMesaGL.so.2 like so:


     cd /usr/local/games/quake2
     ln -sf lib3dfxgl.so libMesaGL.so.2
     
Then start Quake II from a script that tells $LD_LIBRARY_PATH to look in the current directory:
     #!/bin/sh

     LD_LIBRARY_PATH=".:$LD_LIBRARY_PATH" ./quake2 +set vid_ref gl $*
     

You can tell which driver is being loaded by looking for output like the following in your console as Quake II starts:


     GL_VENDOR: 3Dfx Interactive Inc.
     GL_RENDERER: 3Dfx Interactive Voodoo^2(tm)
     GL_VERSION: 1.1
     GL_EXTENSIONS: 3DFX_set_global_palette WGL_EXT_swap_control GL_EXT_paletted_texture GL_EXT_shared_texture_palette GL_SGIS_multitexture
     

If GL_VENDOR says Brian Paul rather than 3Dfx Interactive Inc., that means Mesa is still being used rather than the miniport dirver.

3.8 The GLX Renderer **

ref_glx.so is linked against standard OpenGL libraries instead of Mesa. This allows Quake II to run on other 3D hardware that is supported by other OpenGL implementations. At this time, I dont' know of any OpenGL implementations that support hardware other than 3Dfx, but this renderer ensures that when they appear, we'll be able to play Quake II with them.

This is a GLX application, and as such, must be run from X.

You can use this client with Mesa/3Dfx if you install Mesa and Glide as explained in the previous section, then set the $MESA_GLX_FX environment variable to "fullscreen" before you run quake2:


     export MESA_GLX_FX=fullscreen
     ./quake2 +set vid_ref glx +set _windowed_mouse 1
     

Why the +set _windowed_mouse 1 option? Remember that this is an X application which happens to use your 3Dfx card. Even though the display takes up your entire screen, Quake II is stil running in a window. This means that if you're not very careful, you could move the mouse pointer outside the Quake II window, and Quake II will suddenly stop responding to mouse and keyboard input. +set _windowed_mouse 1 avoids this problem by telling quake2 to grab the mouse and not let it move outside its window.

3.9 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.10 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.11 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 also 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 (Windows) 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, your would 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, then 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