Setting up Half-Life through RetroPie (A Guide)
-
Because reddit kept deleting my post I'm posting this here. The information is already found on the forums but I felt making it more concise might be helpful.
This is a guide to get Half-Life running on your Raspberry Pi through RetroPie using the Xash3D engine. You will need need to source the original game files yourself. This is 100% confirmed working using the Steam version of Half-Life. I was unable to get the original installation files from my CD copy to work properly, though I read it may be possible if you are using a more recently patched version of the game. I will assume however that you are using the Steam version for the purposes of this guide.
-
Add Xash3D script module to Retro-Pie setup. The script module will show up in the experimental section and then you need to install it from source. Script module found here (Thanks to Sergio Poverony for putting this together): https://github.com/sergiopoverony/xash3d
-
The above script will add Xash3d engine files to /home/pi/RetroPie/roms/ports/Half-Life/ add the
valve
folder from your Steam Half-Life game files to that same directory. -
If you wish to use a controller to play this game edit the file /opt/retropie/ports/xash3d/Xash3D.sh and add -sdl_joy_old_api to the end of the line. You can also remove -console from that line if you don't want the constant console messages on screen.
-
At this point you can launch and play the game, however it is running on an older version of xash3d. I was able to successfully compile the newer version of xash3d ( https://github.com/FWGS/xash3d-fwgs ) on my Pi 4 (These files may not work for you if you are using a different model Pi). I have uploaded the binary here: https://mega.nz/folder/xBpAgYYb#arEdY1Y2DVere_gGRqeFjw. Simply download those files and use them to replace the ones in /home/pi/RetroPie/roms/ports/Half-Life/ then make sure they have 755 permissions otherwise they wont work.
This is all you will need to get the game up and running, however I have add some additional tips below if you need help configuring your controller or want to change the screen resolution.
Performance issues? Lower Display Resolution to increase performance and modify config.cfg:
The game will launch in whatever resolution is currently set for your TV, mine is 1080p and I found this to be a bit too demanding for this game. In the in game menu go to video settings and check the box for windowed mode, then in the box that shows your current resolution change that setting to "current display mode" (or something like that). Then exit the game. Relaunch the game and when the runcommand prompt pops up press a button to get into the runcommand menu. Change the video mode for xash3d to 720p (or whatever your preferred mode is).
You'll also notice that certain lighting effects in game (flashlight, fire effects) seem to really slow things down. Check your config.cfg located at /home/pi/RetroPie/roms/ports/Half-Live/valve/config.cfg and make sure the settings below are configured this way:
r_vbo "0" r_vbo_dlightmode "1" cl_lw "0"
Remember, each mod (see more about running mods below) has it's own config.cfg, so you'll need to modify their config.cfg as well.
Configure Gamepad Controls:
In game there is a menu that will allow you to map functions to your gamepad (make sure you have already followed step 3 from above). Map the buttons as needed to your game pad (if you need suggestions for best layout let me know). You will also need to make sure that the correct axis's on your controller are controlling the right functions as well, otherwise you may find that the triggers are controlling looking up and down instead of the analog sticks. In the gamepad control menu you will need to change which axis controls which function. For my wireless Xbox360 controller the correct order (from top to bottom) was Side, Forward, Left Trigger, Pitch, Yaw, Right Trigger. Experiment to see what works for your controller.
I found that I also needed to add deadzone to the analog controls to keep my character from drifting all over the place. Edit the config.cfg located in /home/pi/RetroPie/roms/ports/Half-Life/valve and edit
joy_forward_deadzone "10000" joy_pitch_deadzone "10000" joy_side_deadzone "10000" joy_yaw_deadzone "10000"
The 10,000 value adds a 10% deadzone to those directional movements, increase or decrease that value per your needs.
If your right and left triggers act funny like mine did (they repeated an action over and over even if the trigger was no longer being pressed) Change the :
joy_lt_threshold and joy_rt_threshold value to a positive value instead of negative
Running Half-Life mods/expansions like Blue Shift and Opposing Force
Obviously you will need the Steam game file folders for Blue Shift and Opposing Force (the files are in folders named bshift and gearbox respectively). Add these folders to /home/pi/RetroPie/roms/ports/half-life
(blue shift needs to have its maps converted to vanilla format to work with xash3d on linux, get and run the below patch on the computer that has your half-life steam installation: https://www.moddb.com/games/half-life-blue-shift/downloads/blue-shift-unlocked-steampipe-patch. Then after you run the patch, copy the maps from the blue shift unlocked folder located in your steam game files to /home/pi/RetroPie/roms/ports/half-life/bshift/maps/ and overwrite the existing maps.we will now need to compile from source the hlsdk (half-life software development kit) for each mod/expansion otherwise they are broken on a linux build. (The game mod libraries are designed to run on a windows system)
First get the sources and configure the build:
git clone https://github.com/FWGS/hlsdk-xash3d.git cd hlsdk-xash3d
Then for blueshift:
git checkout bshift
or for opposing force
git checkout opfor
Then
mkdir build && cd build cmake ../ make
After compilation is completed you will have a
client.so
in your /hlsdk-xash3d/build/cl_dll/ directory and ahl.so
in your /hlsdk-xash3d/build/dlls/ directory. Move them to their corresponding cl_dll and dlls folders in your /roms/ports/half-life/bshift (or gearbox) directories. The mods can be activated from the main menu when running Half-Life.Each mod has also has its own config.cfg so you may want to copy the one in the valve folder to the bshift and gearbox directories as well if you previously made any changes that you want to carry over to the expansions as well.
Using HD model packs
HD model packs are included with the Half-Life Steam game files. If you would like to use them, first create a folder named
custom
in yourvalve
directory then copy/paste the contents of thevalve_hd
folder found in your Half-life steam game files to the/valve/custom/
folder (for mods like Blue Shift and Opposing Force copy frombshift_hd
to/bshift/custom/
andgearbox_hd
to/gearbox/custom/
). This preserves the original game files and allows you to switch back and forth between the custom HD files and the original files. (to revert to the original game files just rename thecustom
folder to something else)Thats about it, if you have any questions let me know!
-
-
@quicksilver thank you so much for this guide! I love the original HL 🥰
-
@quicksilver nice work. good idea to do this
-
Added additional info about increasing performance and how to run mods like Blue Shift and Opposing Force.
-
Added info on using HD model packs
-
Very cool! Is the CounterStrike 1.6 version compatible too?
-
@BennyProfane I haven't tried it. But if you get it working, please let me know!
-
@BennyProfane looks like CS 1.3 might be possible but 1.6 is currently only supported on Android.
-
Updated info on using blue shift and opposing force expansions. Previous info was wrong and while it would allow the expansions to boot, they were broken.
-
@quicksilver... I installed BlueShift and Opposing Force following your instructions and they both worked perfectly. I found all the branches for the other mods. Is there one available for CounterStrike?
-
@RussellB I have not tried to run counterstrike. If you get it running let me know and I'd be glad to add the info to the guide.
-
-
@RussellB if the mod uses only original game assets then you don't need to compile a new client.so and hl.so. But if it uses new assets not found in vanilla HL, then you need to compile them for it to work on a Linux system.
I have also gotten the "U.S.S Darkstar" mod working (haven't played very far into it yet but I presume it's fully functional). And "They Hunger" mod. Although I noticed some small issues with this mod, like the rain effect doesn't seem to work right and the opening cut scene is partially blacked out. It does seem to be fully playable though.
-
I compiled the shared libraries for Afraid of Monsters: Director's Cut and it works great. I'll experiment with a few more. This is awesome!
-
@RussellB this website may be of interest to you https://www.moddb.com/engines/xash3d-engine/features/list-of-tested-half-life-singleplayer-mods
Has a huge list of mods that should work with xash3d engine
-
@quicksilver said in Setting up Half-Life through RetroPie (A Guide):
"They Hunger"
LOL
i loved that mod. im so going to mess around with this. once i finish up my pi3 build.
I really dont want to leave 2 builds half complete -
@quicksilver said in Setting up Half-Life through RetroPie (A Guide):
@RussellB this website may be of interest to you https://www.moddb.com/engines/xash3d-engine/features/list-of-tested-half-life-singleplayer-mods
Has a huge list of mods that should work with xash3d engine
You just fed my OCD a huge bone!
-
@quicksilver I am going to try this later so prepare yourself for questions.... (I will try to just get it done though).
Edit: Okay, I can see Xash3D as an option under Ports, but I am immediately thrown back to the ES Menu after RunCommand.
I've done:
Copy Half-Life folder from Steamapps:
../steam/steamapps/common/Half-Life in ../rom/ports folder
for example you can see ../rom/ports/Half-Life/ and more files from game
Next: In console go to Retropie-Setup folder
cd RetroPie-Setup
cd scriptmodules
cd ports
wget --no-check-certificate https://github.com/sergiopoverony/xash3d/raw/master/xash3d.sh
After it in Emulationstation settings RetroPie - you can run Retropie Setup -> Manage packages -> exp (experemental) -> xash3d
Installed Xash3d from Source
"The above script will add Xash3d engine files to /home/pi/RetroPie/roms/ports/Half-Life/ add the valve folder from your Steam Half-Life game files to that same directory." I already had the valve folder from when I moved Half-Life over in the previous step, but I re-wrote it as that seemed to be what you were asking.
That is where I've got to...
-
@AdamBeGood can you show me a picture of the contents of /home/pi/RetroPie/ROMs/ports/Half-Life/ ? Also, after the game fails to run can you check the contents of /dev/shm/runcommand.log/ and post the contents of that file here?
-
Here is the runcommand: https://pastebin.com/Pmv4ubEW. Looks like I've messed something obvious up.
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.