halflife icon indicating copy to clipboard operation
halflife copied to clipboard

[HL25] Weapon hit sounds on players don't work in multiplayer

Open pierow opened this issue 1 year ago • 2 comments

The bullet hit sounds don't work in HL25 multiplayer regardless if the hitbox or bounding box was hit, due to EFLAG_FLESH_SOUND not being sent to clients because eflags aren't included in entity_state_player_t gamedll Player_Encode in the delta.lst.

The delta.lst on this repo currently isn't up to date, but HL25 added this line to entity_state_t gamedll Entity_Encode:

DEFINE_DELTA( eflags, DT_INTEGER, 2, 1.0 ), // JoshA: Changed to 2 for EFLAG_FLESH_SOUND to fix flesh sounds on entities. If a mod ships updated DLLs and not this file, they just won't have that fix.

The line needs to also be added to the entity_state_player_t gamedll Player_Encode, and flesh sounds will play again like they previously did, but they will still make a hit sound when the bounding box is hit and no damage was done.

This also is somewhat related to the HL25 patch note that did not fix the issue it intended to fix:

Improved client-side prediction to reduce "ghost shots". Like Counter-Strike, consider hitboxes and not just bounding boxes for hits on the client.

The following behavior is what happens when shooting either at and/or near a player with videos below:

  • HL25 Multiplayer: No flesh hit sounds at all.
  • HL25 Singleplayer: Correctly plays flesh hit sounds only when the NPC will take damage.
  • steam_legacy Multiplayer: Plays flesh hit sounds on hits and missed shots.
  • steam_legacy Singleplayer: No flesh hit sounds at all.
  • HLSDK After delta.lst fix: Plays flesh hit sounds on hits and missed shots.
  • HLSDK Singleplayer is untested.

The issue occurs regardless if it's a listen server or HLDS.

https://github.com/ValveSoftware/halflife/assets/6503238/f1ba7619-01db-4c2a-9f48-89b786f831d4

https://github.com/ValveSoftware/halflife/assets/6503238/5276747c-2d07-4b2a-9599-5b35dd9dcc42

https://github.com/ValveSoftware/halflife/assets/6503238/3e7a591f-f718-4992-b5fe-ca71bac0ab4e

https://github.com/ValveSoftware/halflife/assets/6503238/30f4ac95-9a49-4bba-bc4e-cb15206e4a74

https://github.com/user-attachments/assets/53d1baa2-5194-4103-b855-7d030e9df172

pierow avatar Apr 15 '24 02:04 pierow

The original post has been updated with more information and a fix for the new bug introduced in HL25 where there's an absence of any hit sound.

The other related bug fix to hit sounds playing on bounding boxes also does not work in multiplayer because the trace result here returns the player entity regardless of the PM_NORMAL or previous PM_STUDIO_BOX flag.

https://github.com/ValveSoftware/halflife/blob/b1b5cf5892918535619b2937bb927e46cb097ba1/cl_dll/ev_hldm.cpp#L413-L422

@shawns-valve

pierow avatar Oct 04 '24 12:10 pierow

Do you mind to test Hitbox Fixer to see if there are any improvements?

rtxa avatar Nov 04 '24 16:11 rtxa