QuakeSpasm
Page last edited: Feb. 2018
QuakeSpasm
is a modern, cross-platform Quake 1 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 either the SDL or SDL2 frameworks, so choose which one works best for you.
SDL is probably less buggy, but SDL2 has nicer features and smoother mouse input - though no CD 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.
- As of 0.90.0, music is played back at 44100 Hz by default with no need to adjust "-sndspeed".
- Use the "-noextmusic" option to disable this feature.
- 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 - Fraction of the stick travel to be deadzone, between 0 and 1. Default 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_sensitivity_yaw/pitch - Max angular speed in degrees/second when looking. Defaults are 300 for yaw (turning left/right) and 150 for pitch (up/down).
- joy_exponent - For the look stick, the stick displacement (between 0 and 1) is raised to this power. Default is 3. A value of 1 would give a linear relationship between stick displacement and fraction of the maximum angular speed.
- 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 0, move on the left stick, look on the right stick.
- joy_enable - Set to 0 to disable controller support. Default 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 and code from LordHavoc (DarkPlaces).
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.
To checkout the latest version of QuakeSpasm, do:
svn co svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm
After extracting the source tarball, browse the Makefile and edit the music streaming options, then
make
cp quakespasm /usr/local/games/quake (for example)
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
Streaming music playback requires "libmad" or "libmpg123" for MP3, and "libogg" and "libvorbis" for OGG files.
The project can also be built with Codeblocks (project files included).
The QuakeSpasm developers cross-compile windows binaries using
MinGW and
Mingw-w64.
The project can also be built using Visual Studio 2005 (or newer).
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.
Brightness issues should be fixed with GLSL gamma in 0.90.1, if your system supports OpenGL 2. For reference on older systems:
Some versions of Xorg and SDL have brightness issues.
Try setting "export SDL_VIDEO_X11_NODIRECTCOLOR=1", or if you have Xorg >= 7.5 and broken brightness,
these patched libSDL binaries may help.
- Fixed a fog regression which was introduced in 0.93.0.
- Fixed a crash (buffer overflow) with invalid vis data.
- Fixed buttons crushing players in 64-bit builds.
- Change controller movement to use cubic easing by default; added "joy_exponent_move" cvar.
- config.cfg is no longer written in case of a Sys_Error.
- Fixed Opus encoded cd tracks not being recognized as ripped tracks.
- Update the third-party libraries. Other fixes/cleanups.
- Raise default "joy_deadzone_trigger" cvar to 0.2.
- Raise console buffer size to 1MB.
- Raise MAX_STATIC_ENTITIES from 512 to 4096.
- Raise MAX_STACK_DEPTH from 32 to 64.
- Raise command buffer size from 8K to 256K to support large configs.
- Remove MAX_EFRAGS and MAX_MAP_LEAFS limits.
- Remove "Loadgame buffer overflow" limit, which could happen when loading DP or QSS saves.
- Adjust "exceeds standard limit of" debug warnings to include the actual QS limit.
- Change "game" command to now exec quake.rc.
- Change "games" / "mods" commands to list all subdirectories.
- Restore vid_refreshrate from fitzquake-0.85 for SDL2 builds.
- Alpha-masked model support. (MF_HOLEY: 0x4000).
- Invalid skin index now draws skin 0 (WinQuake behaviour) instead of blue checkerboard.
- Change default screenshot format to png. The 'screenshot' command now supports optional format (tga, png or jpg) and quality (1-100) arguments.
- Revert "always run" changes from 0.85.9 and move the QuakeSpasm customizations to a new "cl_alwaysrun" cvar: Set to 1 in order to scale forward/side/up speed by "cl_movespeedkey" (usually 2), and to make "speedkey" act as "slowkey".
- Change the "always run" menu option to offer three choices:
- off (cl_alwaysrun 0, cl_forwardspeed 200, cl_backspeed 200)
- vanilla (cl_alwaysrun 0, cl_forwardspeed 400, cl_backspeed 400)
- quakespasm (cl_alwaysrun 1, cl_forwardspeed 200, cl_backspeed 200)
- New "r_scale" cvar. Set to 2, 3, or 4 to render the view at 1/2, 1/3, or 1/4 resolution.
- New "r_viewmodel_quake" cvar. Set to 1 for WinQuake gun position (from MarkV).
- New "find" / "apropos" command, searches for commands/cvar names for the given substring (from Spike).
- New "randmap" command for loading a random map.
- New "gl_cshiftpercent_contents", "gl_cshiftpercent_damage", "gl_cshiftpercent_bonus", "gl_cshiftpercent_powerup" cvars for tuning the strength of specic view blends.
- GL2 renderer: use a GLSL shader for world faces. Fixes reports of integrated+discrete GPU laptops having inconsistent fog rendering.
- Fix macOS startup delay (avoid calling gethostbyname() for ".local" hostnames).
- Fix memory corruption in PF_lightstyle with out of bounds lightstyles.
- Fix crash in BoundPoly with polygons extending beyond +/-9999.
- Fix QS window to stay on the current monitor when changing video modes (SDL2 only).
- Fix possible freeze in SV_TouchLinks regardless of what QC does in the touch function.
- Fix for maps with empty strings for vector keys (e.g. "origin"); don't read uninitialized memory.
- Support for Open Watcom compiler.
- Update the third-party libraries.
- Fixed large menu scale factors (was broken in 0.92.0).
- Fixed PAUSE key (was broken in 0.92.0).
- Updated some of the third-party libraries.
- SDL2 Game Controller support.
- Contrast support with new "contrast" cvar, behaving the same as MarkV. It may be a useful alternative to the existing gamma control for laptops in a bright environment, etc. Raising contrast gives less of a gray/washed out look than raising gamma, but at a disadvantage: colors near white get clipped to white.
- RMQ protocol (999) support, adapted from RMQEngine.
- New "-protocol x" command line option. Accepted values for 'x' are 15 (NetQuake), 666 (FitzQuake, default), and 999 (RMQ).
- New "setpos" console command.
- New "vid_borderless" cvar for getting a borderless window.
- Increased MAX_MAP_LEAFS from 65535 to 70000 and MAX_LIGHTMAPS from 256 to 512 in order to handle the oms3 map pack.
- Server edicts are now allocated using malloc instead of allocating on the hunk.
- gl_clear now defaults to 1.
- Fix items falling out of the world on oms3.bsp on SSE builds.
- Worked around an OSX 10.6 driver bug when using FSAA, which was leading to an unplayable HOM effect on the rest of the screen.
- Fix wrong trace endpoint from the tracepos console command.
- Updated some of the third-party libraries. Other fixes/clean-ups.
Bugfixes
- Fix unwanted fog mode change upon video restart.
- Work around Intel 855 bug in status bar drawing with "r_oldwater 0" and "scr_sbaralpha 0".
- Fix an obscure GLSL bug where changing gamma would result in the screen turning to noise.
- Fix GLSL gamma causing the tiled screen border to turn white when "sizedown" is used.
- Fix an alias model VBO renderer bug where a model not precached during map start wouldn't be drawn.
- Fix the order of OpenGL context creation and window creation in SDL2 video.
- Fix a calling convention issue in windows DPI awareness function pointers.
- Fix a random texture recoloring after video mode change.
- Fix a liquid turning to garbage after several video mode changes and "r_oldwater 0".
- Fix a wrong alpha-sorting bug introduced in 0.90.1.
- Fix "flush" command not reloading mdl's from disk (bug introduced in 0.90.1).
- Prevent a possible buffer overflow in Cbuf_Execute (old Q1/Q2 bug).
- Prevent a possible vulnerability in MSG_ReadString (old Q1/Q2 bug).
Visual improvements
- New cvars r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ/RMQEngine, non-archived, default to 0), and new worldspawn keys _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm, similar to the behaviour of the "fog" worldspawn key).
- GLSL gamma is now supported on older hardware without NPOT extension.
Interface improvements
- New r_pos command to show player position.
- NaN detection in traceline with "developer 1" set now warns instead of errors.
Code cleanup / Other
- Update third-party libraries.
Raised limits
- Default max_edicts 8192 (was 2048) and no longer saved to config.cfg.
- Default heapsize 256 MB (was 64 MB).
- Default zone 4 MB (was 384 KB).
- Raised MAX_SFX to 1024 (was 512).
Bugfixes
- Fix dynamic light artifact where changing lightmap are rendered one frame late (bug introduced in 0.90.0).
- Fix texture memory leak when changing video modes with SDL2.
- Fix rare incorrect mdl lighting on 64-bit builds.
(details here.)
- Fix fullbrights turning black after "kill" command (bug introduced in 0.90.0).
- Clear all fog values on map change to prevent colored fog carrying over to jam3_tronyn.bsp.
- Allow loading saves with } character in quoted strings, fixes issue with retrojam1_skacky.bsp.
- Fix viewmodel not lerping on extended-limit maps.
- Fix crash on out-of-bounds skin number.
Performance
- Use multithreaded OpenGL on OS X for better performance.
- New, faster mdl renderer using GLSL. Disable with "-noglslalias".
Visual improvements
- New gamma correction implementation using GLSL. Fixes all known gamma issues (affecting the full display, persisting after quitting, or darkening the screen on OS X). Disable with "-noglslgamma".
- Use high-quality water by default (r_oldwater 0).
- Shadows use stencil buffer to avoid overlapping artifacts (from MarkV.)
- r_noshadow_list cvar added (from MarkV.)
Interface improvements
- Support pausing demo playback with the "pause" command.
- Autocompletion for "game", "record", "playdemo".
- Experimental windowed fullscreen mode available with vid_desktopfullscreen 1 (only in SDL2 builds, takes effect upon entering fullscreen mode the next time.)
- Silence "exceeded standard limit" messages unless developer cvar is >= 1.
- Some spam moved from developer 1 to 2: "can't find tga/lit/ent", "trying to load ent", "bad chunk length", "meshing", "PR_AlocStringSlots: realloc'ing"
Code cleanup
- Clean up IDE project files to build on fresh systems.
- Update 3rd-party libraries.
- Fix issues on Windows systems with DPI scaling.
- Unix/Mac user directories support. Disabled by default, 'make DO_USERDIRS=1' to enable it.
- SDL2 support. Disabled by default, 'make USE_SDL2=1' to enable it.
- Revised keyboard input code.
- Revised/improved the 'game' command, i.e. on-the-fly mod changing. It now accepts an option