### Download URL Examples Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Examples demonstrating how cl_dlURL is used with different patterns to construct download URLs. The %1 pattern is replaced by the command argument. ```console cl_dlURL is http://127.0.0.1 and you type \download promaps.pk3 - resulting download url will be http://127.0.0.1/promaps.pk3 ``` ```console cl_dlURL is http://127.0.0.1/%1 and you type \dlmap dm17 - resulting download url will be http://127.0.0.1/dm17 ``` -------------------------------- ### Build on Generic Linux/BSD Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Install necessary packages for Ubuntu and build the project. The `make install` command can be used to specify the destination directory for game files. ```bash sudo apt install make gcc libcurl4-openssl-dev mesa-common-dev sudo apt install libxxf86dga-dev libxrandr-dev libxxf86vm-dev libasound-dev sudo apt install libsdl2-dev ``` ```bash make ``` ```bash make install DESTDIR= ``` -------------------------------- ### Build on Raspberry Pi OS Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Install SDL2 and other development libraries, then build the project with `make`. ```bash apt install libsdl2-dev libxxf86dga-dev libcurl4-openssl-dev ``` ```bash make ``` ```bash make install DESTDIR= ``` -------------------------------- ### Old Shader Example Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.md An example of a traditional shader definition without conditional logic. ```quake3shader console { nopicmip nomipmaps { map image1.tga blendFunc blend tcmod scale 1 1 } } ``` -------------------------------- ### Build on macOS Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Ensure SDL2 framework is installed and build the project with `make`. ```bash make ``` -------------------------------- ### Build with MSYS2 Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Install build dependencies and compile using MSYS2. The `make install` command can be used to specify the destination directory for game files. ```bash pacman -Syu pacman -S make mingw-w64-x86_64-gcc mingw-w64-i686-gcc ``` ```bash make install DESTDIR= ``` -------------------------------- ### Conditional Shader Stage Example Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.md An example of a shader definition using 'if'-'else' to conditionally load shader stages based on cvar values. ```quake3shader console { nopicmip nomipmaps if ( $r_vertexLight == 1 && $r_dynamicLight ) { map image1.tga blendFunc blend tcmod scale 1 1 } else { map image2.tga blendFunc add tcmod scale 1 1 } } ``` -------------------------------- ### Build with MinGW Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Compile using MinGW with architecture-specific flags. The `make install` command can be used to specify the destination directory for game files. ```bash make ARCH=x86 ``` ```bash make ARCH=x86_64 ``` ```bash make install DESTDIR= ``` -------------------------------- ### Old Shader Example Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm A basic shader definition without conditional logic. ```console { nopicmip nomipmaps { map image1.tga blendFunc blend tcmod scale 1 1 } } ``` -------------------------------- ### Disabling Sound Initialization Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Starts the game with sound initialization disabled to check if sound is the cause of problems. ```configuration +set s_initsound 0 ``` -------------------------------- ### One-Line Empty GUID Filter Source: https://github.com/ec-/quake3e/blob/main/docs/filter.txt A one-line version of the filter to disallow empty client GUIDs. ```quake3filter cl_guid "" drop ``` -------------------------------- ### Conditional Shader Example Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Shader definition using 'if' and 'else' to conditionally apply stages based on cvar values like r_vertexLight. ```console { nopicmip nomipmaps if ( $r_vertexLight == 1 && $r_dynamicLight ) { map image1.tga blendFunc blend tcmod scale 1 1 } else { map image2.tga blendFunc add tcmod scale 1 1 } } ``` -------------------------------- ### One-Line Filter Example Source: https://github.com/ec-/quake3e/blob/main/docs/filter.txt A concise, one-line representation of a filter that bans clients with specific IP and name patterns. ```quake3filter ip "127.0.0.1" name * "Unnamed*" drop "You have bad name" ``` -------------------------------- ### Getting OpenGL Information with glxinfo Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Outputs detailed information about the OpenGL implementation, used for diagnosing graphics-related issues. ```shell glxinfo ``` -------------------------------- ### Client Download Commands Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Use \download or \dlmap commands to fetch pk3 files. \dlmap also checks for map existence. The cl_dlURL cvar must be set to the download location. ```console \download filename[.pk3] ``` ```console \dlmap mapname[.pk3] ``` ```console \dlmap - ``` -------------------------------- ### Build on ppc64le/ppc64 with ISA Optimizations Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Build with specific `-mcpu` flags to enable ISA-level optimizations for POWER8 and POWER9 processors. ```bash make CFLAGS='-mcpu=power8' ``` ```bash make CFLAGS='-mcpu=power9' ``` ```bash make CFLAGS='-mcpu=native' ``` -------------------------------- ### Build on Arch Linux Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Download, extract, and build the quake3e-git package using `makepkg`. ```bash curl -O https://aur.archlinux.org/cgit/aur.git/snapshot/quake3e-git.tar.gz ``` ```bash tar xfz quake3e-git.tar.gz ``` ```bash cd quake3e-git ``` ```bash makepkg -risc ``` -------------------------------- ### Create q3ui Library Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Creates a library named 'q3ui' using the collected UI source files. ```cmake ADD_LIBRARY(q3ui OBJECT ${Q3_UI_SRCS}) ``` -------------------------------- ### Add URL Protocol Binding Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Run q3url_add.cmd to add the q3a:// protocol binding for launching Quake 3e from a browser. Ensure the command is in the quake3e.exe directory. ```batch q3url_add.cmd ``` -------------------------------- ### Disallow Empty GUID Filter Source: https://github.com/ec-/quake3e/blob/main/docs/filter.txt This filter disallows clients with an empty 'cl_guid' and applies a default ban. ```quake3filter cl_guid "" { drop } ``` -------------------------------- ### Set VM Settings for Linux Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Use these commands to set the virtual machine settings for game, cgame, and ui to 2. This is often required to resolve "Sys_LoadDll(..) failed dlopen() completely!" errors. ```bash quake3 +set vm_game 2 +set vm_cgame 2 +set vm_ui 2 ``` -------------------------------- ### Makefile Build Options Source: https://github.com/ec-/quake3e/blob/main/BUILD.md Configure build options such as client/server executables, renderer backends, and dynamic library loading. ```bash make BUILD_SERVER=0 USE_RENDERER_DLOPEN=0 RENDERER_DEFAULT=vulkan ``` -------------------------------- ### Client Executable Definition Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Defines the client executable, linking necessary libraries like qcommon, botlib, client, and q3ui. Conditional linking for renderers (Vulkan/OpenGL) is also handled. ```cmake ADD_EXECUTABLE(${CNAME}${BINEXT} ${EXE_TYPE} ${Q3_SRCS}) TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} qcommon botlib client q3ui) IF(NOT USE_RENDERER_DLOPEN) IF(USE_VULKAN) TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} ${RENDERER_PREFIX}_vulkan) ELSE() TARGET_LINK_LIBRARIES(${CNAME}${BINEXT} ${RENDERER_PREFIX}_opengl) ENDIF() ENDIF() ``` -------------------------------- ### Define qcommon Library Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Defines the base qcommon library using source files from code/server and code/qcommon. ```cmake AUX_SOURCE_DIRECTORY(code/server SERVER_SRCS) list(REMOVE_ITEM SERVER_SRCS code/server/sv_rankings.c) ADD_LIBRARY(qcommon OBJECT ${QCOMMON_SRCS} ${SERVER_SRCS}) ``` -------------------------------- ### Running Game with Developer Mode Enabled Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Launches the game with developer mode active to capture detailed output for debugging. Output is redirected to a log file. ```shell quake3 +set developer 1 &>q3run.log ``` -------------------------------- ### Client Library with System JPEG Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Configures the client library to use system JPEG, finding the package and linking libraries if USE_SYSTEM_JPEG is enabled. ```cmake IF(USE_SYSTEM_JPEG) ADD_LIBRARY(client OBJECT ${CLIENT_SRCS}) find_package(JPEG REQUIRED) TARGET_COMPILE_DEFINITIONS(client PRIVATE -DUSE_SYSTEM_JPEG) TARGET_LINK_LIBRARIES(client ${JPEG_LIBRARIES}) ELSE() AUX_SOURCE_DIRECTORY(code/libjpeg JPEG_SRCS) ADD_LIBRARY(client OBJECT ${CLIENT_SRCS} ${JPEG_SRCS}) ENDIF() ``` -------------------------------- ### Set Hotkey for Minimize/Restore Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.md Defines a hotkey combination for quickly minimizing and restoring the main game window. Changes require a \in_restart command to take effect. ```quakec \in_minimize "ctrl+z" ``` ```quakec \in_minimize "lshift+ralt+\" ``` -------------------------------- ### Fix Server Browser Issues Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Deleting the q3config.cfg file in the baseq3 directory can resolve issues where servers do not appear in the in-game browser. Note that this will reset custom bindings. ```bash rm ~/.q3a/baseq3/q3config.cfg ``` -------------------------------- ### Define Project Names Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Sets the main executable name and the dedicated server executable name. ```cmake SET(CNAME "quake3e") SET(DNAME "quake3e.ded") ``` -------------------------------- ### Configure Build Options Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Enables or disables various build options such as USE_SDL, USE_CURL, USE_LOCAL_HEADERS, USE_VULKAN, USE_SYSTEM_JPEG, and USE_RENDERER_DLOPEN. ```cmake OPTION(USE_SDL "" ON) OPTION(USE_CURL "" ON) OPTION(USE_LOCAL_HEADERS "" ON) OPTION(USE_VULKAN "" ON) OPTION(USE_SYSTEM_JPEG "" OFF) OPTION(USE_RENDERER_DLOPEN "" ON) ``` -------------------------------- ### Set Renderer Prefix and Default Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Configures the prefix for the renderer and sets the default renderer. Valid options include opengl, vulkan, opengl2. ```cmake SET(RENDERER_PREFIX ${CNAME}) SET(RENDERER_DEFAULT opengl) # valid options: opengl, vulkan, opengl2 ``` -------------------------------- ### Set Download URL Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Configure the sv_dlURL cvar to specify the root directory for game downloads. Ensure the URL points to the game's root directory, not a specific mod. ```console sets sv_dlURL "ftp://myftp.com/games/q3" ``` -------------------------------- ### Link SDL2 or X11 Libraries Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Conditionally links SDL2 or X11 libraries to the 'q3ui' target if not using MSVC. ```cmake IF(NOT MSVC) IF(USE_SDL) find_package(SDL2 REQUIRED) TARGET_LINK_LIBRARIES(q3ui SDL2::Main) ELSEIF(UNIX) find_package (X11 REQUIRED) TARGET_LINK_LIBRARIES(q3ui ${X11_LIBRARIES}) ENDIF() ENDIF() ``` -------------------------------- ### Collect Source Files for Qcommon Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Collects all source files in the 'code/qcommon' directory for the QCOMMON_SRCS list, excluding platform-dependent QVM bytecode compilers. ```cmake AUX_SOURCE_DIRECTORY(code/qcommon QCOMMON_SRCS) # exclude platform-dependent QVM bytecode compilers list(FILTER QCOMMON_SRCS EXCLUDE REGEX ".*vm_[alpx].*.c") ``` -------------------------------- ### Configure Automatic Map Downloads Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.md Enables or disables the automatic download of maps for playing and demo playback. When enabled, it automatically triggers a \dlmap command. ```quakec \cl_mapAutoDownload 0|1 ``` -------------------------------- ### OpenWrt Firmware Build Options Source: https://github.com/ec-/quake3e/blob/main/docs/firewall/fw-openwrt.txt Ensure your LEDE/OpenWrt firmware is compiled with the necessary iptables modules for the custom firewall rule to function correctly. CONFIG_PACKAGE_iptables-mod-u32 is optional but can be useful for packet inspection. ```makefile CONFIG_PACKAGE_iptables-mod-hashlimit=y ``` ```makefile CONFIG_PACKAGE_iptables-mod-u32=y (not required, but may be useful to inspect packet's contents) ``` -------------------------------- ### Add Platform-Specific QVM Compilers for x86/AMD64 Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Appends the appropriate x86 or x86_64 QVM compiler source file to QCOMMON_SRCS based on the detected processor architecture and operating system. ```cmake # add platform-dependent QVM bytecode compilers IF(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64|x86|i*86) IF(CMAKE_SYSTEM_PROCESSOR MATCHES AMD64) IF(WIN32) SET(BINEXT .x64) ELSE() SET(BINEXT .x86_64) ENDIF() SET(RENDEXT _x86_64) ELSE() #SET(BINEXT .x86) SET(RENDEXT _x86) ENDIF() list(APPEND QCOMMON_SRCS code/qcommon/vm_x86.c) ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES aarch64|arm64) SET(BINEXT .aarch64) SET(RENDEXT _aarch64) list(APPEND QCOMMON_SRCS code/qcommon/vm_aarch64.c) ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES arm*) SET(BINEXT .arm) SET(RENDEXT _arm) list(APPEND QCOMMON_SRCS code/qcommon/vm_armv7l.c) ELSEIF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le|ppc64") IF(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64le") SET(BINEXT .ppc64le) SET(RENDEXT _ppc64le) list(APPEND QCOMMON_SRCS code/qcommon/vm_powerpc.c) ELSE() SET(BINEXT .ppc64) SET(RENDEXT _ppc64) list(APPEND QCOMMON_SRCS code/qcommon/vm_powerpc.c) ENDIF() ADD_COMPILE_OPTIONS(-mcpu=power8 -mvsx) ELSE() TARGET_COMPILE_DEFINITIONS(qcommon PRIVATE -DNO_VM_COMPILED) TARGET_COMPILE_DEFINITIONS(qcommon_ded PRIVATE -DNO_VM_COMPILED) ENDIF() ``` -------------------------------- ### Client Library with cURL Handling Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Defines the client library, conditionally removing cURL source files based on the USE_CURL variable. ```cmake AUX_SOURCE_DIRECTORY(code/client CLIENT_SRCS) IF(NOT USE_CURL) list(REMOVE_ITEM CLIENT_SRCS code/client/cl_curl.c) ENDIF() ADD_LIBRARY(client OBJECT ${CLIENT_SRCS}) ``` -------------------------------- ### Displaying NVIDIA Card Information Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Shows details about the NVIDIA graphics card, relevant for troubleshooting graphics performance. ```shell cat /proc/nv/card0 ``` -------------------------------- ### Checking System Information with uname Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Retrieves kernel and OS information, useful for bug reporting. ```shell uname -a ``` -------------------------------- ### Define OpenGL API Usage Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Adds compile definitions to specify OpenGL API usage for 'q3ui' and 'client' targets when dynamic loading is enabled or Vulkan is not used. ```cmake IF(USE_RENDERER_DLOPEN OR NOT USE_VULKAN) TARGET_COMPILE_DEFINITIONS(q3ui PRIVATE USE_OPENGL_API) TARGET_COMPILE_DEFINITIONS(client PRIVATE USE_OPENGL_API) ENDIF() ``` -------------------------------- ### Configure Gamma Correction via Console Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html On older systems lacking appropriate XFree86 extensions, manually set the r_gamma value from the console and restart the video mode. ```bash r_gamma vid_restart ``` -------------------------------- ### Checking libc Version Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Lists the shared library for C standard functions, important for system compatibility checks. ```shell ls -l /lib/libc.so.* ``` -------------------------------- ### FFmpeg Input Pipe Format Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.htm Configure encoder parameters for ffmpeg when redirecting captured video to an input pipe. Default settings are optimized for YouTube. ```console -preset medium -crf 23 -c:v libx264 -flags +cgop -pix_fmt yuvj420p -bf 2 -c:a aac -strict -2 -b:a 160k -movflags faststart ``` -------------------------------- ### Tracing System Calls with strace Source: https://github.com/ec-/quake3e/blob/main/docs/LinuxSupport/index.html Logs all system calls made by the game executable, useful for diagnosing low-level issues. The output is saved to a file. ```shell cd /usr/local/games/quake3 strace -o ~/strace.log ./quake3.x86 ``` -------------------------------- ### Define qcommon_ded Library Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Defines the dedicated server version of qcommon library with a specific compile definition. ```cmake ADD_LIBRARY(qcommon_ded OBJECT ${QCOMMON_SRCS} ${SERVER_SRCS}) TARGET_COMPILE_DEFINITIONS(qcommon_ded PUBLIC DEDICATED) ``` -------------------------------- ### Define Vulkan API Usage Source: https://github.com/ec-/quake3e/blob/main/CMakeLists.txt Adds compile definitions to specify Vulkan API usage for 'q3ui' and 'client' targets when USE_VULKAN is enabled. ```cmake IF(USE_VULKAN) TARGET_COMPILE_DEFINITIONS(q3ui PRIVATE USE_VULKAN_API) TARGET_COMPILE_DEFINITIONS(client PRIVATE USE_VULKAN_API) ENDIF() ``` -------------------------------- ### Set Console Color Source: https://github.com/ec-/quake3e/blob/main/docs/quake3e.md Allows customization of the console text color. This is a non-archived cvar, meaning changes are not saved to the config file by default. Use the \seta command to make changes persistent. ```quakec \cl_conColor [RRR GGG BBB AAA] ``` -------------------------------- ### Basic Filter Structure Source: https://github.com/ec-/quake3e/blob/main/docs/filter.txt Defines a filter for clients with a specific IP address, further filtering by name pattern, and applying a ban reason. ```quake3filter ip "127.0.0.1" { name * "Unnamed*" { drop "You have bad name" } } ```