Lately I've had a renewed interest in graphics programming, and I went back to basics, rereading everything I could find about the original Quake, and simultaneously brushing up on some (relatively speaking) more recent developments, like how to write shaders (via OpenGL's fragment program extension), normal mapping, etc. Inevitably the mood struck me to play the original Quake. All I have available to me at present is a laptop running Linux. Luckily, I still have the Linux version of Quake: The Offering (Quake 1 plus both mission packs) installed, passed along between successive Linux installs over the past decade, like a family heirloom. Of course none of the official binaries run anymore, binary compatibility on Linux being mostly nonexistent, so I set about finding a suitable engine port.
I was surprised that a quick "apt-cache search" didn't find anything. Looking around the web, there are a number of interesting engine ports, but most of them looked undesirable from the perspective of someone wanting to play the game more or less as it was originally made, not with upgraded rendering technology, new models/textures, or the other cool things that most of the engine ports indulge in. New features thus became a turn-off, and I went for the most plain-sounding engine port I could,
SDLQuake.This had a few problems, which I fixed:
- Autotools bit rot
- Use SDL 1.2 (check for SDL 1.0.9 failed)
- Fix config.cfg loading (it tried to reload from a different directory than it had been saved, losing my key bindings every time)
- Fix garbled sound (set sample rate to 48 KHz by default - ALSA still sucks)
- UDP netcode seemed to be doing a blocking instead of non-blocking read.
Also a few gratuitious changes:
- Start in fullscreen by default
- +mlook at startup
If I spend any more time on this, there's a few more easy things left to do:
- Compile a glquake executable (right now it's only compiling the software-rendered version)
- Support for streaming the ripped soundtrack from .ogg or .mp3 files.
I'd have hacked the music code in immediately were it not for the small inconvenience of having to run the audio at 48 KHz instead of 44.1 KHz (the rate that songs ripped from the CD will be at) due to whatever ALSA stupidity causes the audio to be corrupted on this machine (it's audible, but there's a lot of crackling, like samples are missing or clipped). While Quake is happy to put its 11 KHz sound effects through the grinder with no proper resampling (it upsamples using a fixed-point "nearest sample" approach), that would really make the music sound like crap. Of the decoder libraries I know how to use off the top of my head, libmpg123's resampling sounds like garbage, and libvorbisfile doesn't offer it at all. I don't have a 44.1KHz -> 48KHz resampling routine lying around, and always make simple DSP code out to be harder than it really is, so I put off hacking in support from the music. The original SDL port will play the music from CD, if you have it in your drive (I didn't, and found myself playing Quake to the soundtrack of a "Learn Thai Language" CD instead, which didn't fit very well). In other words, I'm lazy, and didn't want to spend a couple extra hours sorting the music out. Sorry!
Anyway, maybe someone will find this useful - or, perhaps, someone will think I'm a moron for screwing with this instead of using one of the other Quake engine ports. Either way, I've thrown the code up on Github
here.