Repository navigation
Demo loading progress fills all the way on a demo with a map restart (#866) - #875
Merged
Merged
Conversation
… a demo with a map restart The demo player's clock is svc_time, and viewdemo stops loading where it turns back at a map restart; the progress divided by the directory's whole playback time, so on solifotw-bewton it ended at about half. A background thread now reads the svc_time span the player will hold (first network frame to the first backwards jump), and the percent divides by that; the directory's estimate stands until it answers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Owner
Author
|
Merged
🤖 Generated with Claude Code |
Owner
Author
|
Brought up to date with dev (unattended pass). Head
In game. DLL
🤖 Generated with Claude Code |
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: Fixed: the demo loading progress in the game fills all the way on a demo that recorded a map restart, instead of disappearing at about half.
Closes #866
Cause
The demo player's clock is
svc_time, and viewdemo stops loading where that clock turns back at a map restart (it only plays a demo's first map). The progress divided the player's span by the directory's whole playback time, less the LOADING lead-in (#810). Onsolifotw-bewtonthe player holds 4.30 → 1956.38 s, against 2,996 s in the directory, so the bar went away at about 53%. Measured with an R&D build; the numbers are on #866.Change
demo_file::loaded_span: walks every frame header and returns thesvc_timespan from the first network frame to the first backwards jump. It reads the file through a 1 MBBufReaderwithseek_relative, so the buffer survives the skips.load_progress: runs it on a background thread when a demo starts loading.load_percentthen divides the player's span by it, the same clock with no lead-in. Until the thread answers, the directory's estimate stands.try_lock.Tests
New unit tests:
the_loaded_span_ends_where_the_server_clock_turns_back(a built demo file with a restart) andwith_the_loaded_span_the_percent_is_the_players_span_over_it.cargo test -p goldsrc-hooks --target i686-pc-windows-msvc: 678 passed.Clippy 1.98.1
-D warningsis clean, both i686 and host. fmt is clean.In game (game_probe, Brain account, DLL
local\test-866\, the Playback tab's 10% log lines):POST,
solifotw-bewton(the restart demo): 18, 20, 30 … 90%, then loaded. It used to stop at 50%.POST,
solifotw-bud(no restart): 11, 20 … 90%, then loaded.PRE,
wsod25_grp2_h1_hltv: 10 … 90%, then loaded.Re-run after merging dev (In-game commands get shorter names grouped by what they change: ds_hud_hide_scoreboard and so on (#555) #719),
solifotw-bewtonon PRE and POST, DLL rebuilt intolocal\test-866\: 0, 17/18, 20 … 90%, then loaded on both. Reports:local\game-probe\875-ds-pre\,875-ds-post\. After the merge: hook tests (689), workspace tests, clippy (both targets), fmt andnpm run test:unitpass.On the restart demo the first line is 18%: the directory's estimate showed until the file walk answered, about 3 s into the load.
🤖 Generated with Claude Code