Skip to content

R&D: ds_debug_log_gun_lowered, POV vs HLTV gun lowering timelines (#704) - #707

Merged
ccoventry merged 5 commits into
devfrom
rnd/gun-lowered-704
Oct 24, 2026
Merged

ccoventry merged 5 commits into
devfrom
rnd/gun-lowered-704

Conversation

@ccoventry

@ccoventry ccoventry commented Oct 11, 2026 •

Copy link
Copy Markdown
Owner

Release note: none

Part of #704.

A debug cvar, ds_debug_log_gun_lowered, logs every time the first-person gun goes down or comes back up, with the demo player's clock:

  • POV: from client.dll's g_ihidexhair, found by a pattern that is unique and the same on both installs;
  • HLTV in-eye: from ds_spec_match_pov's copy (spectator_gun), with anim_fix's reason (sprinting, prone transition, crawling, in the air, on a ladder).

Played over the same stretch of a POV demo and the HLTV demo of that half, the two lists line up. The findings are on #704: the two agree 94-96% of the time, with four kinds of difference. The jump one turned out to be the log's, not the game's (see the limit below), so no decision is needed there.

It's a measuring tool; the fixes it points at come in their own PRs (#767 for the mid-sprint bounce).

Tests: cargo test -p goldsrc-hooks passes, and clippy 1.98.1 (host and i686) is clean. Commands.txt and console_commands_data.js are updated.

After merging dev (#719), the name is ds_debug_log_gun_lowered, as the #555 table lists it. It has a row in docs/dodstudio_commands.md now and is listed in console_prefix's NEW_SINCE_555. All checks pass: hook tests (687), workspace tests, clippy (both targets), fmt and npm run test:unit. I rebuilt the test DLL into local\test-704b\. game_probe on PRE and POST played wsod25_grp2_h1_hltv from 1499 s, in-eye on player 13. Both logged gun_log: down at 1540.949 (spec 13: sprinting)-style lines and never logged could not find g_ihidexhair. Reports: local\game-probe\707-ds-pre\, 707-ds-post\.

Merged dev again (ready for review). The only conflicts were console_prefix.rs's NEW_SINCE_555 (kept both sides' names) and console_commands_data.js (regenerated with console_names.py, not hand-merged); lib.rs, commands.rs, Commands.txt and docs/dodstudio_commands.md merged cleanly. Checks: hook tests (736), native tests (769), clippy 1.98.1 on host and i686, fmt and npm run test:unit (779) all pass. The new test DLL is in local\test-707\.

The log's limit: in a POV demo it reads client.dll's own lowering sum (g_ihidexhair), not the gun that is drawn, so it misses POV's lowering on a jump or a crouch-jump. That is what made the first finding ("POV never lowers for a jump") wrong; see the correction on #704. Treat a POV-vs-HLTV difference it reports as a lead to check against the drawn frames. The cvar's docs row, its Commands.txt line and gun_log.rs's module doc now say so.

🤖 Generated with Claude Code

…oes down and up (#704)

Each change is logged with the demo player's clock: in a POV demo from
client.dll's g_ihidexhair (set by DoDGunGoOnOffScreen every frame), in an
HLTV demo's in-eye view from dodstudio_spec_match_pov's copy, with the
reason anim_fix lowered it (sprinting, prone transition, crawling, in the
air, on a ladder). Played over the same stretch of a POV demo and the HLTV
demo of that half, the two lists line up to show where the copy differs.

Part of #704.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
After #719 the R&D cvar is ds_debug_log_gun_lowered (the #555 table).
lib.rs keeps dev's module list with gun_log in order; Commands.txt takes
dev's side with the entry re-added; docs/dodstudio_commands.md gets the
row it never had; console_commands_data.js regenerated; the name is
listed in console_prefix's NEW_SINCE_555.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccoventry ccoventry changed the title R&D: dodstudio_debug_log_gun_lowered, POV vs HLTV gun lowering timelines (#704) R&D: ds_debug_log_gun_lowered, POV vs HLTV gun lowering timelines (#704) Oct 21, 2026
@ccoventry

Copy link
Copy Markdown
Owner Author

Merged dev in (after #719) at 16085259.

  • The cvar is now ds_debug_log_gun_lowered, the name the Rename the in-game commands: area as the second word (spec_, hud_, world_...), and a shorter prefix #555 table gives it. The code's suffix already matched; I updated the comments and the PR title.
  • Conflicts: lib.rs keeps dev's module list, with gun_log added in order. Commands.txt keeps dev's side, with the entry re-added under DEBUG. console_commands_data.js is regenerated.
  • docs/dodstudio_commands.md had no row for this cvar, so I added one.
  • It never shipped, so it gets no old_names.rs entry. It is listed in console_prefix's NEW_SINCE_555.
  • Local checks: fmt, clippy 1.98.1 (workspace and i686), hook tests (687), workspace tests, npm run test:unit: all pass.
  • Test DLL rebuilt: local\test-704b\dodstudio_goldsrc_hooks.dll.
  • game_probe re-run on PRE and POST: wsod25_grp2_h1_hltv from 1499 s, in-eye on player 13, logging on for 45 s. Both logged lines like gun_log: down at 1540.949 (spec 13: sprinting) / up at .... Neither logged could not find g_ihidexhair. Both PASS (local\game-probe\707-ds-pre\, 707-ds-post\).
  • If While a demo loads, the demo player bar shows how far along it is (#465) #758 or R&D: a restyled health readout drawn by the hook (part of #849) #882 merges first, this PR's NEW_SINCE_555 line will conflict with theirs. Keep both names in the list.

🤖 Generated with Claude Code

Conflicts: console_prefix.rs's NEW_SINCE_555 keeps both sides' names;
console_commands_data.js is regenerated with console_names.py.

The cvar's docs row, Commands.txt line and gun_log.rs module doc now say
that in a POV demo it reads client.dll's own lowering sum, not the drawn
gun, so it misses jump and crouch-jump lowering (#704).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccoventry
ccoventry marked this pull request as ready for review October 23, 2026 23:17
console_commands_data.js regenerated with console_names.py after #962.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
console_commands_data.js regenerated with console_names.py after #986.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ccoventry
ccoventry merged commit b0984b7 into dev Oct 24, 2026
5 checks passed
@ccoventry
ccoventry deleted the rnd/gun-lowered-704 branch October 24, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant