gameinput: add opt-in periodic combined-pad reports #179
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!179
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-179"
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?
@DecayingEagle on GitHub · 2026-12-02 11:28 UTC · original
DecayingEagle:codex/periodic-combined-pad-reports→main· +80 −1 · 3 files · 1 commits · draftAdds an off-by-default compatibility option for unchanged combined-gamepad readings:
With the option enabled, the combined pad receives a fresh immutable reading at the chosen interval even when its state has not changed. State changes and releases still publish immediately. The default (
0/unset), individual host-pad slots, keyboard readings and device connection callbacks keep their existing behavior. Intervals are bounded to 1000 ms.Motivation: automated testing with an evdev virtual Xbox 360 pad on Wine 11.22 reproduced very little camera movement during long constant stick holds. XInput probing confirmed full stick values and correct button masks. Varying the right-stick value by 32/32767 every 15 ms restored continuous movement; enabling periodic combined-pad reports allowed constant holds to move continuously without that variation. This is a compatibility experiment based on that reproduction, not a claim that every GameInput device requires periodic duplicate readings.
Validation:
modules::gameinput::testspassed under Wine, including the new deterministic COM-reading regression. It checks the interval boundary, sequence/timestamp advancement, preserved held state, immutable older readings, GetNextReading traversal, and immediate release.VICTORY_NATIVE_INPUT=0 VICTORY_PC_CONTROLS=0 VICTORY_KBM_PC=0; the live native keyboard bridge otherwise replaces their fake keyboard/mouse values on Windows.git diff --checkpassed.Only a virtual Xbox pad under Wine has been checked for this option. Physical controllers and Windows need independent testing; the option remains disabled by default.
AI assistance: Codex investigated, implemented and tested this change on the hardware above.
@DecayingEagle on GitHub · 2026-12-02 11:36 UTC · original
Follow-up: the opt-in mode completed an 8-minute monitored gameplay/menu run with steady virtual-pad inputs and no input dither. No runtime fault, device loss, kernel GPU reset/timeout or frame-stat stall was recorded. The menu was entered, navigated and exited back into the world. This remains a virtual-Xbox-under-Wine result; I left the option disabled in the normal local launch pending physical-controller testing.
Separately,
VICTORY_UI_PLANE=3840x2160corrected the controller-settings overlap at 2560×1440 output; this uses the existing compositor and is not a change in this PR. The title's GPU rendering stayed at native 1440p FSR 4 Native AA.@Kal0s-design on GitHub · 2026-12-03 20:40 UTC · original
I had a look at this on native Windows (msvc target, not Wine), merged locally onto current main
0b652f8. Short version, the code change is small and looks safe, the conflicts are only in the docs.Merge.
git merge-treeagainst main reports conflicts in README.md and run.conf.default only, gameinput.rs merges cleanly. The README settings table this adds a row to has since moved to docs/SETTINGS.md, and run.conf.default now carries# group:,# label:and# choices:lines that the menu reads, so the new entry probably wants a label and a place in a group. One more doc thing,VICTORY_ONE_PADis now on unless it's0(parse_one_pad), so after a rebaseVICTORY_PAD_REPORT_MSalone turns this on and the "Requires VICTORY_ONE_PAD=1" wording in the README row and run.conf.default would be out of date.Switched off. With the variable unset or 0,
pad_report_usis 0, the extra clause inupdate()is false, and the condition is the same as before. With one-pad off it's forced to 0 too, so separate host pads and the keyboard device can't be touched by it. I don't see any way for the default path to change.Timing. There's no new thread or timer, the check runs inside the existing 8 ms poll, so there's nothing to start, stop or tear down on disconnect. The FALLBACK slot never disconnects in one-pad mode anyway, and the new clause sits inside
if let Some(value), so a disconnected slot gets no report. Everything runs under the state mutex like the rest ofupdate(). One consequence is that the interval snaps to poll ticks, so any value from 1 to 8 means every poll and 10 means every other poll. That might be worth saying in the docs, or clamping the lower bound to the poll period. I timedstd::thread::sleep(8 ms)on this machine and it lands around 8.0 to 9.1 ms, so the coarse 15.6 ms Windows timer isn't in play and 8 does give a report each poll.Other bits I checked. Old readings are refcounted, so when history (256 deep) rolls over at about 2 s of held input, readings the title still holds stay valid, and your test covers the immutability. On Windows with mouse controls on,
GetCurrentReadingalso callsupdate()for FALLBACK when the per-frame mouse sample differs. That path only fires on a real change, so the new clause doesn't affect it, and a sampled reading just restarts the interval. Thecfg!(test)inHub::newworks but puts test knowledge in the constructor. Reading the variable in a small helper the wayone_pad()does would keep that out, but it's minor.Tests. On the merged tree
cargo test -p victory-hle --libgives 158 passed, 3 failed, 1 ignored. The newheld_one_pad_gets_periodic_readings_without_changing_its_statepasses, three runs out of three. The 3 failures are the same ones main has on Windows (keys_feed_the_keyboard_and_the_stand_in_pad,a_host_pad_feeds_the_one_pad_which_never_goes,pc_kbm_maps_pc_style_keys_and_smooths_mouse_look), same asserts, just shifted down by the lines this adds. They come from native input being on by default, which is what you worked around withVICTORY_NATIVE_INPUT=0, so this PR doesn't change them either way. With that variable set all 25 gameinput tests pass. Clippy on victory-hle with all targets shows the same warnings as main, nothing new.I haven't tried the option with a real controller on Windows, so I can't say anything about the motivating behaviour, only that the plumbing looks right.
AI-assisted: yes
@Luxuride on GitHub · 2026-12-04 12:01 UTC · original
This is a guess about a title behaviour with no measurement behind it, and an off-by-default guess costs the maintainer a documented switch each. Nothing here shows a title that discards stale held readings; the test proves the mechanism works, not that anything improves.
If you keep it:
VICTORY_PAD_REPORT_MSgets four lines at the end ofrun.conf.defaultwith no# label:, so the F1 menu shows an unnamed row, and there is nodocs/SETTINGS.mdrow.README.md:52also crams two switches into one row (VICTORY_ONE_PAD=1 VICTORY_PAD_REPORT_MS=8), which reads as one variable.gameinput.rs:66-67), so anything walking back further sees a much shallower past than before. Worth a sentence.No defect found in the code:
pad_report_usis parsed once at Hub construction and the FALLBACK slot'supdate()is genuinely called every poll, so the branch is reachable.Park it until you can show the dropped-input title; with that reproduction and one switch it becomes a ten-line review.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.