Half-Life Updated (custom SDK) Created 2 years ago2021-01-13 21:05:33 UTC by Solokiller Solokiller

Created 2 years ago2021-01-13 21:05:33 UTC by Solokiller Solokiller

Posted 5 months ago2023-06-16 18:38:32 UTC Post #347628

Progress on the Unified SDK

A new pre-alpha build is available: https://github.com/SamVanheer/halflife-unified-sdk/releases/tag/dev-2023-06-16
Note: pre-alpha builds are not intended for general testing. As the wiki article on software life cycles explains the first versions intended for this kind of testing are alpha builds. Pre-alpha builds are for testing specific features by request to verify that they work as expected based on bug reports and feature requests.

Since this project is still in the midst of development (essentially this is the game engine development part of the project) it's expected that there are bugs and features not working as expected (or at all). Once all required features have been implemented the project can move to the alpha testing stage where verifying the proper behavior is the main goal.

SDK Changes

  • Added cl_custom_message_text cvar to display a custom message on-screen, along with cl_custom_message_x and cl_custom_message_y to control the position on-screen (works like game_text)
  • Fixed ropes breaking at high framerates
  • Added documentation to the engine's server interface
  • Marked a few more engine functions as deprecated
  • Fixed code analysis warnings
  • Reworked the music system to use a separate OpenAL device to prevent the HRTF setting from affecting music playback
  • Added option to use Link-time optimizations (C++ compiler setting)
  • Reworked HEV suit sentence playback to no longer store group and sentence indices in save games (indices are not guaranteed to be stable)
  • Reworked sentence groups to allow sentences to be non-sequential, removed bad sentence group index diagnostic message
  • Redesigned sentences system to use JSON instead
  • Removed sv_snd_openal and cl_snd_openal cvars (sound is played through the OpenAL sound system only now)
  • Disabled follower logic for (ai)scripted_sequence to prevent players from activating them with +USE (scripts share code with NPCs, including follower code)
  • Converted documentation for server and client interfaces to Doxygen format, fixed swapped documentation for HUD_Init and HUD_VidInit

C# Changes

  • Added Sentences2Json: tool to convert sentences.txt to sentences.json

Asset Changes

  • Replaced sentences.txt with sentences.json
  • Removed sentence groups that aren't actual groups
  • Fixed bad sentence replacements used in the Opposing Force & Blue Shift replacement files
  • Reworked sentences so game-specific sentences replace originals

Framerate-independent rope physics

Ropes in Opposing Force don't account for the framerate so higher framerates cause players to apply more force to ropes, and ropes will eventually stop moving if the framerate gets high enough.

This has been fixed. Rope physics has been reworked to behave as it did at 30 FPS.

Sentences changes

The HEV suit's playback list used to store group and sentence names using their index which can change between maps in this mod because it supports custom sentences files. The list now stores the names instead. This also simplifies the API used to play sounds since it can deduce what is being played using the name. It previously required you to tell it whether it was a sentence or a group.

The switch to JSON means the engine can no longer load the mod's sentences files so support for using the engine's sound system has been removed. The OpenAL sound system handles everything just fine with the sole exception of the bell sound in the Hazard Course map. That single case can be fixed by manually adjusting the sound to play as it does under the original sound system.

The new file syntax looks like this:
    "Sentences": [
        // Grenade Warning
        "HG_GREN0 hgrunt/clik(p120) grenade! clik",
        "HG_GREN1 hgrunt/(t30) clik take!(e75) cover!(s5) clik",
        "HG_GREN2 hgrunt/clik clik oh! shit! clik",
        "HG_GREN3 hgrunt/(p110 t40) clik(p120) get!(e78) down!(t30) clik",
        "HG_GREN4 hgrunt/clik(p110) (t40) of!(e75) god! clik(p110)",
        "HG_GREN5 hgrunt/clik no! clik",
        "HG_GREN6 hgrunt/clik move! clik(p120)"
    "Groups": {
        "HG_GREN": [
Sentences is a list of strings containing the sentences, just like before.
Groups is an object of group names to lists of sentences that are in that group.

It is no longer required for sentences to start with the group name and it doesn't have to end with a digit either.
This allows another sentences file to replace groups and arbitrarily combine sentences.

A tool called Sentences2Json has been added that can convert the old format to the new. It also prints warnings if invalid or duplicate sentences are encountered. The default file has a few of those.

Here's an example of the BA_POK group being replaced, which is played when you +USE a pre-disaster Barney, as well as the scripted sentence BA_SEC2_NOPASS which plays when trying to continue in the Insecurity chapter before you've got your armor:
    "Sentences": [
        "BA_POK0 hgrunt/clik(p110) (t40) freeman you are lay!(e90) team!(e20) clik(p120) clik",
        "BA_SEC2_NOPASS barney/c2a4_ba_longnite"
    "Groups": {
        "BA_POK": [
This becomes:
Note that you can reload the map to test changes as opposed to the original game which requires a full restart.

Remaining work to be done

  • Update changelog to include all changes (partially complete)
  • Write documentation for all new features (partially complete)
  • Implement as much of the work scheduled on the issue tracker as possible (done)
  • Review all changes
  • First alpha build
  • Stress test the four campaigns and fix issues that show up (first test done)
  • First beta build
These changes represent the last programming work that had to be completed for V1.0.0. Code-wise this project is now feature complete, which means it's now time to test it and finish the documentation.

This also includes testing the 3 Updated projects independently to make sure they work on their own. That means 7 full campaign playthroughs are required to verify that they work as intended: once in each Updated project and once in the Unified SDK.

New beta builds for the Updated projects will be made available once i've done these tests.

That's about it for now, until next time.
Posted 5 months ago2023-06-25 13:38:05 UTC Post #347650

Progress on the Unified SDK

SDK Changes

  • Fixed scientists crashing when speaking fear dialogue when enemy has been removed (e.g. scientist screaming in fear at human grunt that was just gibbed)
  • Fixed serverctrl tool not compiling when built as 64 bit (note: tool is not compatible with Steam Half-Life due to removed engine functionality)
  • Removed procinfo library (obsolete, the Half-Life SDK uses SSE2 by default which is only available with CPUs newer than what this library tests for)
  • Tools now obtain SDL2 using vcpkg instead of relying on the SDL2 library included with the SDK (allows 64 bit builds to be made)
  • Fixed qcsg & qrad crashing due to pointer-to-int downconversion in 64 bit builds
  • Disabled fall think function for weapons when the player picks it up to prevent possible double-pickup which removes the weapon and crashes the game
  • Implemented cheat_jetpack: When enabled, players can fly by holding down the jump button and accelerate forward when holding the forward movement button
  • Give maximum ammo when giving weapons with impulse 101 (MP5 gets full magazine)
  • Fixed Egon gun resetting animation when another weapon has just been deployed
  • Added checks to ensure talk monsters (scientists, security guards, friendly grunts) only talk to other talk monsters when idle chatting or getting shot by friends
  • Added missing call to PostRestore in weapons code (caused weapons dropped in the world to change models when going through level changes)
  • Allow CBaseMonster::DropItem to drop any entity (fixes Shock Troopers not dropping roaches)
  • Disabled jump sounds while player is frozen
  • Fixed node graph code incorrectly flagging node graphs as out of date if an outdated graph exists in a search path other than the mod directory
  • Ensure auto weapon switch setting is always initialized (fixes not switching to picked up weapons in singleplayer)

C# Changes

  • Removed globalname from crates next to the Dam in c2a5 to stop them from disappearing when entering through level change
  • Removed unnecessary sentence replacements (now handled by bs_sentences.json)
  • Removed dialogue in ba_tram2 that references Freeman and HEV suit in error

Asset Changes

  • Fixed allied grunt sentence using wrong filename ("Ok, check in!" dialogue)
  • Stop looping turretrot1.wav sound played by loader model


This cheat was added to make it easier to traverse maps more quickly and to allow players to reach ledges that are just out of reach when testing maps:

Remaining work to be done

  • Update changelog to include all changes (partially complete)
  • Write documentation for all new features (partially complete)
  • Review all changes
  • Stress test the four campaigns and fix issues that show up (second test done)
  • First release candidate build
I've tested all campaigns and training courses. All of the above changes are fixes for bugs encountered during these tests.

The next step now is to write the changelog and documentation. Features will be tested to verify that documented behavior works as expected. Any bugs found along the way will be fixed.

Once this process is complete the first release candidate builds for all projects will be released.
Posted 5 months ago2023-06-26 19:31:14 UTC Post #347651
would it be difficult to make a simple menu with different skills, e.g. pistols, medicine, hacking? surely it would be easy to create experience points that the player receives for killing a monster. And a menu with skills? Can you write me a tip in a nutshell? I'll try to figure it out myself, if I have a problem I promise to flood your inbox with spam! :P
but seriously i would like to make a mini rpg like this out of half-life
Posted 5 months ago2023-06-27 12:34:07 UTC Post #347653
I'd suggest asking for help on the Discord server, they can help you with that.
Posted 4 months ago2023-07-23 18:33:11 UTC Post #347724

Progress on the Unified SDK

SDK Changes

  • Added checks to prevent entities with class none from becoming hostile to player (e.g. if a scientist is killed near the G-Man the G-Man is marked as suspicious which makes him hostile. He'll try to attack the player but, lacking weapons, resorts to stalking the player like a Terminator instead)
  • Prevent allow_follow being set on script entities
  • Added check to prevent level changes from breaking if they are too close to each-other in relative space. The game will instead notify players who touch broken level changes that the level change is incorrectly placed
  • Reduced size of fixed size containers to optimize memory usage in sentence system
  • Use lookup table to get sounds to speed up lookup
  • Eliminated unnecessary conversion from sound index to name and back again when starting sounds
  • Clamp health before conversion to int when showing entity info (prevents entities with huge health values from showing up as having negative health)
  • Properly set scientist head when using random head setting to prevent other body groups from being changed
  • Fixed allied human grunts continuing to fire for a few seconds after killing the last enemy in an area

C# Changes

  • Update env_spritetrain sounds when upgrading maps (same as func_train)
  • Added hack to install default config.cfg file with correct key bindings
  • Added MapUpgraderDocGenerator: converts XML documentation generated by C# compiler for the MapUpgrader.Upgrades library to Markdown for use in documentation

Asset Changes

  • Added polygons under bigrat paws
  • Create valid sequences for unused HD zombie sequences
  • Added test maps to test level changes being too close to each-other
  • Added studio property to a few entities in fgd file
  • Added files used by prototype scripting system

Broken level change detection

If you go through a level change and you're touching a level change immediately after loading into the next map then all level changes will break. This has been fixed so that the level change responsible is instead disabled and a warning is shown to make this clear:
User posted image

Memory and performance optimizations

The new sound system had some performance issues that have been fixed:
  • The memory used by the client-side sentences list has been reduced by about 3/4th from 2 MiB to just under 600 KiB. This was done by reducing the size of the fixed size buffer used to store sentence names and the list of sentence words. For names and word counts that exceed the buffer size additional memory will be allocated. The new buffer sizes were chosen based on the minimum, maximum, average and median counts for both to minimize waste of memory
  • Sound lookup on the client side was too inefficient due to having to compare sound names against every sound used by sentences before regular sounds precached by the server were checked. This now uses a lookup table to dramatically reduce lookup time
  • Sounds and sentences started on the server side are no longer converted from an index back to a name and then back to an index again, which eliminates the need to perform a lookup altogether
These were the only outliers in SDK code that showed up when checking the game with a performance profiler. Most of the game's CPU time is spent in the engine which can't be analyzed more thoroughly due to a lack of access. Memory usage is pretty good with no notable outliers.

Prototype scripting system

The prototype Angelscript-based scripting system has been made available in the Git branch nonfunctional-prototype-scripting.

This prototype implements a number of features that can be used as a starting point for a more complete and functional scripting system:
  • Plugins and map scripts
  • trigger_script
  • Event System
  • Scheduler
  • Call functions from C++ using helper functions and types
  • Entity APIs
  • Custom Entities
  • Per-Entity User Data
  • Console Commands
A more complete overview is included in the documentation. The documentation explains the concepts behind these features, how they work and where the design can be improved.

I updated the prototype to include all changes made to the project and i added a couple more features i thought people might need an example for but as noted in the documentation this prototype is nowhere near ready for use. You'll need to put in a fair amount of effort to get it working.

As i noted in the Closing Thoughts you should evaluate other scripting languages to choose the right one for the job. Angelscript is powerful but that also makes integrating it into a program difficult, and when something goes wrong (and it will) you'll need advanced level C++ knowledge to understand what's happening.

Documentation and changelog

I've added documentation for as much as i can. The documentation covers everything from new features, new, modified and removed entities, tools, scripts and prototypes.

I've also added a changelog listing all changes made in the Unified SDK project (not including changes made in the Updated projects): https://github.com/SamVanheer/halflife-unified-sdk/blob/master/UNIFIED_CHANGELOG.md

The changelog is about 13 A4 pages when exported to PDF.

The main documentation readme acts as a hub for the documentation to allow navigation to the documentation and links to other projects related to this one.

Potential Upgrades

Remaining open Github issues have been moved to a "Potential Upgrades" project. I've also added issues from my TODO list to this project.

These are issues that could be worth investigating and cover bug fixes, API changes and new features. They are by no means required to be added at any point, they're just things that are worth investigating.

Remaining work to be done

  • Update changelog to include all changes (mostly complete)
  • Write documentation for all new features (mostly complete)
  • Review all changes (done)
  • Stress test the four campaigns and fix issues that show up (second test done)
  • First release candidate build
There are a couple things left to be done before development is wrapped up, mostly testing the four campaigns again to check for any issues worth fixing.

I'd like to thank malortie for helping to get the project ready for release. He's done a lot of good work on the project and helping to test the game. The project would not have gotten to this point without him.
Posted 3 months ago2023-07-30 18:28:50 UTC Post #347738

Half-Life Updated release candidates released

Half-Life Updated, Half-Life: Opposing Force Updated and Half-Life: Blue Shift Updated release candidates have been released:
Half-Life Updated: https://github.com/SamVanheer/halflife-updated/releases/tag/HLU-V1.0.0-RC001
Half-Life: Opposing Force Updated: https://github.com/SamVanheer/halflife-op4-updated/releases/tag/HLOP4U-V1.0.0-RC001
Half-Life: Blue Shift Updated: https://github.com/SamVanheer/halflife-bs-updated/releases/tag/HLBSU-V1.0.0-RC001

Notable changes for all games:
  • Fixed tripmines not detonating if placed on breakable and a save game is loaded
  • Fixed func_friction not working properly in multiplayer
  • Fixed Gauss gun sometimes settting player uranium ammo to -1
  • Fixed user interface coordinates and sizes being incorrectly adjusted for resolution
  • Fixed player weapons still receiving input when starting to use a func_tank
  • Fixed alien slave beams staying forever if they exist during a level change
  • Fixed limit in world weapons (e.g. Hand Grenade) respawning at wrong time if server is near edict limit
  • Fixed Human Grunts dropping weapons again if the game is saved and loaded while the grunt is dying
  • Fixed mouse movement during map load affecting initial view angles
  • Fixed being able to break scripted_sequence by +using friendly NPCs to make them follow player
  • Fixed potential incorrect facing in scripted sequence
  • Fixed Egon not stopping its attack animation if the attack button is held down and ammo runs out
  • Fixed scientists crashing when speaking fear dialogue when enemy has been removed
  • Disabled fall think function for weapons when the player picks it up to prevent possible double-pickup which removes the weapon and crashes the game
  • Disabled jump sounds while player is frozen (e.g. trigger_camera, trigger_playerfreeze)
  • Fixed node graph code incorrectly flagging node graphs as out of date if an outdated graph exists in a search path other than the mod directory (e.g. a graph in halflife_updated_addon/map/graphs)
Notable changes for Opposing Force:
  • Force Pitworm animations to interpolate to fix stuttering movement
  • Implemented snow footsteps and impact sounds, changed snow material type ID to O to match Opposing Force
  • Added missing EXPORT to a few Opposing Force entities
  • Fixed M249 using wrong spread in singleplayer when standing still and ducking
  • Fixed Capture The Flag items crashing on respawn
  • Fixed Health Charger recharge time not using the correct value in Co-op
  • Fixed Desert Eagle laser position not updating when holding down reload button
  • Fixed Voltigore creating beams on death connecting to wrong entity
  • Fixed ropes breaking at high framerates
  • Fixed allied human grunts continuing to fire for a few seconds after killing the last enemy in an area

Progress on the Unified SDK

The first release candidate is available: https://github.com/SamVanheer/halflife-unified-sdk/releases/tag/UNIFIED-V1.0.0-RC001

SDK Changes

  • Disabled following by default for monster_generic
  • Create smell sound when spawning client-side gibs so NPCs can comment on it
  • Only allow monster following if it's actually a monster (stops entities inheriting from CBaseMonster from being +USEable)
  • Removed json_debug cvar (redundant, server commands require rcon access)
  • Updated documentation & changelog to fix some issues, add remaining code changes and make them easier to navigate

Asset Changes

  • Fixed Spore Launcher spore appearing on the side of the screen when reloading
  • Fixed HEV sounds playing when taking damage in Opposing Force

The future of Half-Life Updated and the Unified SDK

With the first versions of these projects coming close to completion a plan for post-launch support is being worked out to allow these projects to continue receiving updates.

I previously announced that the three Updated projects would be archived upon the release of version 1.0.0. Some have indicated a desire to keep updating them afterwards to incorporate changes from the Unified SDK, so i've been working out a way to handle this.

So far i've been managing these projects mostly on my own, merging in changes contributed by others as needed. The Git repositories are part of my Github account, and i can add collaborators to allow direct commit access.

To allow the community to support these projects we've created a new Github organization called TWHL Community

The Updated projects as well as the Unified SDK and others i have on my account will be moved to this organization to allow development to continue there. Github will automatically redirect existing links to the new locations so everything should keep working as before, though links will still be updated for clarity.

Members of the organization as well as collaborators added to the individual repositories can commit to these repositories and merge pull requests.

The move of these projects to an organization managed by TWHL makes these projects officially an extension of the community and should allow development to continue as long as the community remains active. It also ensures that projects referenced by tutorials on the website remain available.

Remaining work to be done

  • Update changelog to include all changes (mostly complete)
  • Write documentation for all new features (done)
  • Stress test the four campaigns and fix issues that show up (third test done)
  • First release candidate build (done)
  • MIT license all community-written Updated & Unified SDK code
With the release of release candidate builds for all 4 projects most of the work is now done. Some small changes may still be made to wrap up some work and fix issues but everything's ready for testing now.

This means no more large changes are going to be made for V1.0.0. Stability, correctness and performance are the priority now.

If anybody wants to try them out, just download them and follow the instructions. Report bugs and other problems on the issue tracker for the relevant project. Make sure to provide as much information as possible.

Thanks and have fun!
Posted 3 months ago2023-07-31 15:57:06 UTC Post #347740
I've said once but I'll say it again, I'm absolutely floored with the amount of consistent effort you've put into this project 25 years after the game's release. This is awesome.
awkook awkookaka vhetutor
Posted 3 months ago2023-07-31 17:33:27 UTC Post #347741
Thanks, i do my best :)
Posted 3 months ago2023-07-31 17:37:18 UTC Post #347742

Map Decompiler beta 9

Map Decompiler beta 9 has been released: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V0.9.0.0-beta009

  • Renamed executables to user shorter names
  • Increased plane hashes array size to match BSP file format's MAX_MAP_PLANES limit
  • Fixed plane normals being rounded incorrectly resulting in some map geometry being misshapen
  • Updated Sledge.Formats libraries to latest version, upgraded code to match library changes
  • Updated Serilog, Newtonsoft.Json and SILK.NET.Maths libraries to latest versions
  • Upgraded to Avalonia 11.0.2, upgraded code to match library changes
  • Replaced deprecated file and folder dialog code with StorageProvider API
I'm waiting for this bug to be fixed before releasing Release Candidate 1. This bug causes the text in the top right corner to become invisible until clicked on after changing the theme from Light to Dark or vice versa.
Posted 3 months ago2023-08-02 14:10:03 UTC Post #347748

Map Decompiler beta 10

Map Decompiler beta 10 has been released: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V0.10.0.0-beta010

  • Added Windows version requirement to README
  • Added failsafes to prevent empty or invalid configuration files from crashing the program
This fixes the program failing to start if the configuration file is empty, which some users have experienced.
Posted 3 months ago2023-08-03 23:47:53 UTC Post #347755
So even with all these changes to the code, there's still no way to bring back gunshot impact sounds for the player's bullets? And a cvar to enable / disable bhop cap would be very welcome for someone like myself
awkook awkookaka vhetutor
Posted 3 months ago2023-08-14 11:23:43 UTC Post #347771
So even with all these changes to the code, there's still no way to bring back gunshot impact sounds for the player's bullets? And a cvar to enable / disable bhop cap would be very welcome for someone like myself
I've added a cvar sv_allowbunnyhopping to control the bunny hopping limiter. That can be used to allow unconstrained movement speed.

I haven't actually managed to bunny hop to see if it's possible to accelerate but the code that limits it won't execute so it should work.

Gunshot impacts aren't possible without removing weapon prediction. This is because the impact sounds are handled by client side events, and those events can't detect corpses.

The reason why corpses are undetectable is because the client operates on the list of solid entities that's also used by the player physics code. This list is populated with entities the client is told about by the server but it explicitly filters out some entities, corpses among them. They are quite literally invisible to that part of the game.

Unfortunately there's no way to detect this so it's not even possible to let the server handle it.
Posted 3 months ago2023-08-14 18:13:52 UTC Post #347772
Gunshot impacts aren't possible without removing weapon prediction.
Ahhh I see. That's a darn shame, I loved that sound lol. And you're once again an absolute legend for adding that bunnyhop cvar. I made a video about your unified SDK btw, just released it today. https://www.youtube.com/watch?v=EzvoI6nFvf8
awkook awkookaka vhetutor
Posted 3 months ago2023-08-15 11:53:47 UTC Post #347773
Ahhh I see. That's a darn shame, I loved that sound lol. And you're once again an absolute legend for adding that bunnyhop cvar. I made a video about your unified SDK btw, just released it today. https://www.youtube.com/watch?v=EzvoI6nFvf8
That's nice. Thanks for making a presentation of what the project does.

I should stress given some of the comments that this is an SDK first and a mod second, intended to allow others to build on it.

Once the project has moved to the TWHL Community organization people can add more features if they want to, like Decay features and map support but that's out of scope for V1.0.0.

Mr Floyd is currently making a Decay solo campaign mod so they can ask him about possibly porting the campaign but that's not something i have planned myself. The asset sources are going to be made available at some point so it should be possible for anyone to do that.

I've fixed the invisible mouse cursor issue that several people have reported. The next release candidate will have that fix along with a couple others.
Posted 3 months ago2023-08-20 10:12:57 UTC Post #347789

Map Decompiler beta 11

Map Decompiler beta 11 has been released: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V0.11.0.0-beta011

  • Added checks to log a proper error if BSP version is not supported
  • Show messagebox if any errors occur when saving settings (e.g. file is read-only)
  • Reworked parallelization to improve throughput when decompilation takes a while
  • Fixed job time elapsed being incorrect
This should improve CPU core usage without causing any performance issues. Testing shows that decompiling 125 maps takes 31 seconds with beta 10 and 29 seconds with beta 11.

If you encounter any issues with stuttering or freezing do make sure to let me know.
Posted 3 months ago2023-08-26 13:50:59 UTC Post #347795
Now that we have a Release Candidate, are you feeling confident enough to greenlight modders beginning work using the SDK, provided they update to 1.0.0 once it's fully tested and released? I recently started getting the urge to play around with HL1 mapping again and I'd love to use the functionality you've added.
Posted 3 months ago2023-08-26 17:47:53 UTC Post #347796
I'd hold off for a couple more weeks. We're still testing things and fixing bugs.

There should be another release candidate in the coming days to make all of the fixes available.
Posted 3 months ago2023-08-26 18:48:17 UTC Post #347797
Works for me, I still need to figure out if what I wanna make is a feasible workload and do the preprod on it.
Posted 2 months ago2023-08-31 20:44:46 UTC Post #347817

Half-Life Updated release candidates released

Half-Life Updated, Half-Life: Opposing Force Updated and Half-Life: Blue Shift Updated release candidates have been released:
Half-Life Updated: https://github.com/SamVanheer/halflife-updated/releases/tag/HLU-V1.0.0-RC002
Half-Life: Opposing Force Updated: https://github.com/SamVanheer/halflife-op4-updated/releases/tag/HLOP4U-V1.0.0-RC002
Half-Life: Blue Shift Updated: https://github.com/SamVanheer/halflife-bs-updated/releases/tag/HLBSU-V1.0.0-RC002

Notable changes for all games:
  • Fixed hand grenade model not animating
  • Added cvar sv_allowbunnyhopping to control whether the bunny hopping limiter is enabled
  • Fixed mouse cursor being invisible in VGUI1 menus when raw input is enabled
  • Fixed RPG being flagged as unusable while a rocket is loaded
  • Copy delta.lst when building client or server to ensure mods have correct delta.lst file (defines networking properties for data types)
  • Fixed item history HUD not resetting the vertical position used for new items added to the list when loading save games
  • Fixed Gauss gun dealing full damage when saving and loading right after starting a charged shot
  • Prevent breakables from spawning multiple items when destroyed by gunfire and explosives at the same time
  • Properly fixed mouse movement in main menu affecting in-game angles
Notable changes for Opposing Force:
  • Fixed electrified wire damage being frametime-dependent causing players to die almost instantly at high framerates
  • Fixed func_tank_of and other OF tank entities firing many attacks at the same time at players if they hide behind obstacles for a few seconds
  • Fixed Geneworm not lighting up its eyes

Progress on the Unified SDK

Release candidate 2 is now available: https://github.com/SamVanheer/halflife-unified-sdk/releases/tag/UNIFIED-V1.0.0-RC002

SDK Changes

  • Fixed incorrect attribute order on a couple functions
  • Optimized debug & project info huds to avoid unnecessary memory allocations
  • Fixed third person view not using correct camera offset
  • Set Drill Sergeant accessories bodygroup to blank
  • Added Natvis types for Schedule_t, CBaseMonster & CCineMonster to make it easier to debug NPCs and scripts using the Visual Studio debugger
  • Move mouth when playing regular sounds as well as when playing sentences
  • Fixed not being able to select weapons if they do not have sequential positions in the weapon bucket
  • Hardened HUD code against missing configuration data
  • Added check to prevent out of range access in entity classification code
  • Fixed func_tank entities not respecting persistence and not being able to switch targets properly if target is behind cover
  • Fixed func_tank and other tank entities firing many attacks at the same time at players if they hide behind obstacles for a few seconds (same fix as in Opposing Force, applies to regular tank entities here)
  • Make sure loader NPC stops playing looping sounds on death
  • Fixed rats having alien gibs instead of human gibs
  • Fixed turrets and tanks continuing to target players after enabling notarget
  • Fixed baby voltigores using adult sized gibs
  • Fixed Baby Voltigores playing attack sounds at wrong pitch
  • Fixed Hornet gun not playing attack animation when firing after recharging the only available ammo
  • Implemented cvar change callbacks to simplify syncing cvar changes with other systems
  • Added cvars sv_infinite_ammo & sv_bottomless_magazines to override skill variables
  • Made crosshair color separately configurable

C# Changes

  • Removed classname validation on map load to allow TFC's flagrun map to load (contains an entity with an empty classname)
  • Missing game content is now logged as a warning instead of an error
  • A missing Half-Life Uplink installation is no longer logged as an error or a warning
  • Fixed Osprey falling through the ground and reverting to the flying animation in ofboot1 after loading a save game
  • Fixed Op4 func_tank entities using persistence keyvalue (func_tank_of entities do not use this keyvalue and act as though it is set to 0)
  • Added missing wav extension to sound in of6a5 (portal sound when Geneworm arrives)
  • Removed redundant chaptertitle key from ba_power2
  • Fixed bullsquids in of5a2 not playing eat scripts (Xen area reached via Displacer)
  • Fixed grunts in ba_outro having wrong body groups

Asset Changes

  • Reverted the LD Opposing Force Crowbar model to the original model
  • Fixed Snark viewmodel fidgetnip animation leaving the left hand in an awkward position at the end of the animation
  • Use correct hud sprite for Opposing Force scanline digits
  • Fixed scientist portal animation cutting off dialogue due to sounds played on voice channel (affects c3a2d, final Lambda Core level)
  • Fixed deadhaz.mdl helmet submodel including Gordon's head causing his glasses and ponytail to clip through the helmet
  • Added crosshair color setting to cfgs, added player_setcrosshaircolor to fgd, updated test_sethudcolor with tests for crosshair color

Remaining work to be done

  • Update changelog to include all changes (done)
  • MIT license all community-written Updated & Unified SDK code
Thanks to everybody for testing these out and giving feedback, this has allowed a lot of issues to be fixed and improvements to be made.

The documentation has also been updated to include new additions.

These releases are mainly bug fixes but in the Unified SDK a few new features were added based on feedback:
  • The infinite ammo and bottomless magazines skill variables now have associated cvars to override the skill settings
  • Crosshair color is now independent of hud color and Blue Shift's crosshair color now matches the original game's color (blue was harder to see as well)
All projects are feature complete so no new features will be added. These were added because they are simple enough and somewhat required for the existing features to work well.

Do remember to follow the installation instructions to ensure that all game assets are installed and upgraded properly so as to avoid glitches and bugs!

There are some more changes that will be made for a third release candidate but nothing involving bug fixes at this time.

Try out the new release candidates and let me know what you think!
Posted 2 months ago2023-09-20 13:40:53 UTC Post #347866

Map Decompiler beta 12 released

Map Decompiler beta 12 has been released: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V0.12.0.0-beta012

  • Remove collinear points immediately to avoid merging faces into concave shapes
This fixes the Face-To-Brush decompiler generating bad brushes sometimes.

For example in ba_canal2:

User posted image
User posted image
The cause of this problem was that collinear vertices (vertices that lie on the same line, like a triangle whose vertices are all in a straight line) were removed after faces were merged. The face merging algorithm (which dates back to the original Quake 3 codebase) assumes the 2 faces don't have collinear points so this sometimes resulted in concave faces being created which level editors can't reconstruct properly.

This problem could also result in some brush faces in the .map file having NaN values.

Thanks to almix for reporting this issue.
Posted 3 weeks ago2023-11-07 12:36:07 UTC Post #347998

Map Decompiler beta 13 released

Map Decompiler beta 13 has been released: https://github.com/SamVanheer/HalfLife.UnifiedSdk.MapDecompiler/releases/tag/V0.13.0.0-beta013

  • Fixed not being able to decompile HL Alpha maps
Posted 2 weeks ago2023-11-12 19:14:38 UTC Post #348026

Half-Life Updated release candidates released

Half-Life Updated, Half-Life: Opposing Force Updated and Half-Life: Blue Shift Updated release candidates have been released:

Half-Life Updated: https://github.com/SamVanheer/halflife-updated/releases/tag/HLU-V1.0.0-RC003
Half-Life: Opposing Force Updated: https://github.com/SamVanheer/halflife-op4-updated/releases/tag/HLOP4U-V1.0.0-RC003
Half-Life: Blue Shift Updated: https://github.com/SamVanheer/halflife-bs-updated/releases/tag/HLBSU-V1.0.0-RC003
Drown recover damage handling was broken during the period of October 9 through November 5. If you cloned the source code during that time, make sure to update to include the fix for this problem. If you need to know what to change you can view the fix here (i'd suggest using Git to get the update instead): https://github.com/SamVanheer/halflife-updated/commit/7fbccedbd9d2adc115f8f6e61dcd58858c0f5b3c
Notable changes for all games:
  • Fixed save game system not saving arrays of EHANDLEs if the first half of the array contains null handles (mainly affected Nihilanth's spheres)
  • Fixed player gaining health when drowning with god mode enabled and recovering health after surfacing
  • Fixed human grunts continuing to fire for a few seconds after killing the last enemy in an area
  • Fixed crash when +USEing NPCs that have just exited a scripted sequence
  • Fixed talk monsters resetting other talk monsters' dying schedule if they are both killed at the same time
  • Fixed RPG laser turning on when reloading immediately after equipping the weapon
  • Reverted weapon selection using weapon IDs to prevent the game from malfunctioning when delta.lst is missing
  • Added sv_load_all_maps & sv_stop_loading_all_maps to help automate node graph generation
Notable changes for Opposing Force:
  • Fixed Male Assassin Snipers not tracking their last shot time properly causing them to fire the Sniper Rifle as if using full auto
  • Fixed torch and medic grunts, male assassins and shock troopers continuing to fire for a few seconds after killing the last enemy in an area
  • Fixed Gonome crashing the game if the player dies while being damaged by Gonome's chest mouth
  • Save and restore allied grunt repel entities to ensure spawned NPCs have correct properties
  • Fixed Desert Eagle laser turning on when reloading immediately after equipping the weapon
Continued in next post ==>
Posted 2 weeks ago2023-11-12 19:14:51 UTC Post #348027
<== Continued from previous post

Progress on the Unified SDK

Release candidate 3 is now available: https://github.com/SamVanheer/halflife-unified-sdk/releases/tag/UNIFIED-V1.0.0-RC003

SDK Changes

  • Reworked tripmine entities to use separate world model
  • Don't allow executing sv_addbot with no parameters
  • Added ITEM_FLAG_SELECTONEMPTY flag to weapons that regenerate ammo to always be selectable and never show as red in hud history
  • Truncate yaw using cast to int instead of floor to match engine behavior (fixes NPC navigation in some maps)
  • Fixed ambient_music not being triggerable in radius mode
  • Added keyvalues to set barney & otis corpse bodygroups
  • Fixed code analysis warnings when combining format result with string_view in ternary
  • Speed up sv_load_all_maps, automatically load first map & print more info, more consistent and robust behavior and added stop_loading_all_maps command to stop this process
  • Build portable binaries and workaround gcc bug to allow the Linux version to run on architectures that are missing the C++ runtime version used by the game and to avoid problems with std::regex
  • Additional fix for op4loader sound looping bug to stop looping when the NPC is removed
  • Boosted volume to match original engine by multiplying by **8**

C# Changes

  • Adjusted MaxRange (far Z clipping plane) in c2a2a to fix graphical issues
  • Fixed Alien Slaves in ba_canal1 waiting for 5 seconds before attacking
  • Added upgrades to fix issues with barney, otis & scientists in specific levels (skin color & equipped weapons and items)
  • Don't delete node graphs, update timestamps instead so graphs will be loaded from disk
  • Updated third party dependencies and updated BSPToObj to account for changes in the vertex order used by Sledge library
  • Add upgrade for bell1.wav sound and pitch so the bell sound sounds like it does in the original game

Asset Changes

  • Added separate tripmine world model
  • Added scientist_cower models
  • Reverted changes made to viewmodel animations to match the original games
  • Updated test maps to account for code changes
  • Fixed HEV suit sentences playing in Opposing Force and Blue Shift
  • Changed event id for sounds played by scientists that shouldn't affect the mouth so scientists don't "talk" when a beep sound plays
  • Add polygons to loader accordion spine
  • Added hlu_technology_demonstration map (unfinished, only contains a zoo of various NPCs and NPC models at this time)

Framerate issues in the GoldSource engine

Some people have reported issues that occur when playing at high framerates (100+ FPS) or when using cvars like host_framerate to manipulate the framerate to run very high.

This game was developed on machines that ran the game at about 20-30 FPS and everything was designed around that. The engine doesn't compensate for high framerates correctly in some cases and some game code also lacks proper compensation. Some of these issues have been fixed but the game will never work properly at high framerates because the render framerate is tied to the simulation framerate.

The engine was also designed to run at a maximum of 72 FPS, as seen in Quake 1's source code: https://github.com/id-Software/Quake/blob/bf4ac424ce754894ac8f1dae6a3981954bc9852d/WinQuake/host.c#L494-L522

GoldSource lacks this limiter but it still won't work properly. The recommended framerate is either 30 or 60 FPS. 100 FPS generally works but in specific cases like elevators there might be glitches like NPCs taking damage, dying or getting gibbed due to getting stuck. Higher framerates will be more prone to glitches.

Modern engines typically lock framerates or decouple the simulation framerate from the render framerate to avoid these issues, unfortunately this can't be fixed in a mod without re-implementing the entire physics engine.

NPC navigation issues

Users reported NPCs having problems navigating in specific areas. Known occurences include We've Got Hostiles in the area after the first elevator and a soft-lock that sometimes occurs in Lambda Core level A, where the scientist holding the shotgun fails to move to the button to open the door.

This was caused by an engine function that was re-implemented in game code to allow for better optimizations.

The faulty code looked like this:
float VectorToYaw(const Vector& forward)
    if (forward[1] == 0 && forward[0] == 0)
        return 0;

    float yaw = atan2(forward[1], forward[0]) * 180 / PI;

    if (yaw < 0)
        yaw += 360;

    return yaw;
The fixed code looks like this:
float VectorToYaw(const Vector& forward)
    if (forward[1] == 0 && forward[0] == 0)
        return 0;

    float yaw = static_cast<int>(atan2(forward[1], forward[0]) * 180 / PI);

    if (yaw < 0)
        yaw += 360;

    return yaw;
The lack of a cast to int caused yaw angles to be calculated slightly differently compared to the engine.

Casting to int and then back to float causes the value to be rounded. The exact behavior is compiler-specific, in Microsoft's case this is equivalent to calling std::round: https://learn.microsoft.com/en-us/cpp/c-language/conversions-from-floating-point-types?view=msvc-170

Without the cast no rounding is performed and yaw angles will be slightly off, in some edge cases like those mentioned above this can cause NPCs to get stuck.

Finding the cause of this is 99% finding a reproducible case of the problem happening. The Lambda Core occurrence didn't always happen, but the We've Got Hostiles one did.

Once that was found it was a simple matter of using version control to pinpoint which change introduced the problem and then finding the exact line of code. Comparing against the engine's version showed the missing cast.

This bug highlights the importance of being precise when recreating existing functionality, as well as making good use of version control. Without version control finding the cause would've been a lot harder.

sv_load_all_maps command

The sv_load_all_maps command has been modified a bit to deal with an engine bug that causes the game to crash or shutdown partway through loading all maps.

This command is mainly intended to be used to automate generation of node graphs but it can be used to gather error logs for each maps as well, or to automate testing of scripting systems using map-specific scripts if your mod has that.

A related command called sv_stop_loading_all_maps has been added to stop this process if necessary.

Node graphs

Node graphs are now bundled with mod installations instead of requiring them to be generated when a map is first loaded. This should make the first-time experience a lot smoother.

New repositories in the TWHL Community Github organization

A few new repositories have been added:
  • HalfLifeSDKHistory: Contains each Half-Life 1 SDK release's source code as individual commits to allow viewing changes made in each update. There are also branches for the multiplayer version (lacks AI code) and a branch showing the difference between the singleplayer and multiplayer versions
  • OldValveReleases: Contains modding files released by Valve, mostly old SDKs
  • SlackillerDownloads: Contains files hosted on the old Slackiller modding website
  • VHLT-V34: Contains the source code for VHLT V34 along with branches that remove disabled code paths for easier viewing. Also includes a copy of the VHLT V34 tools for completeness sake
Continued in next post ==>
Posted 2 weeks ago2023-11-12 19:15:00 UTC Post #348028
<== Continued from previous post

A new UI

I've looked into integrating RmlUi to determine which challenges are ahead in that area. I've experimented with replicating the look of the HUD in HTML, but so far i haven't been able to reproduce the exact method used which involves using a grayscale image colored with a specific value and whose alpha value is affected by the saturation of the color.

All of my findings are included in the Github issue: https://github.com/SamVanheer/halflife-unified-sdk/issues/453

If there is a way to replicate the HUD's exact appearance in HTML then it probably won't work in RmlUi since it will likely depend on CSS features that RmlUi doesn't (yet) implement.

Until it's possible to render the HUD in RmlUi it isn't worth trying to integrate it into a mod.

I've also done some investigation work into how modern engines handle UIs to see if any of them provide their UI toolkits as standalone options that can be integrated into an engine this old.

My findings are as follows (not an exhaustive list):
  • Unreal engine: Uses Unreal Motion Graphics, a tightly integrated toolkit that depends on other Unreal features like blueprints to function.
  • Unity engine: Uses UGUI, a GameObject-based toolkit. Totally dependent on the engine to function and written in C#.
  • Godot engine: Uses Godot UI, a tightly integrated toolkit that builds on Godot's class hierarchy.
  • Source and Source 2 engines: Use Panorama, a tightly integrated toolkit that uses a web-like development stack using XML, CSS and Javascript. It integrates with the engine to allow features like particle systems and model rendering to be embedded in the UI itself. Panorama's XML is not strictly HTML; it's very similar but is an evolved form of VGUI (it uses `Panel`s just like all VGUI versions).
Panorama is the closest to RmlUi in functionality but like all toolkits listed is tightly integrated into the engine.

This integration allows engine functionality to be used in the UI but precludes integration into other engines. None of these toolkits are available for standalone use, and even if they were they all use modern graphics APIs which makes integration even harder.

All of these toolkits are optimized for use in games, which means they update and render once a frame.

Another alternative is Chromium Embedded Framework 3 (CEF3), used to implement the UI in various desktop applications like Steam, Discord and Visual Studio Code (using Electron, a desktop application framework built on top of Chromium).

Chromium is designed to power web browsers; its architecture is designed around this use case. In practical terms this means Chromium uses subprocesses to perform tasks to prevent a browser tab from freezing the entire application, to prevent one tab from using exploits to read another tab's memory and other security and performance-related issues.

In part because of the use of subprocesses Chromium uses a lot more memory. Steam for instance uses around 470 MB of memory when running idle in the background. Discord uses 315 MB. It's possible for Chromium to use more memory then the rest of the game combined.

Chromium renders frames on its own, out of sync with the application. It's possible for Chromium to render more frames than your application needs, but also less, and probably lagging behind which can be a problem in a real-time environment like a game.

Additionally since pages are handled by subprocesses exposing Javascript APIs to UI logic isn't as cheap as it is with toolkits like RmlUi and Panorama. Half-Life's UI code accesses game state and in some cases modifies it as well which is complicated by the need to also communicate with the main game process.

GoldSource uses CEF1, an older single-process version of Chromium to render the HTML-based message of the day in Counter-Strike and Day of Defeat. It's been out of support for 10 years and can't even display the official Counter-Strike website due to a lack of support for modern secure connection technology. This integration is limited to rendering frames for display in VGUI2; it can't allow interaction between a website's Javascript and the game itself.

There aren't many cases of games using Chromium for their in-game UI. Here are some articles and discussions that covers the subject in more detail: I couldn't find any references to games that actually use Chromium but i have seen discussions about it in passing before.

A couple mod teams have attempted to integrate Chromium into mods before (GoldSource and Source) but it has always led to failure due to the problems listed above and overall technical challenges involved with such a complex framework. If you really want to use it, you'd better prove it can be done properly first.

Based on my findings i'd say trying to integrate a new UI toolkit is a waste of time unless you can guarantee these things:
1. You can replicate the UI in HTML exactly as in the original without performance issues
2. The toolkit of choice can be integrated into a mod and works properly on Windows and Linux and when using the OpenGL and Software renderers (Software mode support can be dropped if needed, but for the Unified SDK in particular it's not an option without a major version change)
3. The implementation runs well in general and on older systems in particular. Given that Steam is dropping support for older platforms due to CEF as well this isn't a major challenge but Half-Life players tend to use older systems

Remaining work to be done

  • MIT license all community-written Updated & Unified SDK code
  • Move projects to twhl-community organization
  • Add any required documentation on development process that is currently missing
I've run through all of the games again to test for any remaining issues. A handful were found and fixed and are listed above alongside fixes found by others.

This just about wraps up all work for V1.0.0. Everything that can be done in a reasonable timeframe has been done, all major issues have been dealt with and the last full test shows the games are working as expected. Once the remaining work listed above has been completed all projects are ready for a V1.0.0 release.

However, the full release of V1.0.0 will have to wait until after Valve has finished what they're working on to avoid having to release a patch in case there are any problems. People have noticed activity in a new password-protected branch that indicates the games are being updated with better controller and Steam Deck support.

No details are available so to avoid potential problems V1.0.0's full release has been delayed until these changes have been released by Valve. Given that controller support is implemented in the client dll which is part of the SDK this will likely mean mods will have to update to get the same changes.

That's probably meant to release on the 25th anniversary which is a week from now, so it shouldn't be a very long delay.

Once all of that stuff is sorted out all three of the Updated projects and the Unified SDK will be part of the twhl-community Github organization and will be maintained by the community.

The map decompiler will also be moved over after i've double-checked all of its features and the text color bug in Avalonia has been fixed.

Half-Life Asset Manager V2.0.0 will also receive a full release shortly once all of the above has been dealt with after which i will begin working on V3.0.0 which aims to replace the graphics code with modern OpenGL and to hopefully provide a fully functional Linux version.

I'd like to thank everybody for helping to develop and test these projects and hopefully they'll be fully released soon for everybody to try out and play with!
Posted 1 week ago2023-11-17 19:09:26 UTC Post #348054

Half-Life 25th anniversary version released

Valve has released the 25th anniversary version of Half-Life which has slight changes in how the filesystem interface works which causes all mods based on recent versions of Half-Life Updated to crash. I've identified the problem and i've pushed a fix to a separate branch: https://github.com/SamVanheer/halflife-updated/tree/dev-anniversary

Until Valve releases a new SDK all projects will remain as-is. Use the steam_legacy branch to run mods. You can access it by right-clicking Half-Life in Steam, opening Properties and going to the Betas tab:
User posted image
Make sure to change Half-Life's branch even if you're trying to run another game like Counter-Strike because all GoldSource engine games and mods use Half-Life's engine files. Once you've switched it make sure Half-Life is up-to-date (you may need to launch it or press the Update button) and then you should be able to run other games/mods.

Once the SDK has been released i'll update the SDKs to work with the new version.

Note that there are some bugs in the new version. There is a noticeable (half second) delay in sound playback so they'll probably be fixing bugs before any SDK updates can be expected.

Please don't report mod crashes as bugs on the Half-Life Updated issue tracker because it's currently out of our hands. Check the Half-Life issue tracker and search before you post.
Posted 1 week ago2023-11-18 05:20:50 UTC Post #348056
Im glad you noticed the delay in sound playback as well. Drives me nuts. Also, can you believe it, they added bullet impact sounds for the player! :D
awkook awkookaka vhetutor
Posted 1 week ago2023-11-18 13:40:06 UTC Post #348059
Yeah, they used the solution i mentioned to someone a while back. I never got around to applying it myself but it'll be merged in once the SDK update rolls around.

I do wish they'd make the anniversary edition a separate game as that would've avoided all of the problems. No need to switch branches, no broken games and mods and each game can be ported one at a time. And then a separate game/tool/app on Steam for mods to use to decouple game fixes from the mod version of the engine.

There must be a reason why they did it this way but it's causing a lot of headaches.
Posted 1 week ago2023-11-18 13:59:42 UTC Post #348060
Well this really threw a wrench in things but at least we got a proper update to Half-Life for modern systems.
Wibble WibbleThe true citizen enjoys Half-Life but uses discretion
Posted 1 week ago2023-11-19 18:14:52 UTC Post #348065
Today's update fixes the problems that broke Half-Life Updated and mods derived from it. I'm going to wait until they've released an SDK update before i touch anything since it'll be a while to stabilize everything.

There's a test branch for Opposing Force which means it'll receive an update soon as well. Expect the same for all GoldSource engine games to fix issues with the new engine update. I'd expect the SDK update to come after all games have been updated and fixed so it'll probably be a few weeks.

Until then use the steam_legacy branch to develop, test and play mods.

In case i don't have time to deal with the SDK update, here's the procedure for merging changes into Half-Life Updated:
1. Fork the newest version of the Half-Life 1 SDK
2. Make sure all files use UTF8 encoding (should hopefully be done by Valve already, but check first) and commit any encoding changes
3. add the .clang-format file from Half-Life Updated and format all files (script in the Unified SDK or a Visual Studio extension can do this among other tools). Needed to avoid massive amounts of merge conflicts caused by whitespace and newline changes
4. Commit formatted files
5. Add fork as remote to Half-Life Updated
6. Use git fetch to update remote info
7. Merge the commit that formatted files
8. Resolve merge conflicts; there will likely be many. Some changes are technically out of scope for the project like the game balance changes, i'd exclude those changes or make them conditional based on cvars (the Unified SDK uses configuration files for those changes so it'll need to be updated there instead)
9. Commit merge and push

That should cover it. I'd recommend using a separate copy of the source code to avoid messing up the one people normally use for development. Use a Git GUI like SourceTree, it makes things a lot easier.
You must be logged in to post a response.