RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    Setting up Half-Life through RetroPie (A Guide)

    Scheduled Pinned Locked Moved General Discussion and Gaming
    half-lifexash3d
    147 Posts 30 Posters 46.7k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • quicksilverQ
      quicksilver
      last edited by quicksilver

      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.

      ​

      1. 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

      2. 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.

      3. 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.

      4. 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 a hl.soin 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 customin your valve directory then copy/paste the contents of the valve_hd folder found in your Half-life steam game files to the /valve/custom/ folder (for mods like Blue Shift and Opposing Force copy from bshift_hd to /bshift/custom/ and gearbox_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 the custom folder to something else)

      Thats about it, if you have any questions let me know!

      E ExarKunIvE K C E 7 Replies Last reply Reply Quote 10
      • E
        ellohir @quicksilver
        last edited by

        @quicksilver thank you so much for this guide! I love the original HL 🥰

        1 Reply Last reply Reply Quote 1
        • ExarKunIvE
          ExarKunIv @quicksilver
          last edited by

          @quicksilver nice work. good idea to do this

          RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
          RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
          Maintainer of RetroPie-Extra .

          1 Reply Last reply Reply Quote 0
          • quicksilverQ
            quicksilver
            last edited by

            Added additional info about increasing performance and how to run mods like Blue Shift and Opposing Force.

            1 Reply Last reply Reply Quote 1
            • quicksilverQ
              quicksilver
              last edited by

              Added info on using HD model packs

              1 Reply Last reply Reply Quote 1
              • B
                BennyProfane
                last edited by

                Very cool! Is the CounterStrike 1.6 version compatible too?

                quicksilverQ 2 Replies Last reply Reply Quote 0
                • quicksilverQ
                  quicksilver @BennyProfane
                  last edited by

                  @BennyProfane I haven't tried it. But if you get it working, please let me know!

                  1 Reply Last reply Reply Quote 0
                  • quicksilverQ
                    quicksilver @BennyProfane
                    last edited by

                    @BennyProfane looks like CS 1.3 might be possible but 1.6 is currently only supported on Android.

                    1 Reply Last reply Reply Quote 0
                    • quicksilverQ
                      quicksilver
                      last edited by

                      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.

                      1 Reply Last reply Reply Quote 1
                      • R
                        RussellB
                        last edited by RussellB

                        @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?

                        quicksilverQ 1 Reply Last reply Reply Quote 0
                        • quicksilverQ
                          quicksilver @RussellB
                          last edited by quicksilver

                          @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.

                          1 Reply Last reply Reply Quote 0
                          • R
                            RussellB
                            last edited by

                            Will do. I got the Cthulhu mod running and playable without a custom client.so and hl.so. Why do Blue Shift and Opposing Force need them?

                            quicksilverQ 1 Reply Last reply Reply Quote 0
                            • quicksilverQ
                              quicksilver @RussellB
                              last edited by quicksilver

                              @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.

                              ExarKunIvE 1 Reply Last reply Reply Quote 0
                              • R
                                RussellB
                                last edited by

                                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!

                                quicksilverQ 1 Reply Last reply Reply Quote 0
                                • quicksilverQ
                                  quicksilver @RussellB
                                  last edited by

                                  @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

                                  R 1 Reply Last reply Reply Quote 0
                                  • ExarKunIvE
                                    ExarKunIv @quicksilver
                                    last edited by

                                    @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

                                    RPi3B+ / 200GB/ RetroPie v4.5.14, RPi4 Model B 4gb / 256gb / RetroPie 4.8.2
                                    RPi5 4gb / 512gb / RetroPie 4.8.9 -Basic
                                    Maintainer of RetroPie-Extra .

                                    1 Reply Last reply Reply Quote 1
                                    • R
                                      RussellB @quicksilver
                                      last edited by

                                      @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!

                                      1 Reply Last reply Reply Quote 0
                                      • A
                                        AdamBeGood
                                        last edited by AdamBeGood

                                        @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...

                                        quicksilverQ 1 Reply Last reply Reply Quote 1
                                        • quicksilverQ
                                          quicksilver @AdamBeGood
                                          last edited by

                                          @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?

                                          A 1 Reply Last reply Reply Quote 0
                                          • A
                                            AdamBeGood @quicksilver
                                            last edited by AdamBeGood

                                            Here is the runcommand: https://pastebin.com/Pmv4ubEW. Looks like I've messed something obvious up.

                                            Halflife.jpg

                                            Halflife2.jpg

                                            quicksilverQ 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            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.