Input: taps between two of the title's pad readings are lost at low frame rates (input latch, stick dead zone) #433

Open
opened 2026-11-27 18:03:53 +00:00 by github-bot · 10 comments
Owner

@⁠marcus-4 on GitHub · 2026-11-27 17:56 UTC · original

What is wrong

The title takes a pad's current reading once a frame (IGameInput::GetCurrentReading). At world frame rates here (about 0.5 fps on an M5 Pro, per the README's table), a press and release that fall between two of its readings are in our reading history but in no reading the title sees. Tapped actions (sprint, jump) do nothing; held prompts work. The same was seen and fixed on the Wine/D3DMetal route at 2 to 4 fps (halfwave50/VIctory-macOS-halfwave50 52e0325).

A related, smaller one: host stick values are raw. A stick at rest reads a few per cent off centre, and every wobble of it is a new reading.

Plan

Port halfwave50's two switches (GPL-3.0, credited), both off by default:

  • VICTORY_INPUT_LATCH=1: a button change the title has not seen yet waits for its next reading (up last time and down at any time since shows down; down last time and let go since shows up; pressed again too: down in the reading after). Triggers show their peak since the last reading, sticks their latest value. Readings within 15 ms agree; with no reading for 2 s the latch lets go.
  • VICTORY_STICK_DEADZONE=<share>: a round dead zone per stick, the rest of the travel spread over 0 to 1.

Hooks: the latch in State::poll for host pads and the keyboard's stand-in pad, hand-outs in current_reading and temporal_reading; the dead zone in Hub::poll before scripted keys are merged. Their Wine-only VICTORY_INPUT_REFOCUS is not needed here: window.rs releases keys when the window loses key status.

Tests: halfwave50's unit tests for the latch and dead zone, plus an end-to-end test through GetCurrentReading with the fake host (a tap between two readings is seen once; a held button in every reading). No game run yet.

**@⁠marcus-4** on GitHub · 2026-11-27 17:56 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429) **What is wrong** The title takes a pad's current reading once a frame (`IGameInput::GetCurrentReading`). At world frame rates here (about 0.5 fps on an M5 Pro, per the README's table), a press and release that fall between two of its readings are in our reading history but in no reading the title sees. Tapped actions (sprint, jump) do nothing; held prompts work. The same was seen and fixed on the Wine/D3DMetal route at 2 to 4 fps (halfwave50/VIctory-macOS-halfwave50 `52e0325`). A related, smaller one: host stick values are raw. A stick at rest reads a few per cent off centre, and every wobble of it is a new reading. **Plan** Port halfwave50's two switches (GPL-3.0, credited), both off by default: - `VICTORY_INPUT_LATCH=1`: a button change the title has not seen yet waits for its next reading (up last time and down at any time since shows down; down last time and let go since shows up; pressed again too: down in the reading after). Triggers show their peak since the last reading, sticks their latest value. Readings within 15 ms agree; with no reading for 2 s the latch lets go. - `VICTORY_STICK_DEADZONE=<share>`: a round dead zone per stick, the rest of the travel spread over 0 to 1. Hooks: the latch in `State::poll` for host pads and the keyboard's stand-in pad, hand-outs in `current_reading` and `temporal_reading`; the dead zone in `Hub::poll` before scripted keys are merged. Their Wine-only `VICTORY_INPUT_REFOCUS` is not needed here: `window.rs` releases keys when the window loses key status. Tests: halfwave50's unit tests for the latch and dead zone, plus an end-to-end test through `GetCurrentReading` with the fake host (a tap between two readings is seen once; a held button in every reading). No game run yet.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 18:03:53 +00:00
Author
Owner

@⁠marcus-4 on GitHub · 2026-11-27 17:57 UTC · original

/claim

**@⁠marcus-4** on GitHub · 2026-11-27 17:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7224959956) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-27 17:57 UTC · original

Claimed by @⁠marcus-4. Open a draft pull request with Refs #429 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-27 17:57 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7224962879) Claimed by @⁠marcus-4. Open a draft pull request with `Refs #429` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠marcus-4 on GitHub · 2026-11-28 08:19 UTC · original

/release

**@⁠marcus-4** on GitHub · 2026-11-28 08:19 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7236506999) /release
Author
Owner

@⁠marcus-4 on GitHub · 2026-11-28 08:25 UTC · original

/release

**@⁠marcus-4** on GitHub · 2026-11-28 08:25 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7236577612) /release
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 08:25 UTC · original

Released. This issue is free to claim.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 08:25 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7236579334) Released. This issue is free to claim.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 11:07 UTC · original

/claim

**@⁠AnastasisKon** on GitHub · 2026-11-28 11:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7238340437) /claim
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 11:07 UTC · original

Claimed by @⁠AnastasisKon. Open a draft pull request with Refs #429 in its description within 24 hours, or the claim expires.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 11:07 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7238342605) Claimed by @⁠AnastasisKon. Open a draft pull request with `Refs #429` in its description within 24 hours, or the claim expires.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:37 UTC · original

/release - done: PR #602 adds VICTORY_INPUT_LATCH and VICTORY_STICK_DEADZONE, both off by default and documented. Carried in my fork's main (69146296), gate green.

**@⁠AnastasisKon** on GitHub · 2026-11-28 12:37 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7239353934) /release - done: PR #602 adds `VICTORY_INPUT_LATCH` and `VICTORY_STICK_DEADZONE`, both off by default and documented. Carried in my fork's `main` (69146296), gate green.
Author
Owner

@⁠AnastasisKon on GitHub · 2026-11-28 12:43 UTC · original

/release - done: PR #602 adds VICTORY_INPUT_LATCH and VICTORY_STICK_DEADZONE, both off by default and documented. Carried in my fork's main (69146296), gate green.

**@⁠AnastasisKon** on GitHub · 2026-11-28 12:43 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7239420545) /release - done: PR #602 adds `VICTORY_INPUT_LATCH` and `VICTORY_STICK_DEADZONE`, both off by default and documented. Carried in my fork's `main` (69146296), gate green.
Author
Owner

@⁠github-actions[bot] on GitHub · 2026-11-28 12:43 UTC · original

Released. This issue is free to claim.

**@⁠github-actions[bot]** on GitHub · 2026-11-28 12:43 UTC · [original](https://github.com/LakshanSivakumar/Native-Victory-macOS/issues/429#issuecomment-7239422532) Released. This issue is free to claim.
This discussion has been locked. Commenting is limited to contributors.
No description provided.