HLFixes
Fixing Bugs in GoldSrc
Download
Latest ReleaseRequirements
- Latest Steam version of Half-Life
- Also works with the last pre-anniversary version
- Versions from before 2019 may or may not work with HLFixes
Windows
- Windows XP (tested with SP3) or newer
- Microsoft Visual C++ 2015-2022 Redistributable (x86)
- If you're on Windows XP, you'll need an older version. I've confirmed that version
14.16.27033.0
works correctly. You can get that version here.
Linux
- Should work on pretty much anything that's capable of running Half-Life.
Installation Guide
Windows
- Make sure Half-Life isn't running
- Download
Windows.zip
from here - Extract it somewhere
- Run
Installer.exe
- Click on
Install
orReinstall
if you're updating - If all goes well the fixes should be applied
Linux
- Make sure Half-Life isn't running
- Download
Linux.zip
from here - Extract it somewhere (
unzip Linux.zip
) - Run
./installer.sh
from a terminal - Select
Install HLFixes
orReinstall HLFixes
if you're updating - If all goes well the fixes should be applied
You can see if it's working by running
versionin console. It should say
Patched with HLFixesat the end of the output.
Why?
Because there's still bugs in GoldSrc that have yet to be fixed, unfortunately.
Ideally, HLFixes will be made entirely obsolete by Valve but so far that hasn't happened.
How?
The installer modifies the Half-Life launcher so that it loads HLFixes instead of the engine. HLFixes then loads the engine and applies patches and hooks.
What's Been Fixed?
Quick save backup not functioning
When you make a quick save, the engine is supposed to rename the already existing
quick.savto
quick01.savbefore writing the new quick save.
However, this functionality was unintentionally broken in an update that fixed this issue. HLFixes restores the previous behaviour.
Technical Details
SaveGameSlotis the function responsible for calling the save backup function. It does this by checking to see if the save is called
quickor
autosaveand calling
Host_SaveAgeListif it is.
However, after the update,
Host_Savegame_fnow appends
.savto the save name before calling
SaveGameSlot, thus preventing
Host_SaveAgeListfrom ever being called as the save is now called
quick.sav.
HLFixes resolves this issue by hooking
SaveGameSlotand changing the save name to
quickif it was
quick.sav.
GitHub issue.
Music stopping after a level transition
This is technically intentional behaviour. If the game isn't Half-Life 1, the engine stops music after a
level transition.
However, the expansions and a lot of mods aren't expecting this to be the case. HLFixes removes the
whitelist and makes it work in all games/mods.
Technical Details
CGameUI::ConnectToServerchecks to see if the game name is
valve. If it isn't, it issues the
mp3 stopcommand to the engine.
HLFixes resolves this issue by hooking
CGameUI::ConnectToServerand changing the game name to
valve.
Main menu music continuing to play while in-game
The engine never stops the main menu music after leaving the main menu. HLFixes fixes this by telling the engine to stop playing the music when going in-game.
Technical Details
HLFixes resolves this issue by hooking
CGameUI::ConnectToServerand checking to see if the current track is
media\gamestartup.mp3.
If it is, the game name is changed to something other than
valvein order to take advantage of the music stopping behaviour.
Main menu music playing over top of the intro video
The engine starts playing the main menu music before the intro video starts playing. HLFixes fixes this by starting the main menu music after the videos are done playing.
Technical Details
HLFixes resolves this issue by hooking
Cmd_ExecuteStringWithPrivilegeCheckand preventing the command that starts the main menu music from executing.
HLFixes also hooks
CVideoMode_Common::PlayStartupSequenceand issues the command to start the main menu music after the intro videos are done playing.
gl_overbright
This fix has been made mostly obsolete with the anniversary update.
The engine turns off texture sorting if it detects that your GPU supports the multitexture extension.
HLFixes turns texture sorting back on, which allows
gl_overbrightto work.
Technical Details
HLFixes resolves this issue by forcing
gl_texsortto 1 when
gl_use_shadersis 0.
Broken skies in Condition Zero Deleted Scenes
When the engine draws the sky, it needs to know what surfaces are supposed to have the sky drawn on them. The
way it does this depends on whether texture sorting is on.
When
gl_texsortis set to 0 (i.e. when the engine detects the multitexture extension), it simply checks to see if a given surface has the
SURF_DRAWSKYflag.
When
gl_texsortis set to 1, it'll check every texture the map uses to see if it starts with
sky. When it comes time to draw the sky, it'll draw it on surfaces that use the texture it found.
The latter behaviour works well for the most part, but it assumes that there will only ever be one texture that starts with
sky.
Condition Zero added a new texture called
skycullthat is supposed to be used on the exterior of sky brushes in order for weather effects to work properly.
If this texture comes after the real sky texture in the texture list, it will be incorrectly selected as the sky texture and thus causes the sky to break when
gl_texsortis set to 1.
Technical Details
HLFixes resolves this by patching part ofR_NewMapso that instead of calling
Q_strncmpto determine if a texture starts with
sky, it calls HLFixes.
HLFixes checks if the texture being checked is called
skyculland prevents a match if it does. Otherwise, it calls
Q_strncmpas normal.
Launch Options
Option | Description |
---|---|
--no-fixes |
Causes HLFixes to not apply any fixes. |
--no-music-fix |
Causes HLFixes to not apply music fixes. |
--no-startup-music-fix |
Causes HLFixes to not apply the main menu music fix. |
--no-quicksave-fix |
Causes HLFixes to not apply the quick save backup fix. |
--no-overbright-fix |
Causes HLFixes to not apply the overbright fix. |
--no-sky-fix |
Causes HLFixes to not apply the CZDS sky fix. |
--no-startup-video-music-fix |
Causes HLFixes to not apply the music playing during startup video fix. |
--persist-music-in-mp |
Allows music to continue playing between multiplayer level changes. |
--no-multitexture |
(Windows only) Prevents use of the OpenGL multitexture extension. May improve performance when
using a poorly written graphics driver. Incompatible with gl_use_shaders 1. |
Known Issues
- Detail textures no longer work when
gl_use_shaders
is 0 - This is a side effect of the gl_overbright fix
- Most games/mods don't use detail textures so it shouldn't matter much
- For games/mods that do use detail textures (i.e. Counter-Strike: Condition Zero), put
--no-overbright-fix
in your launch options if you really want them
Regarding VAC
While HLFixes is not a cheat, I would recommend disabling HLFixes before entering a VAC-secured server, just to be safe.
This can be done by putting
--no-fixesin your launch options, or by uninstalling HLFixes through the installer.