Half-Life - In 4 easy steps

kpedersen , first of all a big Thank you! I have tried this following your provided instructions and are having a lot of fun playing this again after so many years! Also enjoyed some multiplayer sessions already, although it seems that there is only people playing one map (anarchy).
But could you please explain how to install the whole content of "steaminstall_full.exe", which contains

"Compliments of VALVe, this Steam Installer includes all the files you'll need to play several VALVe titles: - Half-Life - Half-Life: Deathmatch Classic - Half-Life: Opposing Force - Half-Life: Team Fortress Classic - Half-Life: Counter-Strike - Half-Life: Day of Defeat - Ricochet"

I would really like to play Counterstrike as well.
 
I would really like to play Counterstrike as well.
Unfortunately we can only use the *data* from that installer. We can't use any of the program code. Instead the code we are using (to build on FreeBSD) is actually compiled from Valve's official Half-Life SDK. They basically open-sourced the game code (not the engine).

The guys behind Counter-strike never released their 1.6 source code even after all this time and frustratingly it never got leaked. However there is a reverse-engineering project (from the guys upstream at the Xash3D engine) that looks promising. Though admittedly it will not have a high player base due to binary incompatibility with the SteamDRM version.

Currently the only SDKs released by Valve are Half-Life, Opposing-Force and Blue-Shift (they all work on FreeBSD :)). Valve released a public Opposing-Force installer (so I can add that to the bundle as steaminstall_opfor.exe). However they never released Blue-Shift game data publicly so we can't distribute that.

That said, these are all the options available to us in terms of mods that were open-sourced, leaked or reverse-engineered.

My personal want though is getting the Half-Life Decay (semi-official) going for a polished coop experience. Hosted here: http://half-lifecreations.com/
 
But how Do I actually start Opposing Force? Is it even installed with your procedure?

And talking about Blue Shift: As far as I remember, it came with improved textures that applied to Half-Life and Opposing Force as well if you installed it, right? Well, I still have an old CD of that, so is there a way to extract the textures from there and use them after installing your project?
 
You should see that the build also creates an opfor in the export/bin folder, next to the hl. You should be able to run this.

Then the only thing you need to do is instruct the build script to extract the opposing force data from the SteamDRM gcf file. This is done on line 94 of the build.sh, so just uncomment it.

As for Blue-Shift, the SDK is in place so you could probably copy the build instructions for HL or Opforce and they generally work. However I have not integrated anything for that yet until I can find evidence of some sort of public distribution of the game data.
 
I had never heard of that expansion! I am very interested in trying it out. All the links I find for it lead to a blank page, though.
Yeah its pretty cool. Possibly one of my favorites because of a slightly shorter Xen section! You play as one of the soldiers. What that mostly means during gameplay is that your hands look different and some security guards are fat ;)

You can download the game data files here: https://www.gamefront.com/games/half-life/file/opposing-force-steam-installer

I haven't added it to my github repo yet to save space but I probably will at some point.

You can find more info on the game from the SteamDRM website here.
 
Then the only thing you need to do is instruct the build script to extract the opposing force data from the SteamDRM gcf file. This is done on line 94 of the build.sh, so just uncomment it.
Thank you! But running the script again over an already existing installation does not work. I guess you would first need to remove everything first, fetch everything again, then edit the script and afterwards run it, because:

Code:
 cd openhl/
$ sh build.sh
mkdir: /usr/home/werner/openhl/export: File exists

It does not overwrite or add.


If you are a fan of Half-Life, you can now easily play this on FreeBSD. I have forked a number of projects in an attempt to make things easier to get up and running without relying on a port (which due to licensing is unlikely to be an option for binary distribution).

Why not? A port would be nice! And I thought that precisely with a port there would be no problem, as opposed to packages?
 
running the script again over an already existing installation does not work
Yep, thats true. Though I have been very careful to ensure everything is put in that export directory. So you can just delete that.

This is mainly a convenience. As for actually developing / improving the code you will still be using the upstream cmake and waf (hopefully not waf for too much longer to get rid of crappy Python as a dependency).

Would a port be worth it? It just means you will type make instead of sh build.sh. Yep, as you mentioned a package is a no go. I also need to push a few changes to enable saving of config files in $HOME rather than export/share.
 
Gnaa. I'm stuck in XEN. This bouncing bag thingy is stuck in that tunnel and won't come down. And noclip don't work so I can't wiggle out of it.

So I need to try OF or something.
 
And XEN is a fun place, imho ;)
Well it is great to hear that the Xen map designer's efforts are appreciated by some! ;)

In all fairness, I really liked the Xen world section in Blue Shift. It was a smaller section but set up like an incomplete science experiment on a small off-world outpost that you had to finish off.
 
If you are a fan of Half-Life

You have no idea how much that game meant to me, thank you a lot for making it available again. :)

Installed, and it works great. My understanding is this HL runs on a different and open source engine, which makes it all even more amazing.

Does the OpenHL has gamepad support?

Asking because I've plugged an USB gamepad, and couldn't find any settings to switch the controls from mouse+keyb to the gamepad. My Open HL does not respond to any gamepad controls. I'm new to FreeBSD, and don't know if my gamepad setup is incomplete, or maybe the game doesn't have gamepad support.

I've installed # pkg install controllermap and when I run controllermap from a terminal, all 16/12 buttons and the 2 analog thumb joysticks are functional and can be mapped. However, my KDE Plasma does not show any gamepad/joystick in its settings GUI for input devices, Plasma only sees the keyboard and the mouse.

How/what to set in order to play OpenHL with a gamepad?

My setup:
THRUSTMASTER Firestorm Dual Power 3 Gamepad (USB)
FreeBSD bsd 13.0-RELEASE-p4
X11 + KDE Plasma 5.23
Code:
# dmesg | grep uhid
    uhid0 on uhub4
    uhid0: <THRUSTMASTER FireStorm Dual Power 2, class 0/0, rev 1.10/1.00, addr 9> on usbus0

ls -l /dev/uhid0
    crw-rw----  1 root  operator  0xf3 Jan 28 03:09 /dev/uhid0

groups
    aaaa wheel operator video vboxusers
 
Installed, and it works great. My understanding is this HL runs on a different and open source engine, which makes it all even more amazing.
Yes, it is an engine called "Flying with Gauss" (formerly xash). I believe it has slightly dubious origin with some leaked code but I could be wrong. When going through the code, it just looks like a typical open-source project.

Does the OpenHL has gamepad support?
Hmm, actually I am not sure. The upstream developers have a heavy focus on Android (which is why I forked the project because Android support is a messy dead end time suck ;). It could well be that gamepad support is not in there unless it comes for free (i.e with SDL). I will check the code when I get back.
 
Meanwhile I've found out that:

- it should be a checkbox in the HL advance settings menu (in HL GUI) but I don't see any in my OpenHL, to enable the Joystick from the game's advance settings menu. Given the fact that my KDE Plasma is not aware about the gamepad either, probably my setup gamepad is incomplete

- if I export the gamepad settings given by controllermap into the system variable then start the openhl in the same line, with && and it didn't work, something like this:
Code:
$ export SDL_GAMECONTROLLERCONFIG="030000008f0e00000300000010010000,GreenAsia Inc. USB Joystick ,platform:Linux,x:b3,a:b2,b:b1,y:b0,back:b8,start:b9,dpleft:h0.8,dpdown:h0.0,dpdown:h0.4,dpright:h0.0,dpright:h0.2,dpup:h0.0,dpup:h0.1,leftshoulder:h0.0,leftshoulder:b6,lefttrigger:b4,rightshoulder:b7,righttrigger:b5,leftstick:b10,rightstick:b11,leftx:a0,lefty:a1,rightx:a3,righty:a2," && hl
(got this idea from an Arch Linux wiki: https://wiki.archlinux.org/title/Gamepad)

- it is very hard to aim with a gamepad, close to impossible even when the auto-aim is enabled, so I gave up playing a FPS game with a gamepad

Please don't spend time looking for gamepad support in sources, I've tried on an WinXP32 laptop with the original HL game and the same gamepad. It's impossible to aim properly with my gamepad.
 
Please don't spend time looking for gamepad support in sources, I've tried on an WinXP32 laptop with the original HL game and the same gamepad. It's impossible to aim properly with my gamepad.
OK sure. Yes I was thinking the same. It isn't like Doom, Duke3D or Blood where you are effectively playing on a 2D plane even though it looks 3D. Awkward with gamepad.

If you do want to try out Half-Life with a gamepad. I do recommend the PS2 port (Half-Life: Decay). Comes with a nifty Co-op mode too.
 
Just FIY, it compiles and runs in Linux, too, tested in 4k on an Ubuntu 20.04 LTS + KDE Plasma, i7/nVidia: :D
Code:
        sudo apt install xorg git libfreetype-dev libfontconfig1-dev libsdl2-dev mono-complete cmake pkgconf

        # - in Debian, csc is known as mono-csc, a symlink to /usr/bin/msc
        #   the 'csc' name might conflict with another package, 'chicken-bin'
        #   usually, 'chicken-bin' is not preinstalled
        # - create a 'csc' symlink to the '/usr/bin/msc', so to keep the same build.sh
        cd /usr/bin
        sudo cp -s /usr/bin/mcs csc
             
        cd ~
        git clone https://github.com/osen/openhl.git
        cd openhl
     
        PYTHON=python3 sh build.sh
        # if the compilation fails, fix the errors, delete the 'export' directory
        #   then run only this line again.  Do not start anew and do not git clone again,
        #   because that is not necessary and the repository is very big (~300MB)
     
        # for Linux, the .so names has to be changed from libclient/libserver to client/hl
        sed -i 's/libclient\.so/client\.so/' export/bin/hl
        sed -i 's/libserver\.so/hl\.so/' export/bin/hl

        sed -i 's/libclient\.so/client64\.so/' export/bin/opfor
        sed -i 's/libserver\.so/hl64\.so/' export/bin/opfor

        # to run the Half-Life game
        export/bin/hl
     
        # to run Half-Life: Opposing Force
        export/bin/opfor

I have a question about the Opposing Forces, shouldn't that be a different game?

When I run export/bin/opfor I see the same game as when I run export/bin/hl, and the saves I see inside opfor are the ones I've made while playing hl. This happens in FreeBSD (and in Linux, too).

My understanding is that both games are there, and that hl and opfor games have different maps and different story. Apparently, export/bin/opfor starts the same Half-Life, so how do I start Opposing Force (asking for the FreeBSD version, of course)?
 
My understanding is that both games are there, and that hl and opfor games have different maps and different story. Apparently, export/bin/opfor starts the same Half-Life, so how do I start Opposing Force (asking for the FreeBSD version, of course)?
Opposing Force uses the same Half-Life engine. Support is there in the code and it works fairly well, you just need to extract the files from the Steam pre-cache installer into the correct place. The script doesn't do this by default (they are commented out) and I haven't uploaded that installer to GitHub (to avoid long download times during a clone).

The following lines in the script should be fairly self-explanatory how to do it.

https://github.com/osen/openhl/blob/main/build.sh#L87
https://github.com/osen/openhl/blob/main/build.sh#L94

For the data, you can do a google search for steaminstall_opfor.exe which will end up with a public mirror such as this.
 
Hello kpedersen, I finally got around trying this, and the first thing I did is create a port, just because I hate cluttering my systems with build-time deps (they should stay in temporary poudriere jails) and I also hate having stuff installed that isn't under pkg's control...

But I'm hitting a wall right now, seeing this when I try to start the game:
1645639077996.png


As I assume you had quite a deeper look at the code: where does it try to write stuff, can you think of a way to teach it to use something below $HOME instead?

My WIP port is here: https://github.com/Zirias/zfbsd-ports/tree/local/games/openhl
 
As I assume you had quite a deeper look at the code: where does it try to write stuff, can you think of a way to teach it to use something below $HOME instead?
It should be here in the code (FS_WriteGameInfo):

https://github.com/osen/openhl/blob/main/src/engine/engine/common/filesystem.c#L1439

It uses in places a virtual filesystem (a throwback to the Quake pak stuff). I never got round to doing it but I believe that a modification to FS_Open would be the place to start in terms of creating an overlay of writable files in your $HOME in a generic manner. I did similar for GtkRadiant (The Quake / Half-Life level editor) which follows a fairly similar design in terms of filesystem.
 
Back
Top