Repository navigation
Conversation
The headshot sound (player/helmet_hit.wav) comes from DoD's client, the events/effects/bodydamage.sc handler calling EV_PlaySound on the hit player at ATTN_NORM. The fire_sounds hook now halves that attenuation while the setting is on, so it fades out at 2500 units instead of 1250. No .wav file or demo is touched; default off. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… hint Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Combined in-game test of #1350, #1351 and #1352 Built from dev f628957 with all three branches merged locally. They merge with no conflicts. DLL:
Evidence is in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release note: New: "Hear headshots further away" (
ds_sound_headshot_far 1): a headshot's sound carries twice as far, without changing any sound file.What
goldsrc-hooks/src/headshot_sound.rs:ds_sound_headshot_far(default0). While on,player/helmet_hit.wavplays with half its attenuation (0.8 -> 0.4), so it fades out at 2500 units instead of 1250. Every other sound is untouched.fire_sounds'EV_PlaySoundhook asks it for the attenuation. The per-sound cost is one byte compare of the name the hook already reads; no lock.Commands.txt,Settings.resandconsole_commands_data.jsregenerated,docs/dodstudio_commands.md,goldsrc-hooks/README.md,console_prefix.rs's list of names with no olddodstudio_one.ds_debug_statuscounts the headshot sounds and how far away the last one was.How the sound arrives
Not from the server, so
ds_debug_log_server_soundsnever shows it. DoD'sclient.dllplays it from theevents/effects/bodydamage.schandler (client.dll+0xb790):EV_PlaySound(args->entindex, args->origin, CHAN_STATIC, "player/helmet_hit.wav", RandomFloat(0.92, 1.0), 0.8, 0, 100)whenbparam1is 0. (helmet.sc, the helmet flying off, plays no sound.)client.dllis byte-identical across installs and the hook sits on the event API table, so there is no per-build table; tested on both builds.A temporary log line in the hook (removed before this PR) showed every headshot sound going through the hook, with the event's entity being the player hit in 11 of 11 headshot kills checked against the analyzer's kill list.
Decisions
ktps8w9-stealth_gskill_rr2_h1are over 1000 units from the killer.0(ATTN_NONE) would play every headshot at full volume across the map. Volume can't go past 1.0 in the engine.helmet_hit.wavis the only headshot sound DoD plays.Test done
In game, PRE and POST,
ktps8w9-stealth_gskill_rr2_h1(POV),-addonswith the user's owndod_addonhelmet_hit.wav, HLAEmirv_movie_sound 1takes at the same moments with the setting at 0 and 1, levels found with a matched filter againsthelmet_hit.wav(0 dB = the file at full volume). Evidence and takes:D:\dodstudio-tests\helmet-hit-far\(measurements.txt).(The game varies each hit's volume by 0.7 dB. The near ear at 570 u reaches full scale with the user's boosted file, so that row gains a little less than the +3 dB the formula gives.)
cargo test -p goldsrc-hooks --target i686-pc-windows-msvc(1223 pass),cargo test -p native console_prefix, rustfmt and clippy-D warningson 1.98.1.npm run test:unit(only the generated data file changed on the JS side).Test DLL:
local\test-helmet-far\dodstudio_goldsrc_hooks.dll.🤖 Generated with Claude Code