Quake 2, 3D accelerated in any Pi model, 60+ FPS
-
If you thought it was impossible, I don't blame you. But this runs at 60+ fps most of the time in a Raspberry Pi 3 B+; drops at most to 50 in a heavy situation, but it remains playable at all times, at 1920x1080 no less.
To install this, replace the existing
yquake2.sh
script inRetropie-Setup/scriptmodules/ports/
with the following one; you'll need to compile it. You don't even need the game, this will install the demo if needed.#!/usr/bin/env bash # This file is part of The RetroPie Project # # The RetroPie Project is the legal property of its developers, whose names are # too numerous to list here. Please refer to the COPYRIGHT.md file distributed with this source. # # See the LICENSE.md file at the top-level directory of this distribution and # at https://raw.githubusercontent.com/RetroPie/RetroPie-Setup/master/LICENSE.md # rp_module_id="yquake2" rp_module_desc="yquake2 - The Yamagi Quake II client" rp_module_licence="GPL2 https://raw.githubusercontent.com/yquake2/yquake2/master/LICENSE" rp_module_repo="git https://github.com/yquake2/yquake2.git master" rp_module_section="exp" rp_module_flags="" function depends_yquake2() { local depends=(libgl1-mesa-dev libglu1-mesa-dev libogg-dev libopenal-dev libsdl2-dev libvorbis-dev zlib1g-dev libcurl4-openssl-dev) getDepends "${depends[@]}" } function sources_yquake2() { gitPullOrClone # get the add-ons sources gitPullOrClone "$md_build/xatrix" "https://github.com/yquake2/xatrix" "XATRIX_2_13" gitPullOrClone "$md_build/rogue" "https://github.com/yquake2/rogue" "ROGUE_2_12" } function build_yquake2() { make clean make with_gles1 # build the add-ons source local repo for repo in 'xatrix' 'rogue'; do make -C "$repo" clean make -C "$repo" # add-ons: rename the 'release' folder so it's installed under '$repo' by the install func [[ -f "$repo/release/game.so" ]] && mv "$repo/release" "$repo/$repo" done md_ret_require="$md_build/release/quake2" } function install_yquake2() { md_ret_files=( 'release/baseq2' 'release/q2ded' 'release/quake2' 'release/ref_gl1.so' 'release/ref_gl3.so' 'release/ref_gles1.so' 'release/ref_gles3.so' 'release/ref_soft.so' 'LICENSE' 'README.md' 'xatrix/xatrix' 'rogue/rogue' ) } function add_games_yquake2() { local cmd="$1" declare -A games=( ['baseq2']="Quake II" ['xatrix']="Quake II XP1 - The Reckoning" ['rogue']="Quake II XP2 - Ground Zero" ) local game for game in "${!games[@]}"; do if [[ -f "$romdir/ports/quake2/$game/pak0.pak" ]]; then addPort "$md_id" "quake2" "${games[$game]}" "$cmd" "$game" fi done } function game_data_yquake2() { if [[ ! -f "$romdir/ports/quake2/baseq2/pak1.pak" && ! -f "$romdir/ports/quake2/baseq2/pak0.pak" ]]; then # get shareware game data downloadAndExtract "https://deponie.yamagi.org/quake2/idstuff/q2-314-demo-x86.exe" "$romdir/ports/quake2/baseq2" -j -LL # remove files that are likely to cause conflicts or unwanted default settings local unwanted for unwanted in $(find "$romdir/ports/quake2" -maxdepth 2 -name "*.so" -o -name "*.cfg" -o -name "*.dll" -o -name "*.exe"); do rm -f "$unwanted" done fi chown -R "$__user":"$__group" "$romdir/ports/quake2" } function configure_yquake2() { local params=() local cfgdir="$md_conf_root/quake2/yquake2/baseq2" if isPlatform "gl3"; then params+=("+set vid_renderer gl3") elif isPlatform "gles"; then params+=("+set vid_renderer gles1") elif isPlatform "gl" || isPlatform "mesa"; then params+=("+set vid_renderer gl1") else params+=("+set vid_renderer soft") fi if ! isPlatform "gles" && isPlatform "kms"; then params+=("+set r_mode -1" "+set r_customwidth %XRES%" "+set r_customheight %YRES%" "+set r_vsync 1") fi mkRomDir "ports/quake2" moveConfigDir "$home/.yq2" "$md_conf_root/quake2/yquake2" if [[ ! -f "$cfgdir/yq2.cfg" ]]; then mkdir -p "$cfgdir" cat > "$cfgdir/yq2.cfg" << _EOF_ set aimfix 1 set g_machinegun_norecoil 1 set g_quick_weap 1 set g_swap_speed 2 set ogg_ignoretrack0 1 set s_openal 0 set gl1_discardfb 1 set gl1_lightmapcopies 1 set r_mode -2 _EOF_ chown -R "$__user":"$__group" "$cfgdir" fi [[ "$md_mode" == "install" ]] && game_data_yquake2 add_games_yquake2 "$md_inst/quake2 -datadir $romdir/ports/quake2 ${params[*]} +set game %ROM%" }
As you can see, this adds a new "gles1" renderer, yup, as in "OpenGL ES 1.0"; this should be compatible with anything. Any feedback is appreciated.
EDIT 12-08-2024: officially added to Yamagi Quake 2!
EDIT 06-10-2024: new performance options added, almost 10% increase. -
Noice.
@Protocultor said in Quake 2, 3D accelerated in any Pi model:
Can someone test this with a Zero?
A Zero or a Zero2(W)? I don't have a Zero at hand and for the Zero2W I am missing a mini HDMI adapter. :/
-
@Lolonois anything that is not a RPi3 B+, because I know how it runs there :)
I'm just interested in people's experience with this. -
I did testdrive with a Pi Z2W, which uses the gles1 renderer. Works smooth at 1920x1080. 💪
FTR I used a stock RetroPie 3 image (Buster), added the ports "system" and replaced the existing
yquake2.sh
with yours inRetropie-Setup/scriptmodules/ports/
: Build.Run.Fun!FWIW and wants to test, you can check in
/opt/retropie/configs/ports/quake2/emulators.cfg
which renderer is selected (check for+set vid_renderer ...
). However,If you are on a architecture that also supports mesa then thegl1
renderer is picked. -
@Lolonois said in Quake 2, 3D accelerated in any Pi model:
FWIW and wants to test, you can check in
/opt/retropie/configs/ports/quake2/emulators.cfg
which renderer is selected (check for+set vid_renderer ...
). However,If you are on a architecture that also supports mesa then thegl1
renderer is picked.Thanks for the feedback! Just changed the script to verify first for gles compatibility (instead of gl or mesa), and use the
gles1
renderer if found. -
@Protocultor said in Quake 2, 3D accelerated in any Pi model, 60+ FPS:
EDIT 12-08-2024: officially added to Yamagi Quake 2!
Nice. So does it also qualify for a PR to RetroPie-Setup? (I assume as the scriptmodule is from the experimental section and the change is not large the bar to get it accepted might not be that high.)
-
@Lolonois said in Quake 2, 3D accelerated in any Pi model, 60+ FPS:
Nice. So does it also qualify for a PR to RetroPie-Setup? (I assume as the scriptmodule is from the experimental section and the change is not large the bar to get it accepted might not be that high.)
I don't know? RetroPie guys prefer to work with official releases, even for experimental, so we may have to wait for YQ2 version 8.50.
@BuZz, @mitu, would you accept a PR pointing to a specific commit, as a temporary thing, waiting for the next big release?
It's just to make this project visible, and it's not like numbered releases are a guarantee for stability. -
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.