QuadaverNet : HowtoQuake2ClientLinux

StartSeite :: TextSearch :: PageIndex :: RecentChanges :: Login/Account :: You are 38.107.191.107

HOWTO... Make a Quake II client running under Linux


Introduction

This Howto will describe what one has to do when installing Quake 2 for playing under Linux. We will talk about general stuff as well as about different possible clients for Quake 2. Saying this, it's actually sure this document may change very often as clients change too. The only thing that remains the same is the system. It's Linux - an often overseen system concerning gaming. It's ready for gaming - and it's been ready for Quake 2 for ages. Many things have changed so far so we're going to write a Howto that considers todays clients and specialities.

You won't find any information about Windows stuff here. Don't try to bug us with Windows-questions as they often are system-self-made conceptual problems and thus, plain stupid.

Index

- ATI or nVidia?
- a general Q2-installation
  • Gamedirs and gamei386.so
- Linux-capable clients
  • Icculus Q2
  • AprQ2
  • R1Q2 (tricky)
    • SDLQuake2
  • Quake2Forge
- Small hints/other things
- Authors own comments and recommendations
- Contact
- Credits



ATI or nVidia?

The market of graphic processor vendors is split into three. Intel, the biggest one followed by ATI and then NVIDIA. We're talking about the whole graphic processor market. This doesn't necessarily mean that it's best to have an Intel GPU at your Linux box. We rather propose you to have an NVIDIA card, since the NVIDIA Linux drivers just work nicely. We had many troubles already to get ATI to work on Linuxes... perhaps they should improve there. Talking of Intel GPUs they are more wide-spread around notebooks, servers, thinclients but not really established among gamers.
So final word: Even though ATI cards are cheaper and have some really comparable power to nVidia, we prefer nVidia over ATI for Linux :)


a general Q2-installation

A general Q2-installation consists of the base-directory ./ and the sub-directories for specific games... The standard q2-game-directory is always called "./baseq2". The base-directory is supposed to have the quake2-client that runs the games. So if you want to run the single player "game" you just need to start the quake2-binary since the baseq2 is assumed to be the default-game. :)
If you want other games, you can change the game-directoy by typing "game mygamedir" at the console or start your Quake 2 with the commandline paramater "+set gamedir mygamedir".
The gamedir optionally has directories like ./demos, ./save and ./scrnshot or ./screenshots and depending on different artworks needed for the game there's ./textures, ./sounds, ./players etc. :) To have a more compact overview of gamedirs, so called PAK-files may contain those files as well. To tell the clients in which order PAK-files have to be loaded, their naming-scheme looks like pak0.pak to pak9.pak (depending on the client unlimited and even other named PAK-files are allowed).

You get the picture of:
./baseq2
./baseq2/save
./action
./action/players
./action/scrnshot
./action/demos


Gamedirs and gamei386.so

Generally, every gamedir has a "gamei386.so". The gamei386.so is just the file that carries the logic that Quake 2 has to load before you can play with Quake 2. On Windows, that file is called "gamex86.dll".
Thus said, Quake 2 has a very modular structure and perhaps that is why Quake 2 became so popular in a short time. Third-party games came up and bound the gamers to their chairs. :)
Nevertheless there are some problems with gamei386.so


Linux-capable clients

For the moment, there are not sooo much Linux-capable clients, and yet not very many to offer a decent multiplayer experience. Then again one offers features that the other one doesn't. Whatever, here's the short list:

- Icculus Q2 (http://icculus.org/quake2/)
- AprQ2 (1.17) (http://apprime.0wns.org/q2)
- R1Q2 (http://www.r1ch.net/stuff/r1q2/) - tricky
  • SDLQuake2
- Quake2Forge (http://www.quakeforge.net/files.php#quake2)

Icculus Q2

The Icculus build of Quake 2 offers a very basic set of features that every Quake 2 client should normally have. Easy speaking it's a 100% port of the original windows version PLUS many technical additions and bugfixes to it. For example the ALSA sound support is a very good one for which every other Quake 2 client should strife to. Arts (the KDE sound server) sound support may be a nice addition too but is not that exciting considering the fact that on todays kernels Arts in the end only gives the sound back to ALSA. And so does the SDL support - but SDL offers an cross-plattform graphic API too.. so, talking about games, SDL is considered a better choice. And talking about sounds, a direct ALSA support is better than SDL sound.

Whatever, the Icculus Q2 is build with portability im mind, so you could even be able to play it on Solaris and x86 64bit processors.
Here (http://www.icculus.org/quake2/#download) Icculus lists possible binary distributions to try. You can either chose the loki installer or use a RPM-package... yet that's a bit unsatisfying, that is why we chose the source-way :) making sure the build is compatible with our system.

Create a source directory, change into and get the current sourcepackage:
$ wget http://www.icculus.org/quake2/files/quake2-r0.16.1.tar.gz

Extract it:
$ tar xzvf quake2-r0.16.1.tar.gz

Change into the newly created quake2-r0.16.1 directory:
$ cd quake2-r0.16.1

Compile the whole icculus Quake 2 build:
$ make

If it complains and fails to compile for some reason, then you most likely don't have the needed packages installed that Icculus wants to build support for. Just edit the "Makefile" and chose the appropriate support you want by adjusting the variables.
BUILD_SDLQUAKE2=NO for example if you don't want SDL support at all. Re-start the making process by typing "make" again.

After building there's a "releasei386" directory where you will find all the binaries. Copy them to your gamedirectory (cp xxx yyy) or make symlinks (ln -s xxx yyy).

AprQ2

AprQ2 has about all the eyecandy the other clients have when combined, and some userfriendly stuff. It's also probably the only client atm that has xmms/bmp commands. Maniac will probably listen to any kind of possible improvements concerning the user interface or such. Unlike R1Q2, this client doesn't have a release almost weekly. Usually there's a release with a larger number of new things and many tweakings. The renderer is implemented and thus isn't available to be used with other clients. AprQ2 comes with two executables, one for gl and one for software, and the software one is the best to be used, if a must. AprQ2 is the client supporting about anything, and the newest version supports R1Q2's protocol35 also.

Get the source package:
$ wget http://apprime.0wns.org/q2/aprq2_v1.18_src.zip

Make a directory for it and move the package there:
$ mkdir aprq2src && mv aprq2_v1.18_src.zip aprq2src && cd aprq2src

Unzip it:
$ unzip aprq2_v1.18_src.zip

In case you wish to change the things to compile, edit the makefile. Though you probably won't need to change anything.
Then compile the source:
$ make

If the compilation fails, you're probably missing some libraries. Update your libraries and run the compilation again with make.
Now that it's compiled, copy everything from releasei386/ to your q2 directory:
$ cp releasei386/* /your/quake2/folder/

A typical AprQ2 startingline looks like:
$ ./aq2 +set gl_driver /usr/lib/libGL.so

You can also add that "set gl_driver /usr/lib/libGL.so" into your config, so you can just start with ./aq2, making things a bit easier.
Also, you may wish to get the normal aprq2_v1.18.zip for the readme and the changelog, so you can use the client to its fullest.

R1Q2

R1Q2 is a client that not only adds features for gameplay like locfile-support, but also some technical improvements to the game. R1Q2 corresponds to the R1Q2 dedicated server very well. If you connect to a R1Q2 dedicated server the client will chose to use another protocol. R1CH, the author of R1Q2 is a performance, stability and security zealot and always tries to find new possible ways to optimize play over a network. So R1Q2, the client itself, can truely be called technology leader of all the Quake 2 clients out there.
And since Quake 2 always had a modular layout concerning the possible renderers, you can chose whatever renderer you want for R1Q2. Of course people should go for R1GL which is a renderer with the same design goals as R1Q2 from R1CH.
Yet, there's only a R1Q2 client linux version released and building the renderer R1GL is a bit tricky.

To build the client on linux, get the latest source package of http://www.r1ch.net/stuff/r1q2/src/ ...

Create a source directory like: ./r1q2-5930/ change into there and grab the current source:
$ wget http://www.r1ch.net/stuff/r1q2/src/r1q2-b5930-src.zip

Extract it:
$ unzip r1q2-b5930-src.zip

Make sure you have OpenAL installed! If you don't want to install OpenAL for positional audio at all, then edit the Makefile in ./binaries/client/ to NOT have the line with "-DUSE_OPENAL".
If you want to take advantage of the new http-downloading feature, then also add "-DUSE_CURL" to the CFLAGS.
Also, extend the quake2_SRC variable with "cl_http.c" on line 13.

To fix an issue with the "cl_async" command, we have to apply a .diff file to cl_main.c in the "client" directory:
$ cd client
$ wget http://koti.mbnet.fi/~turol/r1q2/linux-async.diff
$ patch -F3 < linux-async.diff
$ cd ..


Now, to finally make it, change into the client binaries directory:
$ cd binaries/client/

Build it:
$ make

After building is over, a "quake2" binary has been build. Now change back to your Quake 2 game base-directory and make a link to this newly built R1Q2 binary:
$ cd ~/Games/quake2
$ ln -s ./r1q2-5930/binaries/client/quake2 r1q2


Your gamedirectory now has a file that's called "r1q2" and links to the quake2-binary we just have been build.
So far for the client - but we still need a renderer for Quake 2 to run.. go on with SDLquake2 or use a renderer of the Quake2Forge package below.

A typical R1Q2 startingline would be - notice the "sdlgl" renderer line taken from SDLQuake2.
$ ./r1q2 +set vid_ref sdlgl +set gl_driver /usr/lib/libGL.so

Note: R1Q2 doesn't support SDL-Sound (for users that want Quake2 to use ALSA) out of the box. If you want ALSA support, it's recommended to use SDLQuake2 (based on r1q2) in general. The only problem at the very moment is, SDLQuake2 hasn't been updated since r1q2 version 5510 so it's not on the latest 5930.. :(


SDLQuake2

Create and change into another directory for making SDLQuake2 :) and download the latest SDLQuake2 of turol there:
$ wget http://koti.mbnet.fi/~turol/sdlquake2/sdlquake2-0.1.4.tar.bz2

Extract it:
$ tar xjvf sdlquake2-0.1.4.tar.bz2

This will create another directory with all the files in it. Change into it:
$ cd sdlquake2-0.1.4

Be sure to review the Makefile since on the second line it contains:
CFLAGS:=-O3 -ffast-math -march=athlon-xp -g -Wall $(shell sdl-config --cflags)
Change "-march=athlon-xp" to your CPU-architecture.. Well, if you don't know what architecture you have, just put "i386".
And note that you need to have libSDL (http://www.libsdl.org) installed before you can go further. It's a dependency of SDLQuake2.

Then make it:
$ make


After making process you will have a "quake2" binary as well as a "ref_sdlgl.so". Our main focus is the "ref_sdlgl.so". Rember its location.

Change back to your gamedirectory and create a link to the files:
$ cd ~/Games/quake2
$ ln -s ./sdlquake2-0.1.4/quake2 sdlquake2
$ ln -s ./sdlquake2-0.1.4/ref_sdlgl.so


Well done, you now have a SDL renderer for your R1Q2 package and even a fully capable SDL Quake 2 client that even has SDL sound to use ALSA.

A typical SDLQuake2 startingline would be:
$ ./sdlquake2 +set vid_ref sdlgl +set gl_driver /usr/lib/libGL.so


Quake2Forge

Quake2Forge may rather be called a proof of concept than a real alternative for linux gamers that want a nice multiplayer and single player client. They have some nice approachs as like Icculus' build - doing things with ALSA and SDL. If you want to try it, even though it is now over a year old and had no undergoing development since then, go on:

Get the source:
$ wget http://www.quakeforge.net/files/quake2forge/quake2-0.3.tar.gz

Extract it:
$ tar xzvf quake2-0.3.tar.gz

Change into the source directory:
$ cd quake2-03

Build it:
$ aclocal
$ automake
$ ./configure
$ make


After building you most likely will have different renderers in (./src/.libs/) available:
ref_soft.so, ref_softx.so, ref_softsdl.so, ref_glx.so, ref_tdfx.so, ref_sdlgl.so

Having the soundssupport as libraries is one of the improvements of Quake2Forge - it's just more modular:
snd_alsa.so, snd_ao.so, snd_oss.so, snd_sdl.so
The soundsupport libraries are located in ./src/.libs/ as well.


Good, so I would chose: ref_sdlgl.so and snd_alsa.so :)

To install it, you would need root privileges:
# make install
Remember the directory where it installed it to. So, later, copy it whereever you really want it to be.

OR, with user-privileges, just copy the files you want out of the ./src/ and ./src/.libs/ directories to your home-directory.


Small hints/other things

  • Windows uses the basic US keyboard layout for Quake 2. On Linux your client will use the same layout on all X programs. This won't be that big a change for qwerty users, just that the smileys aren't where they were in Quake 2 before. Ofcourse you can use that US layout if you wish. Use "setxkbmap us" before you start Q2 .. after Q2 you will have to set it back to your standard mapping.

  • The "s_khz" doesn't work in all Linux clients. Use "sndspeed" instead. The value should be in hz, so eg "s_khz 44" would be "sndspeed 44100"

  • Quake 2, XMMS and TeamSpeak is an often wanted configuration. First off, TeamSpeak has no ALSA (only stupid OSS) support which makes life much harder. ALSA can mix sound in software but TS has no ALSA support, so it wants to access the soundcard via OSS exclusively .. and that is why you will even need a soundcard that is capable of hardware mixing. Any Soundblaster Live! with EMU chipset can do that (watch out for the EMU chipset! There's one Soundblaster Live! that has NO EMU chipset.).
    Then, you will need to adjust some settings on your ALSA-system:
    # echo r1q2 0 0 direct > /proc/asound/card0/pcm0p/oss
    # echo r1q2 0 0 disable > /proc/asound/card0/pcm0c/oss

    This will tell ALSA, that, if the binary "r1q2" wants to access OSS (/dev/dsp) it should be routed directly to the soundcard... and the soundcapturing should be disabled. We disable soundcapturing and make playback directly since TeamSpeak wants to have exclusive access to these itself. The current TS version sucks there. Please tell the TS-developers they should create ALSA support for their software.

Set XMMS to use the ALSA output plugin.

You wouldn't need to have a soundcard capable of hardware mixing (and the above settings for it) if every application had ALSA support. Quake 2 and XMMS can have ALSA support, but TeamSpeak has not (yet).

  • Although we generally recommend NVIDIA as graphics card vendor people often have ATI cards... and one of the most problems when trying to run a quake2 client is to have the right "+set gl_driver" line. With NVIDIA cards, you just need "+set gl_driver /usr/lib/libGL.so", while with ATI's "fglrx" rather needs: "+set gl_driver /usr/lib/ati-fglrx/libGL.so.1". To find the appropriate gl-driver do: "locate libGL.so".


Authors own comments and recommendations

HaudraufwieniX suggests:
AprQ2 and R1Q2 are the real Quake 2 client flagships for todays multiplayers around the world. R1Q2 has numerous improvements that cooperate with the wide-spread R1Q2-dedicated and thus has many advantages in its network code. R1Q2 is a nice proof of concept of many new innovative stuff. But, for example, the loc-file support on R1Q2 is not so nice - and that's a key multiplayer feature.
So, for ease of use and good multiplayer experience I recommend AprQ2 since it adopted many useful features of R1Q2, has a better Linux support is much easier to use in many areas plus many optional graphical goodies. :)

ImEiZ (this page required uppercase letters, so lame it is. my nick is imeiz. ;>) suggests:
AprQ2, been using it since about the first version. It's not only that AprQ2's had some nice graphical stuff, but it's so userfriendly too.


Contact

No phonecalls or fanmail. You can find us both in IRC, #aq2world @ QuakeNet.
If you don't like imeiz but want to contact Haudrauf, you can find him on #quadaver QuakeNet.

Ah, and if this document saved you a lot of precious time, you may want to donate me/us something.

Credits

I want to thank the client developers in AQ2-scene, Maniac- and R1CH. And Haui's mom too. -imeiz
Credits fly out to Google from which I got most by doing research about all that stuff. And greetings to all those lazy question-askers that led me to make this page - so I won't get bugged so often anymore. --HaudraufwieniX, 2005-06-19 13:52:24 (Sun)


(c) copyright 2005 Paul Klumpp (QuAd|Haui) and Sebastian Salminen (imeiz). Please link here. If you want to quote, you must give credit. Don't copy and declare as your own stuff. All Rights Reserved.