Linux Quake HOWTO

Peter Jay Salzman

      p@dirac.org
      

Bob Zimbinski

      bobz@mr.net
      

2002-08-11 v 2.0.0

Quake I, Quake II and Quake III are tremendously popular 3 dimensional "first person shooter" (FPS) action games developed by id Software. If you're not familiar with the Quake games, there are much better places than this HOWTO to learn about the basics. This document focuses on all aspects of playing Quake on Linux.


Table of Contents
1. Administrata
1.1. Feedback, Comments, Corrections
1.2. Acknowledgments
1.3. Latest Versions and Translations
1.4. Authorship and Copyright
2. About Quake
2.1. Modifications (mods)
2.2. Total Conversion (tc)
3. Quake I
3.1. History
3.1.1. QuakeWorld
3.2. The Game
3.3. Quakeforge
3.3.1. Installation
3.4. NPR Quake
3.4.1. NPR Quake
3.5. Dark Places
3.6. Project Twilight
3.6.1. Project Twilight
3.7. Add-Ons And Mods
3.7.1. Capture the Flag
3.7.2. Mission Packs **
3.8. Other Software
4. Quake II
4.1. Quake II
4.2. Installation
4.3. Mods
4.4. Add Ons
4.5. Serving
4.6. Other Software
5. Quake III: Arena
5.1. History
5.2. The Game
5.2.1. Game Modes
5.3. Installation
5.4. Serving
5.4.1. Listen Method
5.4.2. Dedicated Method
5.5. Add-Ons And Mods
5.5.1. Urban Assault
5.5.1.1. Description
5.6. Other Software
6. Mods & Addons
6.1. Quake Tools
7. Quake II
8. Quake II
8.1. Installing Quake II
8.1.1. Download the Necessary Files**
8.1.2. Create the Installation Directory
8.1.3. Installing from CD
8.1.4. Windows to Linux install
8.1.5. Installing the demo version **
8.2. Adding the Linux Binaries **
8.2.1. Installing the RPM packages **
8.2.2. Installing the tar.gz packages **
8.3. Setting Permissions **
8.3.1. Quake2.conf **
8.4. The X Renderer
8.5. The SVGAlib Renderer
8.6. The OpenGL Renderer
8.6.1. SVGAlib
8.6.2. Glide
8.6.3. Mesa
8.6.4. lib3dfxgl.so **
8.7. The GLX Renderer **
8.8. Linux-Specific Command Line Options
8.9. Quake II Servers
8.9.1. Listen Servers
8.9.2. Dedicated Servers
8.9.3. Other Sources of Server Information
8.10. Mods & Addons
8.10.1. Client Side Mods
8.10.1.1. Capture the Flag
8.10.2. Server Side Mods
8.10.3. Game Source
8.10.4. Mission Packs **
9. Related Software ++
9.1. QStat
9.2. XQF
9.3. QuickSpy
9.4. QPlug for Linux
9.5. qkHacklib
9.6. GiMd2Viewer
9.7. QIPX
9.8. Ice
9.9. Q2getty
9.10. rcon
9.11. qlog ++
9.12. Cheapo **
9.13. qgraph **
10. Troubleshooting/FAQs
10.1. General
10.1.1. OS difference considerations
10.1.2. Glibc, RedHat 5.x, Debian 2 considerations **
10.1.3. My mouse doesn't work or seems to respond randomly.
10.1.4. My Microsoft Intellimouse or Logitech MouseMan+ isn't working correctly.
10.1.5. My mouse is "laggy" and seems much slower than under Windows.
10.1.6. squake/quake2 fails to start and says "svgalib: cannot get I/O permissions"
10.1.7. Sometimes after playing one of the Quake games in X, key repeat doesn't work any more.
10.1.8. GL Quake/Quake II run slower in Linux than in Windows. **
10.2. Quake/QuakeWorld
10.2.1. Quake dies at startup with a segmentation fault.
10.2.2. What's the difference between glqwcl, glqwcl.3dfxgl, and glqwcl.glx? ++
10.2.3. When I run glqwcl.glx fullscreen from X, I can't use my mouse or keyboard. ++
10.3. Quake II
10.3.1. When I try to run Quake II with the GL renderer, it fails and says "LoadLibrary("ref_gl.so") failed: Unable to resolve symbol"
10.3.2. Quake II fails with the message LoadLibrary("ref_XXX.so") failed: No such file or directory
10.3.3. When I update the brightness while using the GL renderer, and hit "apply," nothing happens!
10.3.4. Note about the 3.17 distribution
10.3.5. When I run Quake II with +set vid_ref glx fullscreen from X, I can't use my mouse or keyboard. ++
10.3.6. Why can't I change to some of the SVGA modes that aree in the Quake II Video menu? **
11. Tips & Tricks
11.1. Running SVGA and GL games from X **
11.2. Keeping the mouse inside the window in X
11.3. 3Dfx "tweak" settings work in Linux too
11.4. The Poor Man's Server Browser
11.5. Using lib3dfxgl.so for Quake I **
12. Other Sources of Information
12.1. Linux Meta Gaming Resources
12.2. Linux Specific Quake Resources
12.3. General Quake Resources

1. Administrata


1.2. Acknowledgments

This HOWTO was originally written by Brett A. Thomas and Mike Hallock . Bob Zimbinski rewrote and expanded the original document.

Special thanks to the following people for bringing us Quake for Linux:

  • John Carmack and the rest of id Software for these great games.

  • Dave 'Zoid' Kirsch for the Linux ports of Quake 1 and Quake 2.

  • Dave Taylor for starting this whole wacky Linux port business.

  • Daryll Strauss for the Linux Glide 2 ports.

  • Brian Paul for the Mesa graphics library.

  • David Bucciarelli for the Mesa/glide driver.


1.4. Authorship and Copyright

Much care and feeding has gone into this HOWTO. Its authors are Brett A. Thomas, Mike Hallock, Bob Zimbinski, and Peter Jay Salzman.

This document is copyright (c) 2001 Peter Jay Salzman, . Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1, except for the provisions I list in the next paragraph. I hate HOWTO's that include the license; it's a tree killer. You can read the GNU FDL at http://www.gnu.org/copyleft/fdl.html.

If you want to create a derivative work or publish this HOWTO for commercial purposes, contact me first. This will give me a chance to give you the most recent version. I'd also appreciate either a copy of whatever it is you're doing or a spinach, garlic, mushroom, feta cheese and artichoke heart pizza.


2. About Quake

These are topics that are relevent and of interest to people playing any of the Quake games.


3. Quake I

3.1. History

Quake I is a tremendously popular game written by John Carmack and released by id Software in 1996. The next year, id released two Quake I mission packs: Scourge of Armagon and Dissolution of Eternity. While id's previous series, Doom, is the most important game to the first person shooter genre, Quake I took FPS from cartoon to realism, from simulated 3D to real 3D. Deathmatch, popular in Doom, flourished with Quake I.

In December 1996, an employee of id Software and early Linux enthusiast, Dave Taylor, ported Quake I to Linux. This was nothing short of astounding since this was way before Linux was a household term. Just as amazing was the fact that John Carmack and id Software supported Dave in his Linux porting efforts. While id Software didn't officially support Linux Quake, it gave Dave the permission to release his ports for free (you still had to purchase the map files) and allowed him to work on company time. The ports were a very good effort at the time, and 4 sets of binaries were released: an X11 version, an SVGAlib version, an OpenGL version and Quake World. At the time, only 3dfx's Voodoo cards were available to Linux users for accelerated 3D graphics, so the OpenGL version was only available linked against the 3dfx Mesa library.

Dave eventually left id Software to form a gaming company Crack.com so they began looking for someone to maintain the Quake I Linux port. A 26 year old programmer and Quake fan named Dave "Zoid" Kirsch, who wrote a wildly popular CTF mod for Quake I (the first CTF anyone wrote for any game), volunteered for the job. He became the Linux Quake maintainer and later that year became an official contractor at id Software.

December 1999, the Linux community received one of the biggest gifts it has ever gotten from a commercial entity: id Software released the source code for Quake under the GPL. Almost immediately, a number of people took the code base and started working on it. Since then, the codebase has forked almost as much as the Doom codebase. A group comprised of representatives from nearly every known Quake source project formed the Quake Standards Group (QSG). They aim to ensure that all the different clients and servers run with other clients and servers as well as providing uniform and effective cheat prevention methods.

These days, John Carmack and id Software are stronger than ever with their recent releases of Quake III, Return To Castle Wolfenstein and the upcoming release of Doom III. Zoid is still working at id Software but now that the open source community is maintaining high quality Quake ports for Linux, he's no longer maintaining the original Quake codebase. Currently, Dave Taylor is coding for Transmeta. If you're interested in the original source code, you can still download it from id Software's ftp server.


3.3. Quakeforge

Quakeforge is easily the most mature, featureful and actively developed of the Quake ports. It tries to be as portable and widely available as possible. For instance, it can use OSS or Alsa for sound drivers. You can play it in X or in console. You can use accelerated OpenGL or not. You can play it on any platform that supports SDL, including Linux, Win32 and MacOS.


3.3.1. Installation

Quakeforge has a long and fairly twisted history of release names. Fortunately, since we're not interested in outdated information, I won't go into any of them. There is a version called "newtree" which claims to be the stable version, but development on this tree has virtually ceased. I recommend you install the development version, simply called "Quakeforge" and numbered 0.5.x. If you want to try bleeding edge, you can use the CVS version of Quakeforge.

As of 7 August 2002, Quakeforge 0.5.0 requires autoconf 2.52, automake 1.6 and libtool 1.4.2. If you're running Debian, you'll need packages from unstable/Sid. In addition, it's recommended that you have the development packages for vorbis and xmms; Debian users will want to install libvorbis-dev and xmms-dev.

Download one of the tarballs for Quakeforge 0.5.x from http://www.quakeforge.net/files.php. Untar the package using one of the following commands, depending on whether you downloaded the tar.gz, tar.bz2 or .zip:

      tar -zxvf quakeforge-current.tar.gz
      tar -jxvf quakeforge-current.tar.bz2
      unzip -L quakeforge-current.zip
						

Then change directory into quakeforge.

      cd quakeforge
						

If you want to run the bleeding edge CVS version, perform the next steps. If you'd rather use the "stable" development version, ignore the following steps. When it asks you for a password, just press <ENTER>.

      cvs login
      cvs update
						

You'll see a bunch of stuff whiz by. After it's finished (or if you decided not to use the CVS version), perform the following steps:

      $ cd quakeforge
      $ ./bootstrap
      $ ./configure
      $ ./make
      $ su
      Password: 
      # make install
			# ldconfig
						

The last two commands must be done as root. By default, Quakeforge will install some utility directories in /usr/local/share/games/quakeforge and a bunch of binaries in /usr/local/bin. It installs quite a few FIXME

From here on in, if you ever want to update Quakeforge, just go to the directory where you made Quakeforge from and type:

      cvs login
      cvs update
						

As before, just hit <ENTER> when it asks you for password.


3.4. NPR Quake

NPR, or non photo-realistic rendering is the art of taking a 3 dimensional scene and rendering it so that it looks hand-drawn. NPRQuake is Quake I, but the rendering has been changed to NPR style rendering. To paraphrase their website, http://www.cs.wisc.edu/graphics/Gallery/NPRQuake it's kind of like running around in a painting or drawing.

NPRQuake began as a project for a computer animation course at University of Wisconsin, Madison by professor Michael Gleicher. Basically, his class took the Win32 GLQuake I engine, ripped out the renderer and wrote 3 replacement renderers:

The source code, of course, is freely available and they even give you instructions on how to make your own NRPQuake renderer. As mentioned, this project was done with Win32 GLQuake. So why mention it here? Jeremy Green ported this work to SDL, and Ryan McDougal fixed some bugs and set up a page for the Linux downloads at http://216.127.157.102/users/ryan/. You can download their SDL source code or precompiled binaries.

The whole thing is just very cool, although it's hard to discern lava or poisonous liquid, so you need to be careful about where you jump :).

On his website, Jeremy says the Linux NPRQuake is not being maintained (professor Gleicher's Windows version isn't being maintained either). So this project is dead until someone takes it over.


3.5. Dark Places

Dark Places was conceived by Forest 'Lord Havoc' Hale , a former Quakeforge developer who had conflicts with the direction of Quakeforge. This project is being moved to icculus.org from sourceforge.net. As of

In Forest's own words, Dark Places aims to help mod developers and satisfy his own desire to improve the Quake I experience. There are two components to Dark Places. First, Forest has been working with the Quake I engine to improve the quality and speed of the OpenGL renderer. Second, Dark Places is also a mod that delivers effects like flying shell casings, alpha blended explosions and blood splattered on the walls.

Dark Places is undergoing constant development but infrequent releases. As of 2002-01-16, the last release of the Dark Places mod is 2001-07-27 and the last release of the engine is 2002-01-21. It can be compiled by gcc under Linux, Visual C++ 4.0, 6.0 and mingw.


3.6. Project Twilight

Project Twilight was conceived by Joseph Carter as a Quake effort that concentrated on keeping code clean and simple so talented coders who wanted to help with the project wouldn't have as high of a learning curve in order to jump into the project.

The port uses SDL, so it can compile and run on any platform that supports SDL. The current stable version as of 7 August 2002 is 0.1.0. You can download the source code in tarball format, but Win32 binaries and source code via CVS is also available.


3.6.1. Project Twilight

Currently, you can get source code or Win32 binaries from http://twilight.sourceforge.net/releases/index.php, however, this project is in the process of moving to icculus.org. Sooner or later, these tarballs will be moved to the new site. The version currently being offered is 0.1.0. After downloading the tarball, untar it and perform the following steps to build and install the program:

      $ cd twilight-0.1.0
			$ ./configure
			$ make
				

You can also get their source code via cvs. The login password is anonymous:

      cvs -d ":pserver:anonymous@cvs.icculus.org:/cvs/cvsroot/twilight" login
      cvs -d ":pserver:anonymous@cvs.icculus.org:/cvs/cvsroot/twilight" co twilight
					

It will create a directory named twilight. You can build and install Project Twilight with:

      cd twilight
      ./bootstrap
      ./configure
      make
      FIXME
					

As of 8 Aug 2002, cvs is broken.


3.7. Add-Ons And Mods

3.7.1. Capture the Flag

Instead of just running around and killing everyone you meet (which definitely has its merits, don't get me wrong!), CTF is team-based and more strategic. Dave 'Zoid' Kirsch, the maintainer of the old id Software Linux Quake ports, created this mod.

Everything you need to know about CTF can be found at http://captured.com/threewave/. You need ftp://ftp.cdrom.com/pub/quake/planetquake/threewave/ctf/client/3wctfc.zip to play. To install the client piece of CTF, simply create a directory called ctf in your Quake directory and unzip the 3wctfc.zip file there. The accompanying readme.txt file is chock full of good information.

      cd /usr/local/games/quake
      mkdir ctf
      cd ctf
      unzip -L /wherever/you/put/it/3wctfc.zip
					

For information on running a CTF server, see the web pages mentioned above.


4. Quake II


5. Quake III: Arena


5.2. The Game

While Doom II is considered to be the canonical FPS, most people consider Quake III to be the canonical modern FPS. Some prefer Half-Life, and some prefer the Unreal games, but Quake III is still the measuring stick by which all other FPS games are measured. In fact, you'll see Quake III used as one of the standard ways to benchmark CPU's and video cards. I even think that most of us take the Quake III benchmarks more seriously than we do, say, the Winstone benchmarks.

The engine is still strictly commercial software, so no open source efforts have been started. Arguably, there's not many engines that can top Quake III, so it's still commercially viable. If id Software's past history is any indication, once it deems the engine as being less commercially important, the Quake III engine source code will be released. And when that happens, you better believe that people are going to snatch up the code and start hacking on it.

The latest release of Quake III is 1.31 as of January 2002.

You can purchase Quake III from a variety of places like tuxgames and the Activision web-store. The Windows version and many games based on the Quake III engine are known to work under wine/winex.

There are two modes of play: single player and multi-player.

In single player mode, the Vadrigar, the mysterious Arena Masters, built the "Arena Eternal" for their amusement, many centuries ago. Nobody knows much about them, but the arena is stocked with the greatest warriors in the universe. You are portrayed as "Sarge", a mighty warrior who has joined their ranks and must fight them to the death. When you are "fragged", you're immediately re-spawned back into battle, to fight for the next kill. The gladiator with the most frags at the end is hailed as the victor. The Vadrigar have set up the matches in tiers: there are 6 tiers of 4 arenas each, with a seventh tier with a single arena for Xaero, the deadliest of all warriors. After being the victor in all the arenas within a tier, you procede to the next tier to face new and tougher opponents, until you face Xaero, the Lord of the Final Arena. After winning this battle, you win the game. However, don't let any of this fool you. The plot is truly completely irrelevent to the game. The basic plot is nothing more than to kill or be killed. The instruction booklet says it best in the introduction: The plot is to kill anything that's not you.

Many people agree that this game isn't even about single single player mode; it's about multi-player internet and LAN deathmatch against human opponents. Here, all pretense of plot is dropped. It's all about pure and simple deathmatch.


5.4. Serving

There are two types of servers: listen and dedicated. Listen is in-game and is the easiest to set up. The dedicated is a separate binary called q3ded, and is strictly console mode. To join your own game, you need to run the quake3 client.

The first step in setting up a server is to make sure you have the most recent versions of the dedicated server and the quake3 client. The version as of March 2002 is 1.31.


6. Mods & Addons


7. 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 FIXME 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.


8. Quake II

8.1. Installing Quake II

8.1.1. 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:


8.1.4. 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 "Section 8.2".


8.1.5. 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 Section 8.1.1 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 Section 8.1.1 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.


8.5. 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 FIXME above. If you have a RedHat 5.x or other glibc-based Linux distribution, see Section 10.1.2 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
     

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


8.6. 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 (bk@gamers.org) 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.


8.6.2. 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.


8.6.3. 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 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 Section 10.1.2 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:

  • Remove your old Mesa installation. If you previously installed a libMesaGL.so.2.6 as described above, you must remove it or Quake II may not use the new version.
         cd /usr/local/lib/
         rm -f libMesaGL.so.2*
         

  • If the new Mesa has a major version number that's greater than 2, you need to create a link to it with the name libMesaGL.so.2:
         cd /usr/local/lib/
         ln -s /wherever/you/installed/it/libMesaGL.so.3.0 libMesaGL.so.2
         ldconfig
         

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

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


8.6.4. 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.


8.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 Section 12.3 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.


8.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 Section 12 earlier in this document.


8.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 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.


8.10.3. 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 Section 8.1.1 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.


9. Related Software ++

9.1. QStat

Qstat is a command line based program that returns the status of internet Quake, QuakeWorld, and Quake 2 servers created by Steve Jankowski mailto:steve@activesw.com.

Here's the feature summary from the QStat homepage:

  • Supports Windows 95, NT, and most Unixes

  • Comes with C source code and a binary for Windows

  • Supports old Quake (NetQuake), QuakeWorld, Hexen II, and Quake II servers

  • Can display all available statistics, including player info and server rules

  • Output templates for automatic HTML generation

  • Raw display mode for integration with HTML page generators

  • Built-in host name cache

  • Sort by ping time, game, or both

  • More options than you can wiggle a mouse at

Qstat is a must-have tool if you're planning on doing any net play. A number of front-ends for qstat have been written as well. Some of them are listed later in this section.

You can get the latest version of qstat from the QStat Homepage (http://www.activesw.com/people/steve/qstat.html.


9.2. XQF

XQF is a graphical front-end to QStat that uses the GTK toolkit. This is the best QuakeWorld/Quake2 server browser that currently exists, and Roman Pozlevich (roma@botik.ru), is still cranking out revisions at the rate of about one per month.

If you're familiar with GameSpy for the Windows platform, this is the closest thing to it for Linux.

The XQF homepage is at http://www.linuxgames.com/xqf.


9.5. qkHacklib

David Bucciarelli (tech.hmw@plus.it), author of the 3Dfx driver for Mesa, has written a library called qkHack, which tries to emulate all the SVGAlib/fxMesa functions used by Quake and Quake II. This would remove the need for SVGAlib when running glquake or Quake II with ref_gl. Other features from the qkHacklib README:

  • You can dynamically switch between fullscreen rendering and the in window rendering just pressing the TAB key (you must start your X server in 16 bpp mode in order to use this feature)

  • You can press Ctrl-C in the shell or kill the Quake process without problems

  • you can enable/disable the mouse and keyboard 'grabbing' pressing F11/F12

  • you can iconify and pause Quake pressing the F10 (it will not eat more CPU cycles). You can restart everything with a double click in the "****" icon

  • you can run Quake with any Mesa driver (for example with the X11 driver but you must recompile the Mesa without the Voodoo driver)

  • you can run Quake under any Linux box and get the hardware acclerated output on a SGI box (OK, this is a bit exotic and theoretical as feature but it is an example of how powerful can be an GLX/OpenGL application)

I've tried qkHacklib and it works great for Quake on my system. In Quake II, however, the mouse response becomes really slow. Others report complete success, though, so give it a try it it sounds like something you need.

David Bucciarelli's qkHacklib web page is at http://www-hmw.caribel.pisa.it/fxmesa/fxqkhack.html.


9.6. GiMd2Viewer

GiMd2Viewer is a Quake 2 model viewer written for Gtk and OpenGL by Lionel Ulmer (bbrox@mygale.org). It loads models and textures from either plain files or .PAK files. It will also animate the models (with frame interpolation).

This program is still under developement and I haven't tried it yet, but it sounds pretty nifty. Check it out at http://www.mygale.org/~bbrox/GiMd2Viewer/.


9.9. Q2getty

Q2getty is a hack of mingetty by Mike Gleason (mgleason@ncftp.com) that allows you to automatically run and respawn a program (like a Quake server) on a virtual console. This program is available in the files section at http://www.ncftpd.com/unixstuff/q2getty.html.


10. Troubleshooting/FAQs

10.1. General

10.1.1. OS difference considerations


10.2. Quake/QuakeWorld


10.3. Quake II


11. Tips & Tricks

11.1. Running SVGA and GL games from X **

The GLX Quakeworld and Quake II clients are native X applications, but since they use Mesa rather than the 3Dfx mini-driver, they're slower than the lib3dfxgl.so versions. For this reason, you may still favor this way of starting games from X over using the GLX clients.

This is based on a Linux Gazette Tip by Joey Hess . The original is at http://www.ssc.com/lg/issue20/lg_tips20.html#squake

Yes, it's possible to run the Quake games from X if you're root, but such behavior is naughty, and you still run the risk of having Quake crash and leave the console unresponsive. With a little work you can make it possible for a regular user to run SVGA and GL Quake from X AND automatically switch back to X when the program is finished, regardless of whether it exited normally or not.

Note: when I say "Quake" in the text below, I really mean "quake, glquake squake, qwcl, glqwcl, qwcl.x11 or quake2".

  • First, you'll need the open(1) package by Jon Tombs. This is a set of two very small programs that allow you to switch between virtual consoles and start programs on them. Download open from http://sunsite.unc.edu/pub/Linux/utils/console/. You shouldn't have to do much more than make;make install to compile and install it. Once it's installed, you need to make the open and switchto executables setuid root. So do this:

          cd /usr/local/bin
          chown root open switchto
          chmod 4755 open switchto
    			
  • Next, save the following code to a file called getvc.c:

            /* getvc.c
             * Prints the number of the current VC to stdout. Most of this code
             * was ripped from the open program, and this code is GPL'd
             *
             * Joey Hess, Fri Apr  4 14:58:50 EST 1997
             */
                 
             #include &#60;sys/vt.h&#62;
             #include &#60;fcntl.h&#62;
               
             main () {
               int fd = 0;
               struct vt_stat vt;
                 
               if ((fd = open("/dev/console",O_WRONLY,0)) &#60; 0) {
                 perror("Failed to open /dev/console\n");
                 return(2);
               }
               if (ioctl(fd, VT_GETSTATE, &ero;vt) &#60; 0) {
                 perror("can't get VTstate\n");
                 close(fd);
                 return(4);
               }
               printf("%d\n",vt.v_active);
             }
                
             /* End of getvc.c */

    Compile it and install it somewhere in your $PATH:

          gcc getvc.c -o getvc
          strip getvc
          mv getvc /usr/local/bin
    				
  • Now create a script called runvc: your $PATH:

         #!/bin/sh
         # Run something on a VC, from X, and switch back to X when done.
         # GPL Joey Hess, Thu, 10 Jul 1997 23:27:08 -0400
         exec open -s -- sh -c "$* ; chvt `getvc`"
    				

    Make it executable and put it somewhere in your $PATH:

          chmod 755 runvc
          mv runvc /usr/local/bin
    				

    Now you can use the runvc command to start Quake. Continue to use whatever command line you usually use to start your game, but put runvc at the beginning:

          runvc ./quake2 +set vid_ref gl +connect quake.foo.com
    				

    You'll automatically switch to a VC, run Quake and then switch back to X when it's done!


11.4. The Poor Man's Server Browser

Joe S. (jszabo@eden.rutgers.edu) suggests:
     a trick I do with qstat:
     I make a file of my favorite servers, then do
     qstat -f /C/quake2/file.txt | less
     

hit control z to suspend, then copy the ip address or hostname I want with gpm to a command line like:

     ./quake2 +connect expert.eqclans.com
     
Then I can use fg to go back to the list later...


12. Other Sources of Information


12.2. Linux Specific Quake Resources


12.3. General Quake Resources