Repository navigation
Capture: after Studio closes or crashes mid-batch, it offers to capture the clips the game never got to (#20, part of #545) - #1171
Conversation
…d hold Start while the old batch may still run (#20) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…autosave.json removal, document recovery (#20) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…isk (#20) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t counted as captured (#20) The game and HLAE stop the video and sound.wav at the same moment, so the video-vs-audio check can't see it; the wav's data size left unset can. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The offer can come at any time, when the old batch's game closes. A second themedConfirm replaces the open one and its caller never hears back, so the offer waits until no dialog is open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review (review-night)Verdict: ready to merge, now that f3e8b11 is pushed. I found no false positives on good takes. One dialog collision is fixed.
|
Release note: New: if DoD Studio closed or crashed during a capture batch and the game didn't finish it, Studio offers to capture the clips that are missing the next time it opens.
Closes #20
Part of #545 (part 2's catch-up is finished here; part 4, the dev-build job object, is still open).
What changes
#760 already caught up on a batch that ran while Studio was closed: the batch's manifest (
manifests\session_*.json, outcomeplanned) records each highlight's id, its demo and the project, and the next start checks the takes and marks them Captured. This PR adds the parts that were still missing.Clips the batch never got to. When the game closed or crashed before the end, some clips have no take. After the catch-up, Studio asks once:
(With nothing on disk: "...while DoD Studio was closed, and none of its 4 clips are on disk.")
Capture them now opens the batch's project (the unsaved-changes prompt first, if another one is open), ticks only the missing highlights, and runs Start Capture Batch with all its usual checks.
A half-recorded clip is no longer counted as captured. When the game is killed mid-clip, HLAE stops the video and
sound.wavat the same moment. A take that FFmpeg stops writing mid-clip still counts as a full capture #1105's video-vs-sound check can't see that, and the catch-up has no markers to go by, so the partial take used to count as Captured and was never offered again. HLAE fills in the wav'sdatasize when a recording stops, so a size still unset over real sound means the clip never finished. Such a take is now "cut short when the game closed", left on disk and offered for capture. A watched batch already tells partial takes apart from its markers (A clip recording when the game closes is no longer marked Captured; Last Batch says the game closed (part of #1081, #1105) #1124).While the game may still be capturing. When Studio reopens with the game still open, it waits for the game to close before it checks (as before), and now says so with a toast: "The game may still be capturing a batch from before DoD Studio closed. Studio checks its clips and marks them Captured once the game closes." Until then, Start Capture Batch refuses with: "Not started: the game may still be capturing a batch from before DoD Studio closed. Wait for the game to close, or close it, and start again." Without the refusal, a new batch would run in that open game (Start Capture Batch runs in the game that is already open instead of relaunching it (#725) #1075) and stop the old one.
Tidy-up. The stray
.autosave.jsonremoval incapture_engine.rsgoes (nothing ever wrote that file; the manifest is the recovery record), anddocs/features.mddescribes recovery (3.5) and the manifest's outcomes (section 9).Where
studio/src/batch_resume.js(new) + tests: which highlights have no take, ticking just those, the question and the start.studio/src/batch_catch_up.js: the waiting state (isBatchStillRunningInGame), the toast, the offer after the newest unfinished batch.studio/src/capture_pane.js: the refusal as the first check of Start Capture Batch, andstartCaptureFromOffer(the Start button's click, every check included).studio/src-tauri/src/batch_catch_up.rs: unfinished takes; the end-of-wait event is sent even when it found nothing, so the refusal always lifts.native/src/hlcr/take_length.rs:is_unfinished_take; the wav header parsing is shared withwav_seconds.main.js: two arguments on the existing catch-up wiring.Decisions
.autosave.jsonlockfile. The planned manifest already is one: it is written before the game starts, it lists every clip with its highlight ids and project, and it is rewritten when the batch ends. A second file would only repeat it. ([Capture Studio] Autosave lockfile recovery #20 asked for the lockfile; the owner's 2026-09-28 note said recovery means resending the rest of the schedule, which this does.)BATCH_COMPLETE, so the game would no longer quit itself (A batch in a game that's already open links up to the game at once, not at its first marker #1126), and the live progress state (block correlation, markers, ETA) was in the Studio that closed. The hook ends the game about 5 s after the batch, so the marks come at most a few seconds later than a reconnect would give.hl.exe, including one the user started themselves.sound.wav. OBS and AGR takes have none, so a killed-game partial take there still counts as captured (as before).Test done
rustup run 1.98.1 cargo fmt --all --check: clean. Clippy (1.98.1, workspace minus goldsrc-hooks and web-analyzer,--all-targets -D warnings): clean.cargo test --workspace --locked --exclude goldsrc-hooks --exclude web-analyzerafter merging dev: all pass (desktop-studio 289, native 1035; new: 3 intake_length, 1 inbatch_catch_up).npm run test:unit: 1114 passed (new: 11 inbatch_resume.test.js, 5 inbatch_catch_up.test.js;main_js_budgetpasses). Playwrightapp-boot.spec.js+batch-results.spec.js: 13 passed.DS_LIVE_APPDATA, never committed; the user'ssettings.jsonhasha6fa3173794f9c2fbefore and after). Direct to video, 1280x720 at 120 fps, Seek Between Clips, hook DLL built from dev. Four 3k highlights (BAR 13:09, 14:17, 16:47, 29:23) fromwsod25_grp5_h1_m00cat.demon D:.BATCH_COMPLETE(hook logbatch_end ... quitting the game); 1 s later: "4 of 4 clips are on disk. 4 highlight(s) marked Captured. Marked them in the project run1.dodstudio." The project file on disk: the 4 highlights Captured, the 4 takes in its take index. Start no longer refused.Also checked with a hand-made planned manifest whose takes don't exist: "none of its ... clips" wording, and Not now leaves everything as it was (manifest rewritten
unwatched, so it isn't asked again).Not tested: PRE (no hook or engine change here), OBS/AGR takes, a batch with no project file, the "Capture them now" path when another project with unsaved changes is open (it goes through Open Recent's own prompt).
Notes
dodstudio-analyzerpipe, so one Studio answered another one's game ("Analysis server: the game asked for ...").🤖 Generated with Claude Code