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 2 years ago2021-01-13 21:05:33 UTC Post #345215
Half-Life Updated is an updated version of the Half-Life SDK that can be used with newer versions of Visual Studio and that includes both bug fixes added to the game but not the official SDK, and bug fixes not yet added to the game.

You can find the changelog here.

You can find the Updated source code here: https://github.com/Solokiller/halflife-updated
There is also a version that uses CMake, which additionally configures the project to deploy dlls to the mod directory and sets up debugging parameters: https://github.com/Solokiller/halflife-updated-cmake

The old thread about this lists other changes: https://twhl.info/thread/view/19592
Posted 2 years ago2021-01-14 00:55:22 UTC Post #345216
This is really interesting stuff! Does this fix the fast crowbar gib bug and the double shot bug from the glock's secondary fire?
Posted 2 years ago2021-01-14 09:55:15 UTC Post #345219
This is really interesting stuff! Does this fix the fast crowbar gib bug and the double shot bug from the glock's secondary fire?
No for both.
Shepard62700FR Shepard62700FRYou are currently on TWHL
Posted 2 years ago2021-01-14 10:54:42 UTC Post #345220
This is really interesting stuff! Does this fix the fast crowbar gib bug and the double shot bug from the glock's secondary fire?
I can fix the crowbar bug, but what's the double shot bug exactly? Just so i know what to look for.
Posted 2 years ago2021-01-14 11:34:22 UTC Post #345221
Just as an aside, the crowbar fix is in SOHL - it's just 1 new line to add:

if ( !pEntity->IsAlive() )
      return TRUE;
      flVol = 0.1;
if ( !pEntity->IsAlive() ) { m_flNextPrimaryAttack = UTIL_WeaponTimeBase() + 0.25; //LRC: corrected half-life bug return TRUE; } else flVol = 0.1;
Penguinboy PenguinboyHaha, I died again!
Posted 2 years ago2021-01-14 12:20:12 UTC Post #345222
I can fix the crowbar bug, but what's the double shot bug exactly? Just so i know what to look for.
Probably the fact that client prediction can call events twice, I opened this related issue back in 2015.

Mods can compile the SDK without the CLIENT_WEAPONS pre-processor define enabled. This will however require the programmer to move the client sided stuff back to the server for weapons. In other words: revert what Valve did when they introduced the client prediction system. An alternative is to set the cl_lw CVAR (Console VARiable) to 0 (false).

However, I strongly advise to not do that since they are more "workarounds" rather than "proper fixes", especially if the mod supports multiplayer.
Shepard62700FR Shepard62700FRYou are currently on TWHL
Posted 2 years ago2021-01-14 12:48:38 UTC Post #345223
I've fixed the crowbar issue using the fix i suggested on Github a while back, it'll be pushed soon.

I'm looking into the double shot issue. So far i've determined that the issue is caused by the client prediction code firing off a shot locally when the server isn't, which results in a simulated shot that never happens on the server side.

See this console output. There are 3 log calls, 2 of them are the client and server versions of the mp5's attack code, right below the event playback call, the other is in the event callback:
cl:  client fired mp5 1 times
server fired mp5 1 times
client event fired mp5 1 times

cl:  client fired mp5 2 times
server fired mp5 2 times
client event fired mp5 2 times

cl:  client fired mp5 3 times
client event fired mp5 3 times

cl:  client fired mp5 4 times
server fired mp5 3 times
client event fired mp5 4 times
The third shot only happens on the client due to prediction code running it, but never on the server side. I ended up with 4 shots too many after a full 50 rounds fired.

I think this is just a timing issue in the prediction code, so i'll see if i can isolate the cause, and perhaps find a way to make it run on the same timing logic as the server.
Posted 2 years ago2021-01-14 15:31:07 UTC Post #345224
I think i found the cause of it, i've provided an explanation and the fix here: https://github.com/ValveSoftware/halflife/issues/1621#issuecomment-760270846
Posted 2 years ago2021-01-14 17:50:48 UTC Post #345226
I've added the crowbar and the weapon timing fixes.
Posted 2 years ago2021-01-14 22:45:41 UTC Post #345228
I know i'm late but i've made a video showing the issue:
I'm currently working on a Half-Life project and i would like to ask if its ok if i get the fixed code for that issue and compile it with my SDK. I also want to congrats you guys for this fantastic work, it's nice to see that after all these years people is still giving this game the love it deserves.
Just as an aside, the crowbar fix is in SOHL - it's just 1 new line to add: https://github.com/LogicAndTrick/halflife-updated/blob/spirit/spirit-1.0/dlls/crowbar.cpp#L268
Nice! Thank you! I should try it out.
Posted 2 years ago2021-01-14 23:16:03 UTC Post #345231
It looks like that's the same bug. The fix i posted earlier doesn't seem to work for the glock so i'll have to look into that.

You have permission to use my work for your project.

EDIT: i've fixed the prediction sync issues entirely. It's consistent now, at least as far as ballistic weapons go.
Posted 2 years ago2021-01-15 00:12:28 UTC Post #345232
Wow, good work! I was just checking your explanation of the issue and when i updated the page the fix was already there. Compiled my SDK with the fixes made for the crowbar and the prediction sync issue of the weapons and it worked just fine.
Posted 2 years ago2021-01-18 04:05:59 UTC Post #345239

I reverted your crowbar change in my code though. :cool:
Posted 2 years ago2021-01-18 13:41:24 UTC Post #345242
@Cabo Fiambre
You're welcome, good to hear it's working.

Guess you prefer chainsaws over crowbars eh :P

I've added two new fixes: the raw mouse input fix from Half-Nuked and the shotgun pump sound fix. Thanks jay! for letting me know about these.
Posted 2 years ago2021-01-31 17:20:16 UTC Post #345308
I've fixed a bunch more issues.
Posted 2 years ago2021-02-06 19:53:53 UTC Post #345319
I've implemented a couple more fixes. This should now make halflife-updated up-to-date with all fixes that were added to the game but not the SDK.
Posted 2 years ago2021-02-06 20:11:05 UTC Post #345320
For those that want to play Half-Life with these fixes, i've provided a beta version: https://github.com/Solokiller/halflife-updated/releases/tag/V1.0.0-beta001
Posted 2 years ago2021-02-07 20:16:36 UTC Post #345323
Are there any other bugs or features missing from WON that anybody wants dealt with? I've re-implemented view roll as well so once all other stuff is taken care of i can release a second beta.
Posted 2 years ago2021-02-08 12:52:50 UTC Post #345324
Half-Life Updated Beta 2 is out: https://github.com/Solokiller/halflife-updated/releases/tag/V1.0.0-beta002
  • Re-implemented view roll
  • Re-implemented view model tilt
  • Fixed Egon gun beam colors being too bright
See the full changelog for more info
Posted 2 years ago2021-02-08 23:16:36 UTC Post #345325
Wow! Amazing work as always! I believe thats all of the WON features restablished.

This video here has some interesting things if you want to check it out:
While watching the video i shared i realized that the beam from the retail egon isn't properly aligned with the gun's barrel. I've took some screenshots from the video so you can understand what i mean (i know "alligned" is mispelled, sorry about that i'm dumb...).
User posted image
Posted 2 years ago2021-02-09 11:49:59 UTC Post #345327
I've already gone through everything in that video. Everything that can be fixed has been fixed. The 357 and MP5 seem to be fine already, corpse sounds can't be fixed because the data needed doesn't exist in the client side.

I tried to fix the egon gun beam issue but it's a real pain in the ass. The attachment offset isn't calculated properly for view models and the workaround is pretty ugly. I'm not sure if it will even work.
Posted 2 years ago2021-02-13 10:25:50 UTC Post #345341
can i compile this source code in visual studio 2017 and 2019 without any errors?
Posted 2 years ago2021-02-13 11:05:06 UTC Post #345342
Yeah that's kinda the purpose of this thing.
Posted 2 years ago2021-02-13 12:07:22 UTC Post #345343
I do some programming in c++ but I have never done anything in half-life source code. Would it be difficult to write such an entity, when after pressing E (Use) a text label with some text will open for me? I would like there to be some logs, notes that can be read in my mod.
Posted 2 years ago2021-02-13 13:40:19 UTC Post #345344
I don't think you need to make a new entity for that. A func_button combined with game_text can do that. Unless you need a lot of text.
Posted 2 years ago2021-02-14 15:58:55 UTC Post #345346
Is the "half-life-updated" repository the main one on which I can create mods? Because I saw on your GitHub another project "HLEnhanced" and I don't know where to start.

I gave a follow on your github,
ps. check out my github and also give follow [:
Posted 2 years ago2021-02-14 16:06:44 UTC Post #345347
Yeah half-life updated is the main one. HLEnhanced is deprecated.
Posted 2 years ago2021-02-15 08:33:41 UTC Post #345348
I think I found a fix for this (scientists not using the Scent lines near carcasses even though audio lines and sentences.txt are present) : https://github.com/ValveSoftware/halflife/issues/2982

// ISoundMask - returns a bit mask indicating which types
// of sounds this monster regards. In the base class implementation,
// monsters care about all sounds, but no scents.
int CScientist :: ISoundMask ( void )
return bits_SOUND_WORLD |
Scientists are missing the carcass/meat/garbage 'sounds' that barneys do listen to so just add those ->

`int CBarney :: ISoundMask ( void)
return bits_SOUND_WORLD |
Posted 2 years ago2021-02-15 15:28:25 UTC Post #345349
Thanks, i've added the information to the report and i've fixed it in Half-Life Updated.
Posted 2 years ago2021-02-16 22:26:28 UTC Post #345350
Nice work overall on the changelog, especially that chainsaw crowbar. Will try to use your projects issue tracker for other bugs.
Posted 2 years ago2021-02-23 20:16:08 UTC Post #345369
Half-Life Updated Beta 3 is out: https://github.com/Solokiller/halflife-updated/releases/tag/HLU-V1.0.0-beta003
Notable changes:
  • Made scientists aware of carcasses, meat and garbage so they can comment on it (Thanks NongBenz)
  • Fixed Human Grunt shotgun damage not using correct skill values
  • Fixed bugs causing incorrect field of view when loading save games/changing levels while zoomed in
  • Made cheat protected commands give, fov and impulse check the value of sv_cheats on demand instead of caching the value, enabling the use of these cheats without having to restart the map
  • Added new engine functions added in the latest engine updates
Posted 2 years ago2021-02-27 16:53:04 UTC Post #345381
Half-Life Updated Beta 4 is out: https://github.com/Solokiller/halflife-updated/releases/tag/HLU-V1.0.0-beta004
  • Added the option to change the default field of view to the Multiplayer Advanced dialog
  • Changed game directory name to halflife_updated
  • Updated delta.lst to use latest one from vanilla Half-Life (includes spectator variables)
  • Use correct number of bits for iuser2 to ensure spectating player with index 32 works correctly
  • Fixed sprite attachment bug causing sprites to appear in seemingly random locations
  • Fixed monsters being resurrected if triggered while dying
  • Made default_fov cvar archived
  • Fixed Tripmine & Python having wrong bodies sometimes when weapon prediction is enabled
  • Reset flashlight HUD status on save game load
  • Fixed ammo HUD drawing last weapon ammo if player has all weapons stripped
  • Fixed train HUD not restoring
Posted 2 years ago2021-03-16 10:54:58 UTC Post #345439
I've created a wiki page explaining what the 3 Updated repositories are about and what can and cannot be done with them: https://github.com/Solokiller/halflife-updated/wiki/About

I'm still working on each repository, there are a lot of fixes in already and more on the way.

I'm also currently working on Half-Life Asset Manager 1.1.0 to add in the features needed to fix some of the asset issues in Opposing Force (missing 357 reload sound, etc).
Posted 2 years ago2021-04-03 14:37:36 UTC Post #345497
Half-Life Updated, Opposing Force Updated and Blue Shift Updated betas have been updated:

Notable changes:
  • Fixed Gargantua stomp attack being framerate-dependent (halflife issue #2876)
  • Fixed trigger_camera rotation speed being framerate-dependent (halflife issue #2924)
  • Fixed flashlight icon not restoring properly on save game load (halflife issue #388)
  • Fixed gauss gun beams going in the wrong direction when player is viewing themselves through a camera (halflife issue #1744)
  • Fixed local player model using wrong pitch angles when seen through another entity (halflife issue #3075)
  • Fixed buttons not sparking in multiplayer (halflife issue #1681)
  • Fixed Half-Life HD and Opposing Force and Blue Shift LD and HD Revolver models not playing the reload sound (halflife issue 2351)
  • Whole bunch of code cleanup, removal of unused code, refactoring of duplicate code and constants, properly defining magic numbers
  • Fixed script in ba_yard4a that relied on a bug to break frozen Alien Slaves out of their frozen animation (halflife issue #3061)
Posted 2 years ago2021-04-18 05:24:06 UTC Post #345540
Would it be possible to make an API call while playing? You could then download some information to make the gameplay different and dynamic each time. I was thinking about firebase from google.
Posted 2 years ago2021-04-18 18:29:26 UTC Post #345541
Sure if you use a library that does HTTP queries or whatever. But that's way out of scope for this project.
Posted 2 years ago2021-05-05 12:17:49 UTC Post #345587
I've removed the source code and projects for DMC and Ricochet from the Half-Life Updated repository since neither of them were able to compile.

I've instead made separate repositories for updated projects that compile under VS2017 and VS2019:

No further development or support will be provided.

See this page for more information: https://github.com/Solokiller/halflife-updated/wiki/About
Posted 2 years ago2021-07-26 13:20:50 UTC Post #345806
You are doing outstanding work for Opposing Force. Keep up the good work.
Posted 2 years ago2021-07-27 12:47:13 UTC Post #345807
Thanks! I'm glad you like it.
Posted 2 years ago2021-07-27 18:29:16 UTC Post #345808
Hey, I signed up just to say thank you. It is amazing what you're doing.
Posted 2 years ago2021-07-28 08:36:15 UTC Post #345809
Posted 2 years ago2021-09-02 20:30:16 UTC Post #345911
May I ask if you have any plans to implement elements from the Bugfixed and Improved HL (which I think uses your improved hl code), such as bunny hopping and spectate mode into multiplayer?
Posted 2 years ago2021-09-03 17:35:40 UTC Post #345919
That project is GPL-licensed which makes it incompatible with any Half-Life SDK-based projects since it requires the engine's source code to be made available. This also means that that project in itself is a license violation since the author has not made the engine's source code available either. I think they intended to use LGPL, but that's up to them to figure out.

That aside, bunny hopping is limited by player physics code. Adding a switch to conditionally disable it is possible but that's something that i think should be left up to individual mod authors. It's easy enough to disable the anti-bunny hopping check (comment out this function call), making it conditionally disabled can be done by using one of the player user variables to network a setting (compressing it down to one bit can save some space in case you need the other user variables).

The spectator mode is something i haven't really looked at, what's wrong with it exactly? I can fix it without having to reference anybody else's code provided i know what's wrong. You can enter spectator mode by setting allow_spectators to 1 and using the spectate command to enter spectator mode, but perhaps there are some problems with it.
Posted 1 year ago2021-09-30 11:31:31 UTC Post #345963
Half-Life Updated, Opposing Force Updated, Blue Shift Updated and Half-Life Updated CMake betas released:

Notable changes for all projects:
  • Reverted "Fixed multisource having off-by-one error in trigger handling" (halflife issue #1737) to avoid edge cases where entities triggering the multisource use a delayed trigger which is not supported by fixed code
  • Fixed underwater breathing sounds playing when standing in shallow water (halflife issue #3110)
  • Multiple fixes for Linux makefiles to ensure all projects compile, link and run properly
  • Moved DMC and Ricochet projects to their own repositories so changes made to Half-Life games don't break those projects
Full changelog: https://github.com/SamVanheer/halflife-updated/wiki/Changelog#changes-in-v100-beta-006

Notable changes for Half-Life Updated CMake:
  • Made the client link with the VGUI and SDL2 libraries using relative paths to avoid hard-coding developer's paths in the client library (matches the vanilla SDK's behavior)
  • Updated setup instructions to remove Windows XP support and use VS 2019 as the example
  • Removed unused files (source code, libraries, makefiles)
  • Removed obsolete code (CBaseSpectator, cine_ entities, cycler_prdroid)
  • Restructured source code directories to make things easier to find
  • Added Mac support to the CMake files (untested)
  • Enabled multi-processor compilation when using Visual Studio (roughly 2-3 times faster compilation)
  • Removed the HALFLIFE_DIRECTORY CMake variable, the Half-Life directory is now auto-detected from the CMAKE_INSTALL_PREFIX variable which you have to set to your mod directory (see setup instructions on the wiki)
  • Added CMake settings to set up debugging command line arguments more easily when launching from Visual Studio (enabling console, cheats and developer mode on startup, passing additional command line arguments such as +map)
  • If the HalfLife_HLDS_DIRECTORY variable is set to the Half-Life Dedicated Server directory the contents of your mod's cl_dlls and dlls directories will be copied to the HLDS copy of your mod when building the INSTALL target allowing easier debugging of dedicated servers
Full changelog: https://github.com/SamVanheer/halflife-updated-cmake/wiki/Changelog#changes-in-v100-beta-001

Downloads: (The CMake version differs meaningfully only in how modders create mod libraries so there is no separate download)

This should conclude preparation work for the Half-Life Unified SDK which will combine Half-Life Updated CMake with Opposing Force Updated and Blue Shift Updated.
Posted 1 year ago2021-10-12 18:58:27 UTC Post #345968
I've been working on the Half-Life Unified SDK for a bit now. I've completed Blue Shift integration including refactoring of code and i've added all of the Opposing Force code as well, though no refactoring has been done there.

To support multiple games in a single codebase i've added two new features: custom hud colors and a flashlight/nightvision toggle.

Both of them can be controlled through code to set a default of your choosing, and hud colors can be changed using a new entity.
There are also cheat commands to set the values to a desired setting for testing purposes.

Crosshairs now also respect the hud color setting. The red autoaim variant is now drawn separately on top of the normal crosshair, and i've updated the crosshair sprites to remove the duplicate pixels. No more having to edit those sprites if your mod has a different hud color.

As a consequence of this change the autoaim crosshair for Opposing Force weapons is now its normal crosshair plus 2 red dots to the sides. I think this looks better than the original crosshair which reused the 357 autoaim crosshair. It still reuses the 357 crosshair now, but only the red dots.

To implement this functionality crosshair drawing has been moved from the engine to the client dll. This includes changing the crosshair position if sv_aim is turned on.

Unfortunately scaling up the crosshair isn't quite as easy because the standard sprite drawing functions don't support that, and the triangle API will crash if used in Software mode. It also causes the crosshair to appear blurry.

Scaling up the sprites themselves is probably the best way to deal with that.

Here's a video:
Next up is Opposing Force refactoring, which mostly involves undoing the copy pasting of code and using inheritance instead. Then i'll be adding JSON-based configuration files to handle some other features required to let you play through the three campaigns without code changes or swapping files.

Edit: further testing shows that scaled crosshairs are possible, but only in OpenGL. Software mode has issues drawing things on-screen.
Thanks to vasiavasiavasia95 for pointing this out.
Posted 1 year ago2021-10-12 20:44:51 UTC Post #345969
Great stuff as always, a question though: Is there a possibility that your work can be integrated to the base game? Maybe contacting Alfred would work?
I'm asking because there is no point of not having your fixes be a part of the actual game, 99% of HL players are unaware of your accomplishments.
Posted 1 year ago2021-10-13 16:43:08 UTC Post #345971
I doubt it, many of these changes could break existing content.

Alfred doesn't work at Valve anymore. I don't know if anybody is assigned to handle GoldSource at the moment.
Posted 1 year ago2021-10-13 18:08:51 UTC Post #345972
That so? Too bad, it felt like he was the only employee who cared. I guess we won't be seeing any more official surprise updates.
Posted 1 year ago2021-10-15 10:11:18 UTC Post #345974
Damn, that is a shame. At least GoldSRC got a brief little "hurrah" for a time there.
UrbaNebula UrbaNebulaGoldSourcerer
Posted 1 year ago2021-10-20 18:13:29 UTC Post #345983
Didn't someone called Mikela or Mikaela took his place iirc? They also seemed to be more talkative compared to Alfred, and willing to work on the engine more.
Alberto309 Alberto309weapon_spaghetti
You must be logged in to post a response.