From Segfault
Jump to navigation Jump to search

Quake I

In lieu of an x86-64 Quake I binary, we can install e.g. Darkplaces and point it to the Quake installation directory:

darkplaces-glx -basedir /mnt/nfs/data/games/Quake                                                            # Try darkplaces-sdl if you experience focus problems[1]




The game-data-packager[2] should be able to build all necessary packages. Before that, we'll have to fetch a few files:

$ for a in q2-314-demo-x86.exe q2-3.20-x86-full-ctf.exe q2-3.20-x86-full.exe; do wget ftp://ftp.idsoftware.com/idstuff/quake2/$a; done
$ md5sum q2*exe
4d1cd4618e80a38db59304132ea0856c  q2-314-demo-x86.exe
490557d4a90ff346a175d865a2bade87  q2-3.20-x86-full-ctf.exe
c5a1c2878c2e88fa576b7afb26b411e4  q2-3.20-x86-full.exe                                                       # Not really needed if we use the -ctf version

With that in place, let's try this:

sudo apt-get install game-data-packager quake2

Note: this will install yamagi-quake2, a Quake II client for various operating systems.

Create quake2-demo-data:

game-data-packager -d . quake2 --demo ./q2-314-demo-x86.exe 

Create quake2-full-data:

game-data-packager -d . quake2 --full /mnt/cdrom/ ./q2-3.20-x86-full-ctf.exe

Create quake2-music:

sudo apt-get install cdparanoia vorbis-tool
game-data-packager -d . quake2 --music

Note: for some reason, oggpath was not accepted and we needed to insert the actual Quake2 disc to copy (and transcode) file music files.

$ ls -lhgo quake2*deb
-rw-r--r-- 1  29M Sep 15 01:58 quake2-demo-data_37_all.deb
-rw-r--r-- 1 165M Sep 15 02:09 quake2-full-data_37_all.deb
-rw-r--r-- 1  21M Sep 15 02:22 quake2-music_37_all.deb

$ sudo dpkg -i quake2-full-data_37_all.deb quake2-music_37_all.deb


Fedora ships its own version of Yamagi Quake II, but we have to provide the game data of course:

sudo dnf install quake2

sudo mkdir /usr/local/games/quake2
sudo mv /usr/lib64/games/quake2/baseq2/{game.so,yq2.cfg} /usr/local/games/quake2/
sudo mount -o bind,ro /mnt/nfs/data/games/Quake2/baseq2/ /usr/lib64/games/quake2/baseq2/                     # Adjust as needed!
sudo mount -o bind,ro /usr/local/games/quake2/game.so /usr/lib64/games/quake2/baseq2/game.so


Build and install the Yamagi Quake II client:

sudo dnf install SDL2-devel openal-soft-devel

git clone https://github.com/yquake2/yquake2.git yquake2-git
cd yquake2-git && make
sudo mv release/ /opt/yamagi


git clone https://github.com/yquake2/rogue.git rogue-git
cd rogue-git && make
sudo mv release/ /opt/yamagi/rogue


git clone https://github.com/yquake2/xatrix.git xatrix-git
cd xatrix-git && make
sudo mv release/ /opt/yamagi/xatrix

Adjust permissions:

sudo chown -cR root:root /opt/yamagi/ && sudo chmod -c a+rX /opt/yamagi/

Setup mount points:


The Reckoning

The Reckoning is a mission pack delevoped by Xatrix Entertainment. Fortunately, Yamagi implemented those as well, so let's try to install it:

git clone https://github.com/yquake2/xatrix.git xatrix-git
cd xatrix-git
make -j4

sudo mkdir -p /usr/local/games/quake2/xatrix/
sudo cp release/game.so /usr/local/games/quake2/xatrix/

We only got hold of a CCD file containing the original mission pack and we need to extract this first:

$ ls -goh *.{ccd,img,sub}
-rw------- 1 2.8K Dec 17  2001 the.reckoning.ccd                # md5: d4d44c1fc37bfd7156b3eed11e0a3970
-rw------- 1 526M Dec 17  2001 the.reckoning.img                # md5: b276a881e94b915519df6cdd40182710
-rw------- 1  22M Dec 17  2001 the.reckoning.sub                # md5: c1f4846500b259008ed6ed4f490e83ed

$ ccd2iso the.reckoning.img the.reckoning.iso
102537 sector written
Unrecognized sector mode (a7) at sector 102537!

However, ccd2iso[3] mentions:

> currently only copies the first session of multisession discs, as well as 
> outputting a harmless warning of Unrecognized sector mode.

And although the resulting ISO file is much smaller, it's just enough:

$ ls -goh *.iso
-rw------- 1 201M Sep 28 20:10 the.reckoning.iso                # md5: 7ca003d62e144e1e087c2c1f9309b697 

$ sudo mount -t iso9660 -o ro the.reckoning.iso /mnt/cdrom/
$ sudo cp -a /mnt/cdrom/Data/{all/{docs,pak0.pak},max/xatrix/video/} /usr/local/games/quake2/xatrix/

Since yamagi-quake2 is probably installed in /usr/share/games/quake2, let's create a symlink:

sudo ln -s /usr/local/games/quake2/xatrix /usr/share/games/quake2/xatrix

This is how it should look like now:

$ find /usr/share/games/quake2/xatrix/ -type f | xargs ls -gohtrd
-r-xr-xr-x 1 3.1M Nov 26  1997 /usr/share/games/quake2/xatrix/video/idlog.cin
-r-xr-xr-x 1  18M May  1  1998 /usr/share/games/quake2/xatrix/video/xu1.cin
-r-xr-xr-x 1  14M May  1  1998 /usr/share/games/quake2/xatrix/video/xu2.cin
-r-xr-xr-x 1 8.8M May  1  1998 /usr/share/games/quake2/xatrix/video/xu3.cin
-r-xr-xr-x 1  15M May  1  1998 /usr/share/games/quake2/xatrix/video/xu4.cin
-r-xr-xr-x 1 4.5M May  7  1998 /usr/share/games/quake2/xatrix/video/logo.cin
-r-xr-xr-x 1  11M May 12  1998 /usr/share/games/quake2/xatrix/video/xout.cin
-r-xr-xr-x 1  13M May 13  1998 /usr/share/games/quake2/xatrix/video/xin.cin
-r-xr-xr-x 1  89M May 17  1998 /usr/share/games/quake2/xatrix/pak0.pak
-rw-r--r-- 1 458K Oct 16  1998 /usr/share/games/quake2/xatrix/gamex86.dll
-rwxr-xr-x 1 2.1M Sep 28  2016 /usr/share/games/quake2/xatrix/game.so

Start the new mission pack with:

quake2 +set game xatrix

Ground Zero

Ground Zero is a mission pack delevoped by Rogue Entertainment. Fortunately, Yamagi has a working port available too.

git clone https://github.com/yquake2/rogue.git rogue-git
cd rogue-git
make -j4

sudo mkdir -p /usr/local/games/quake2/rogue/
sudo cp release/game.so /usr/local/games/quake2/rogue/

We still need to copy the actual game content. It's a CCD file again, containing the original mission pack:

$ ls -goh *.{ccd,img,sub}
-rw------- 1 2.8K Dec 13  2001 ground.zero.ccd                  # md5: d383f2e9d912f7452486273838f15592
-rw------- 1 591M Dec 13  2001 ground.zero.img                  # md5: a275379cf87d6b84032fbbe7cfa1e270
-rw------- 1  25M Dec 13  2001 ground.zero.sub                  # md5: c357c18d10e70b5228e8dd8c1ffb81ce

Convert into an ISO file and ignore[3] the warning:

$ ccd2iso ground.zero.img ground.zero.iso
124684 sector written
Unrecognized sector mode (a7) at sector 124684!

$ ls -goh *.iso
-rw------- 1 244M Sep 28 22:20 ground.zero.iso                  # md5: fea42b54157d201c8e7c3ef8c98f95d3

Mount the image and copy the necessary content:

sudo mount -t iso9660 -o ro ground.zero.iso /mnt/cdrom/
sudo cp -a /mnt/cdrom/Data/{all/{docs,pak0.pak},max/Rogue/video} /usr/local/games/quake2/rogue/

Since yamagi-quake2 is probably installed in /usr/share/games/quake2, let's create a symlink:

sudo ln -s /usr/local/games/quake2/rogue /usr/share/games/quake2/rogue

This is how it should look like now:

$ find /usr/share/games/quake2/rogue/ -type f | xargs ls -gohtrd
-r-xr-xr-x 1 3.1M Aug 25  1998 /usr/share/games/quake2/rogue/video/logo.cin
-r-xr-xr-x 1  15K Aug 31  1998 /usr/share/games/quake2/rogue/docs/license.txt
-r-xr-xr-x 1  37M Aug 31  1998 /usr/share/games/quake2/rogue/video/rintro.cin
-r-xr-xr-x 1  22M Sep  1  1998 /usr/share/games/quake2/rogue/video/rend.cin
-r-xr-xr-x 1  14M Sep  1  1998 /usr/share/games/quake2/rogue/video/reu1_.cin
-r-xr-xr-x 1  12M Sep  1  1998 /usr/share/games/quake2/rogue/video/reu2_.cin
-r-xr-xr-x 1  12M Sep  1  1998 /usr/share/games/quake2/rogue/video/reu3_.cin
-r-xr-xr-x 1  15M Sep  1  1998 /usr/share/games/quake2/rogue/video/reu4_.cin
-r-xr-xr-x 1 9.5K Sep  1  1998 /usr/share/games/quake2/rogue/docs/release.txt
-r-xr-xr-x 1  52K Sep  1  1998 /usr/share/games/quake2/rogue/docs/Readme.htm
-r-xr-xr-x 1  36K Sep  1  1998 /usr/share/games/quake2/rogue/docs/readme.txt
-r-xr-xr-x 1  18K Sep  1  1998 /usr/share/games/quake2/rogue/docs/license.doc
-r-xr-xr-x 1  26K Sep  2  1998 /usr/share/games/quake2/rogue/docs/Release.htm
-r-xr-xr-x 1 105M Sep  2  1998 /usr/share/games/quake2/rogue/pak0.pak
-rwxr-xr-x 1 2.5M Sep 28  2016 /usr/share/games/quake2/rogue/game.so

Start the new mission pack with:

quake2 +set game rogue




The quake3 package[4] contains the launcher script only:

sudo apt-get install quake3

Now we need to create the quake3-data package with game-data-packager[2]

game-data-packager -d . quake3 ../Quake3/baseq3/pak0.pk3 ../linuxq3apoint-1.32b-3.x86.run

Note: linuxq3apoint-1.32b-3.x86.run (MD5: c71fdddccb20e8fc393d846e9c61d685) can be omitted if not available and game-data-packager will try to download it from known sources.[5]

After quake3-data_NN_all.deb has been built, it can be installed:

sudo dpkg -i quake3-data_*_all.deb


Again, Fedora ships a quake3 package and we only need to provide the data files:

sudo dnf install quake3
sudo ln -s /mnt/nfs/data/games/Quake3/baseq3 /usr/share/quake3/baseq3                           # Adjust as needed!

The only inconsistency here is that the Quake 2 data files were expected in /usr/lib64/games/quake2 and the Quake 3 files in /usr/share/quake3.


Get ioquake3 and install as needed:

$ ls -hdgo baseq3/ ioquake3* missionpack/
drwxr-xr-x. 1  224 Mar  6 20:50 baseq3/
-rwxr-xr-x. 1  879 Mar  6 20:45 ioquake3
-rwxr-xr-x. 1  916 Mar  6 20:48 ioquake3-q3ta
-rwxr-xr-x. 1 1.6M Mar  6 20:45 ioquake3.x86_64
drwxr-xr-x. 1  128 Mar  6 20:48 missionpack/


If Quake3 appears too dark in-game, try the following[6] in the console:

r_ignorehwgamma 1
r_overbrightbits 1


Unpack maps either into the baseq3 directory or create a subdirectory and call quake3 accordingly:

$ ls -go /usr/share/quake3/
lrwxrwxrwx. 1    33 Jan  9 17:22 baseq3 ->      /nfs/games/Quake3/baseq3
lrwxrwxrwx. 1    31 Apr  2 16:58 cpma ->        /nfs/games/Quake3/cpma
lrwxrwxrwx. 1    35 Apr  2 16:57 lvlworld ->    /nfs/games/Quake3/lvlworld
lrwxrwxrwx. 1    38 Apr  2 16:58 missionpack -> /nfs/games/Quake3/missionpack
lrwxrwxrwx. 1    30 Apr  2 16:58 osp ->         /nfs/games/Quake3/osp

$ quake3 +set fs_game lvlworld
----- FS_Startup -----
Current search path:
/usr/share/quake3/lvlworld/ztn2dm3.pk3 (50 files)
/usr/share/quake3/lvlworld/ztn2dm2.pk3 (27 files)

Note: some (newer) maps are quite large and may fail to load with:


Increasing com_hunkMegs from its default ("56") seems to help:

$ grep hunk ~/.q3a/lvlworld/q3config.cfg
seta com_hunkMegs "128"



The following has been tested for Debian GNU/Linux.

We will need the original Quake4 installation disk for this:

mkdir -p /opt/quake4/q4base
rsync -avP /mnt/cdrom/Setup/Data/q4base/*.pk4 /opt/quake4/q4base

Download quake4-linux-1.4.2.x86.run (MD5: bd2cb8164ede4272adcc091f724855ac)

wget ftp://ftp.idsoftware.com/idstuff/quake4/linux/quake4-linux-1.4.2.x86.run
sh quake4-linux-1.4.2.x86.run                                     # Adjust TMPDIR if /tmp is mounted with "noexec" 

Follow the instructions, adjust the installation directory as needed. To play the game, use one of:

/opt/quake4/quake4smp.x86                                         # For SMP systems

unable to load driver: i965_dri.so

--------------- R_InitOpenGL ----------------
Initializing SDL subsystem
Loading GL driver 'libGL.so.1' through SDL
1920x1080 SDL_ListModes are currently ignored for resolution filtering. Set r_useSDLModes to 1 if you want it
libGL error: unable to load driver: i965_dri.so
libGL error: driver pointer missing
libGL error: failed to load driver: i965
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  151 (GLX)
  Minor opcode of failed request:  3 (X_GLXCreateContext)
  Value in failed request:  0x0
  Serial number of failed request:  34
  Current serial number in output stream:  35
pure virtual method called
terminate called without an active exception
signal caught: Aborted
si_code -6
Trying to exit gracefully..
pure virtual method called
terminate called recursively
double fault Aborted, bailing out

Most likely the libgl1-mesa-dri package needs to be installed for the i386 architecture, since Quake4 doesn't ship x86_64 binaries:

sudo apt-get install libgl1-mesa-dri:i386

Note: this didn't help on a Fedora installation though :-\

Texture compression unavailable

...using GL_ARB_multitexture
...using GL_ARB_texture_env_combine
...using GL_ARB_texture_cube_map
...using GL_ARB_texture_env_dot3
...using GL_ARB_texture_env_add
...using GL_ARB_texture_non_power_of_two
...using GL_NV_blend_square
...using GL_ARB_texture_compression
X..GL_EXT_texture_compression_s3tc not found
Fatal Error: Texture compression unavailable
Shutting down SDL subsystem
Sys_Error: Texture compression unavailable

This happened on a Intel HD4000 video adapter - which may not support S3TC texture compression[7]. To workaround this, use driconf

sudo apt-get install driconf
driconf                                                           # As a user!
=> Image Quality
=> Enable S3TC texture compression even if software support is not available



Since we installed Quake4 via the Mac App Store, here's how to install the mods on our Mac:

cd ~/Library/Containers/com.aspyr.quake4appstore/Data/Library/Application\ Support/Quake\ 4
mkdir q4max sabot

cd q4max
unzip ~/q4max082.zip

cd ../sabot
unzip ~/sabota11.zip

cd ../
unzip ~/q4max-aas-01.zip 

With all that in place, the mods should be loadable via the in-game "MODS" loader.

Now, in the Quake4 console again:

addBot cortez                   # Add bot with "cortez" skin
addbot cortez 3 blue 100 foobar # Same, with skill level 3, team blue, 100 msec delay and name "foobar"
bot_skill 2                     # Set bot skill to "2"
ui_autoSwitch 0                 # Disable automatic weapon switching
ui_showGun 0                    # Do not show weapon
m_pitch -0.222                  # Set to a negative value to invert the mouse
com_showFPS 1                   # Display frames-per-second
pm_speed       250              # How fast you move when running (160)
pm_crouchspeed 150              # How fast you move when crouched (80)
pm_walkspeed   150              # How fast you move when walking (80)
pm_jumpheight   60              # How high you can jump (48)
pm_noclipspeed 300              # How fast you move in noclip mode (270)

To set these values permanently, Quake4Config.cfg has to be modified:

$ cat ~/Library/Containers/com.aspyr.quake4appstore/Data/Library/Application\ Support/Quake\ 4/q4base/Quake4Config.cfg
bind "`" "toggleconsole"
bind "~" "toggleconsole"
seta com_allowConsole "1"

Known Issues

 ERROR: Error: file pak000.pk4/scripts/bot_sabot_events.script, line 10: Unknown event 'setState'