QuakeSpasm
Page last edited: July 2024.
QuakeSpasm is a modern cross-platform Quake engine based on FitzQuake.
It includes support for 64 bit CPUs and custom music playback, a new
sound driver, some graphical niceities, and numerous bug-fixes and other improvements.
Quakespasm utilizes SDL-1.2 or SDL2 frameworks, choose one which works best for you.
SDL2 has nicer features, smoother mouse input and better support for newer operating systems,
but no CD-ROM support.
Visit the
FitzQuake homepage for a full run-down of the engine's commands and variables.
- To disable some changes, use "quakespasm -fitz"
- Quakespasm's custom data is stored in "quakespasm.pak". Install this file alongside your id1 directory to enable the custom console background and other minor features.
- For different sound backend drivers use :
"SDL_AUDIODRIVER=DRIVER ./quakespasm"
where DRIVER may be alsa, dsp, pulse, esd ...
- Shift+Escape draws the Console.
- From the console, use UP to browse the command line history and
TAB to autocomplete command and map names.
- There is currently no CD Music volume support and SDL2 doesn't support CD audio. cd_sdl.c needs replacing with cd_linux.c, cd_bsd.c etc..
- In windows, alternative CD drives are accessible by
"quakespasm -cddev F" (for example)
- Quakespasm allows loading new games (mods) on the fly with
"game GAMENAME {-quoth/hipnotic/rogue}"
- Use "quakespasm -condebug" to save console log to "qconsole.log". SDL2 builds no longer generate stdout.txt/stderr.txt.
Quakespasm can play various external music formats, including MP3, OGG and FLAC.
- Tracks should be named like "track02.ogg", "track03.ogg" ... (there is no track01) and placed into "Quake/id1/music".
- Unix users may need some extra libraries installed: "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG.
- Use the "-noextmusic" option to disable this feature.
- As of 0.90.0, music is played back at 44100 Hz by default with no need to adjust "-sndspeed".
- See
Quakespasm-Music.txt for more details.
The SDL2 variant of Quakespasm supports Xbox 360 style game controllers.
The default configuration uses the left analog stick for movement and the right for looking.
If your controller doesn't work you can try placing
this file in your Quake directory, it is a community-maintained database that adds support for more controllers to SDL2.
Cvars
- joy_deadzone_look - Fraction of look stick travel to be deadzone, between 0 and 1. Default is 0.175.
- joy_deadzone_move - Same as above, but for the move stick. Default is 0.175.
- joy_deadzone_trigger - Fraction of trigger range required to register a button press on the analog triggers, between 0 and 1. Default 0.2.
- joy_outer_threshold_look - Outer deadzone for the look stick, between 0 and 1. Default 0.02.
- joy_outer_threshold_move - Outer deadzone for the move stick, between 0 and 1. Default 0.02.
- joy_sensitivity_yaw/pitch - Max angular speed in degrees/second when looking. Defaults are 240 for yaw (turning left/right) and 130 for pitch (up/down).
- joy_exponent - For the look stick, the stick displacement (between 0 and 1) is raised to this power. Default is 2. A value of 1 would give a linear relationship between stick displacement and fraction of the maximum angular speed.
- joy_exponent_move - Same as joy_exponent but for the move stick. Default is 2.
- joy_invert - Set to 1 to invert the vertical axis of the look stick.
- joy_swapmovelook - Set to 1 to swap the left and right analog stick functions. Default is 0, move on the left stick, look on the right stick.
- joy_enable - Set to 0 to disable controller support. Default is 1.
Buttons
Some of the controller buttons are hardcoded to allow navigating the menu:
- Back - alias for TAB
- Start - alias for ESC
- DPad, analog sticks - mapped to arrow keys
- A Button - alias for ENTER in menus
- B Button - alias for ESC in menus
These buttons can be bound normally:
- LTRIGGER - Left trigger
- RTRIGGER - Right trigger
- LSHOULDER - Left shoulder button
- RSHOULDER - Right shoulder button
- LTHUMB - Clicking the left thumbstick
- RTHUMB - Clicking the right thumbstick
- ABUTTON
- BBUTTON
- XBUTTON
- YBUTTON
quakespasm.pak contains a default.cfg which has been updated to give some default bindings. L/R shoulder buttons are bound to weapon switching, and L/R triggers are jump and attack.
The controller support started as Jeremiah Sypult's implementation in Quakespasm-Rift, and also uses ideas/code from LordHavoc's DarkPlaces.
See the Downloads section to get the sourcecode, then below for platform specific instructions.
Quakespasm can also be built with the cross-platform Codeblocks.
Quakespasm's (optional) custom data is now stored in the file quakespasm.pak. This file should be placed alongside your quakespasm binary and id1 directory.
After extracting the source tarball, "cd Quake" and edit the Makefile for music options.
Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.
Then type "make" to compile the program, and copy the "quakespasm" binary (and "quakespasm.pak") to your Quake game directory.
Compile time options include
- make DO_USERDIRS=1 to include user directories support
- make DEBUG=1 for debugging
- make SDL_CONFIG=/PATH/TO/sdl-config for unusual SDL installations
- make USE_SDL2=1 to compile against SDL2 instead of SDL-1.2
QuakeSpasm developers cross-compile windows binaries using
MinGW-w64 and
MinGW.
The project can also be built using Microsoft Visual Studio 2005 and newer versions.
A Quakespasm App (including program launcher and update framework) can be made using the Xcode template found in the MacOSX directory.
Alternatively, have a look at Makefile.darwin for more instructions on building from a console.
QuakeSpasm 0.94 has support for playing the 2021 re-release content: Copy the quakespasm binary to your rerelease installation and run as you normally do.
- Fix potential infinite loop when playing sounds with loop start >= end (e.g. misc/forcefield.wav from Madfox's kaptlog.zip)
- Fix possible overflow when resampling very big sounds (e.g. gram1.wav from the 'A day like no other' mod.)
- Change Sky_ClipPoly to allocate on the heap in if MAX_CLIP_VERTS limit is reached (e.g. with lim_daviddg from Liminal Spaces Jam)
- Minor code cleanups. Updates to third party code.
- Thanks to Andrei Drexler, Vincent Sonnier, Alexey Lysiuk, and Jaycie Ewald for patches.
- Fix stack buffer overrun Mod_PolyForUnlitSurface: fixes crash when loading lim_daviddg.bsp from Liminal Spaces Jam.
- Fix potential buffer overflow in progs global string functions.
- Fix potential buffer overflow in Mod_LoadAliasFrame()
- Optimize BoxOnPlaneSide()
- Reserve enough space in PF_makestatic() for worst case scenarios.
- Improve handling of huge entities in SV_FindTouchedLeafs()
- Warn about bad maps with only 1 or 2 edges per face (e.g.: mj4m?, alk_dancing, ej3_bizz, rotj_entsoy...)
- Apply FOV gun scaling for r_showtris
- Sliders with visible values in options menu.
- game command now refuses setting a non-existing game directory
- Fix build in C23 mode.
- Minor code cleanups. Updated third party code, e.g. SDL, music codecs, etc.
- Thanks to Andrei Drexler, Alexey Lysiuk, Diordany van Hemert, and Jaime Moreira for patches.
- Fix demo recording as client-only after connection to server (was broken by signon changes in 0.96.0. Thanks to Jozsef Szalontai for issue report.)
- Fix potential buffer overflow in COM_Parse(), e.g. with maps with oversized 'wad' fields. (Thanks to Andrei Drexler.)
- Minor code cleanups.
- Adjustments to joystick defaults and behaviour. See the "Controller support / Cvars" section above.
- Fix for a mouse grabbing issue on macOS.
- Add missing support for -ip command line option on unix / macOS.
- Backport angled sprites code from FTEQW (spriteframetype: 2, must have 8 frames per group.)
- Bump the progs execution runaway loop limit to 16M.
- Add signon buffer fragmentation to fix SZ_GetSpace errors on certain maps when using protocol 999.
- Increased MAX_DATAGRAM to 64000 to overcome packet overflows.
- Bump the MAXALIASFRAMES limit to 1024.
- Fix arrays to have proper sizes in gl mesh code, reflecting MAXALIASTRIS and MAXALIASVERTS correctly. (fixes SIGSEGV in mj4m4/mj4m5.)
- Increased default value of gl_farclip to 65536.
- Increase chase cam target trace distance to allow for chasecam to function in large open maps (useful e.g. for the func_vehicle mod.)
- Raised default maximum number of particles to 16384 (can be set up to 32768 with -particles on the command line.)
- Fix on-screen keyboard showing up suddenly on Steam Deck when starting a map.
- Fix viewmodel interpolation with >10Hz animations.
- Fix a memory leak when exiting game in SDL2 builds.
- Fix a possible crash when handling clipboard data on macOS.
- Fix a potential crash after loading of saved game.
- Fix possible out-of-bound reads when handling progs type sizes.
- Fix Dutch angle VP_PARALLEL_UPRIGHT sprites.
- Fix an issue with lights blending by using 10 bit color depth for lightmaps. (For GLSL mode only.) Disable with "-nopackedpixels", if necessary.
- No relative motions when the window is not focused.
- Status bar and intermission screen tweaks.
- Properly display monster counts > 3 digits.
- Fix console animation with scr_conspeed <= 0.
- Fix mouselook not working upon game quickload during a demo play.
- Haiku operating system support.
- Fix console when server is run noninteractively with stdin redirected from /dev/null.
- Updated Visual Studio project files.
- Minor code cleanups. Updated third party code, e.g. SDL, music codecs, etc.
- Thanks to Andrei Drexler, Alexey Lysiuk, Andrey Budko, Boris I. Bendovsky, Chris Cowan, Maciej Olędzki, Simon McVittie, OscarL, Eric Wasylishen, Jaycie Ewald and Spike for patches.
- Allow mixing lit and unlit textures in the same map.
- Water texture mipmapping support - fixes glistening effect on distant water.
- Fix screen flashes in some maps with AMD's new drivers.
- Defend against zero-sized textures, e.g. __TB_empty in qbj_grue.bsp
- Fix possible file pointer leak in game load code.
- Minor code cleanups. Updated third party code, e.g. SDL, music codecs, etc.
- Thanks to 'temx' for his patches.
- Add support for lit water (patch contributed by Josiah Jack, with fixes from Eric Wasylishen.)
- Add model scale support -- requires protocol 999. (Original patch contributed by Josiah Jack with fixes from temx and Andrei Drexler. Thanks to Eric Wasylishen, MH and Spike for useful discussions.)
- Add sv_cheats cvar for 2021 rerelease (patch from Andrei Drexler).
- Clear the startdemo list on game change (patch by Andrei Drexler).
- Try light trace from entity origin first (patch by Andrei Drexler).
- Backport a few fixes to the bundled SDL2-2.0.22 version.
- Fix console history buffer wrapping.
- Fix wrong external texture use after vid_restart.
- Update lodepng from mainstream git.
- Miscellaneous source code cleanups.