Diagnostics: script gamepad input by frame (VICTORY_SCRIPTED_INPUT) #3293
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3293
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3293"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@neonbyte1 on GitHub · 2026-11-26 16:12 UTC · original
neonbyte1:pr/scripted-input→main· +315 −5 · 3 files · 2 commits · openA diagnostics switch that plays a scripted gamepad timeline, so a headless run can move the character without a real controller or window focus:
Each entry sets the pad from that presented frame until the next entry. It's keyed on the frame token that
victory_gpu::framepresent logs show. The states:fwd,back,left,right;look_*;lt,rt;a/b/x/y,menu,view,lb/rb/ls/rs, and the d-pad (du/dd/dl/dr);offreleases everything.States combine with
+(fwd+look_right). The script overlays a connected pad, or the keyboard stand-in pad when none is connected.How it relates to
VICTORY_KEYS:VICTORY_KEYS(and #3239's holds and repeats) is timed in seconds and goes through the keyboard path. This one is timed in presented frames and sets pad state directly. At about one frame per second, wall-clock timing lands at different points of the game from run to run, while frame-keyed timing is repeatable. The README row says so next toVICTORY_KEYS.Changes:
gameinput.rs: the parser, the timeline lookup, and the overlay in the poll, plus three unit tests: parsing, segment lookup, and the overlaid reading.frame.rs: a diagnostics-only accessor for the frame number.README.md: one row next toVICTORY_KEYS.All of it is behind
diagnostics; when the variable is unset, nothing changes.In game (GTA VI on Linux, RTX 5090, GE-Proton11-14, headless gamescope,
mainplus the PRs needed on that setup):Tested: the
gameinputtests pass undercargo xtask wine-test(#1218), 13/13, with and withoutdiagnostics. Clippy-D warningsandcargo xtask policyare clean. Not run on native Windows.AI-assisted (Claude); measured on my machine, no game data shared.
@AurumCarlos on GitHub · 2026-11-26 16:15 UTC · original · reviewed
Frame-keyed timing is a good complement to
VICTORY_KEYS, and thediagnosticsforwarding tovictory-gpuis already there, soframe::number()resolves.One trap: unknown tokens are ignored but the entry is still kept, so a typo'd entry (
1800:fwrd,look_rigth) becomes a neutral pad and silently acts likeofffrom that frame on. In an unattended run that looks like the character just stopped. Awarn!naming the token (once, at parse time) would make that obvious; andscripted_input_timeline_holds_the_last_statecould pin it.@neonbyte1 on GitHub · 2026-11-26 16:43 UTC · original
@AurumCarlos good catch, thanks. Fixed in
56dcd63. An entry with an unknown token is now dropped whole, so the last valid state stays active, and the parser warns once per bad token with the entry text (unknown scripted input token; entry ignored).I chose dropping the whole entry over keeping the recognised tokens: applying
fwdfromfwd+boguswould invent a state the script never asked for, and a lone typo would still look likeoff.The timeline test now includes
40:fwd+bogusand50:look_rigth, and checks that the previous state (back) is still active at frame 49. A second test checks that a bad token is reported once. Thegameinputtests pass under Wine (14/14), and clippy, policy and formatting are clean.AI-assisted (Claude); measured on my machine, no game data shared.
@AurumCarlos on GitHub · 2026-11-26 16:47 UTC · original · reviewed
56dcd63resolves it: dropping the whole entry keeps the last valid state, and the warning names the token and the entry once. The two tests cover both. LGTM.Tiny edge, no change needed: a trailing
+(1500:fwd+) now yields an empty token, so that entry is dropped with a warning for"". That's the right outcome, just a slightly cryptic message.@neonbyte1 on GitHub · 2026-11-26 16:49 UTC · original
@AurumCarlos thanks for re-checking. Agreed on
1500:fwd+: dropping it is the right outcome, and the""in the warning is cryptic. I'll leave it as is unless a maintainer would like the message to say "empty token" explicitly; that's a one-line change.AI-assisted (Claude); no game data shared.
@cloph-dsp on GitHub · 2026-11-26 16:50 UTC · original
Independent Windows verification of PR #3293 (head
56dcd63).CARGO_TARGET_DIR=D:\Victory-Contrib\target-3293,CARGO_BUILD_JOBS=2.cargo test --locked -p victory-hle --lib -- --exact modules::gameinput::tests::scripted_input_timeline_holds_the_last_state modules::gameinput::tests::scripted_pad_reaches_the_stand_in_reading modules::gameinput::tests::scripted_pad_overlays_a_host_pad3 passed; 0 failed; 153 filtered out, exit 0.git diff --check origin/main HEADclean.63bcca43(synthetic tests are added by this PR).@Dukestar69 on GitHub · 2026-11-26 17:32 UTC · original · approved these changes
Reviewed and verified locally on Windows 11 x64:
VICTORY_SCRIPTED_INPUTcleanly drives frame-indexed gamepad state timelines over both stand-in and connected host pads without affecting normal input when unset.cargo test -p victory-hle --lib modules::gameinput:: -- --test-threads=1: 14 passed, 0 failed (includingscripted_input_timeline_holds_the_last_state,scripted_input_warns_once_per_unknown_token,scripted_pad_overlays_a_host_pad, andscripted_pad_reaches_the_stand_in_reading).cargo clippy -p victory-gpu -p victory-hle --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu -p victory-hle --features diagnostics --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.