HLE: a mouse device, so the camera follows the mouse #9

Merged
superboynick merged 1 commit from upstream-pr/9 into main 2026-11-26 18:50:57 +00:00
superboynick commented 2026-11-26 18:37:05 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by superboynick on 2026-11-26T18:37:05Z.


GameInput in this layer offers four XInput pads, a stand-in pad driven by the keyboard, and the keyboard - but no mouse. The title polls GameInput for mouse movement, reads nothing, and the camera never turns while the keyboard works. Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11.

What this adds. A mouse device that reports position deltas taken from the host cursor inside our own window, plus the three buttons. It exists only while our window is in the foreground (GetForegroundWindow is our process) and goes away with a disconnect callback when focus leaves, so moving the pointer elsewhere does not spin the camera. Wheel rotation is not reported: GetAsyncKeyState cannot see it, and that is written in the commit.

Switch. VICTORY_GAMEPAD_MOUSE=0 leaves the device out entirely, which is what the layer did before; default is on.

Evidence. In a run with the window in front the device appears (input device device=6 kind=32 connected=true) and does not appear while another window has focus; a 240-second run with it showed no change in frame rate (the poll is every 8 ms) and no errors.

Tests. cargo test -p victory-hle: 153 passed, 2 ignored. Four new unit tests cover the first frame (zero delta), clamping outside the client area, negative deltas, and the focus-loss reset. Both cargo build --release -p victory and cargo build --profile diag -p victory --features diagnostics build.

Written with an AI assistant.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5515384335 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-26T18:37:05Z. --- GameInput in this layer offers four XInput pads, a stand-in pad driven by the keyboard, and the keyboard - but no mouse. The title polls GameInput for mouse movement, reads nothing, and the camera never turns while the keyboard works. Measured on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), Windows 11. **What this adds.** A mouse device that reports position deltas taken from the host cursor inside our own window, plus the three buttons. It exists only while our window is in the foreground (GetForegroundWindow is our process) and goes away with a disconnect callback when focus leaves, so moving the pointer elsewhere does not spin the camera. Wheel rotation is not reported: GetAsyncKeyState cannot see it, and that is written in the commit. **Switch.** VICTORY_GAMEPAD_MOUSE=0 leaves the device out entirely, which is what the layer did before; default is on. **Evidence.** In a run with the window in front the device appears (input device device=6 kind=32 connected=true) and does not appear while another window has focus; a 240-second run with it showed no change in frame rate (the poll is every 8 ms) and no errors. **Tests.** cargo test -p victory-hle: 153 passed, 2 ignored. Four new unit tests cover the first frame (zero delta), clamping outside the client area, negative deltas, and the focus-loss reset. Both cargo build --release -p victory and cargo build --profile diag -p victory --features diagnostics build. Written with an AI assistant.
superboynick commented 2026-11-26 18:46:53 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by superboynick on 2026-11-26T18:46:53Z.


Separate observation from the same runs: texture re-uploads and skin corruption

Issues are disabled on this repository, so I am putting this here rather than in a new issue; move or
discard it as you see fit. Everything below is from this branch at 0ef2b99 (plus this PR's mouse
device), diagnostics build, the play-nvidia speed set plus VICTORY_RENDER_SCALE=0.4,
VICTORY_TEXTURE_ROOM_PERCENT=70, VICTORY_WINDOWS_BAR_MB=1024, on an RTX 5070 Ti Laptop (12 GB,
32-lane waves), 31.4 GB RAM, Windows 11, Series 1.0.2.1.

The picture is correct (no fog, no black spots) and the world runs at about 9.2-9.8 fps for 30-45
minutes without a crash. What remains is occasional texture/skin corruption: a character's skin
sometimes shows as rainbow-coloured or pixelated bands for a moment.

One 160-second window, counted by message (VICTORY_LOG=warn), with the one switch changed:

VICTORY_TEXTURE_NO_WAIT fps in the world (draws > 3000) a texture picked by index changed after its upload with nothing to tell of it placed unordered texture view not mirrored
1 (the speed set) 7.6 88 10
0 6.2 39 13

Waiting for the remapping cuts that message by 56% and costs about 18% of the frame rate, which
matches the README's own explanation for "rainbow, pixelated skin" - and also shows that waiting is
not the whole story, since 39 lines remain.

Two smaller things from the same logs, in case they are useful: placed unordered texture view not mirrored (null: writes through it are lost) for a dozen placed 2D textures, with times reaching
2048, so at least that many bindings land on a null slot; and 29 lines of a pipeline creation method that is not implemented: the title goes without this pipeline shape.

Full log excerpt with byte-exact lines and file:line for each message is available on request; it
is long, so I left it out of this comment.

Written with an AI assistant.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7200843932 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9#issuecomment-7200843932). Originally posted by [superboynick](https://github.com/superboynick) on 2026-11-26T18:46:53Z. --- ### Separate observation from the same runs: texture re-uploads and skin corruption Issues are disabled on this repository, so I am putting this here rather than in a new issue; move or discard it as you see fit. Everything below is from this branch at `0ef2b99` (plus this PR's mouse device), diagnostics build, the `play-nvidia` speed set plus `VICTORY_RENDER_SCALE=0.4`, `VICTORY_TEXTURE_ROOM_PERCENT=70`, `VICTORY_WINDOWS_BAR_MB=1024`, on an RTX 5070 Ti Laptop (12 GB, 32-lane waves), 31.4 GB RAM, Windows 11, Series 1.0.2.1. The picture is correct (no fog, no black spots) and the world runs at about 9.2-9.8 fps for 30-45 minutes without a crash. What remains is occasional texture/skin corruption: a character's skin sometimes shows as rainbow-coloured or pixelated bands for a moment. One 160-second window, counted by message (`VICTORY_LOG=warn`), with the one switch changed: | `VICTORY_TEXTURE_NO_WAIT` | fps in the world (draws > 3000) | `a texture picked by index changed after its upload with nothing to tell of it` | `placed unordered texture view not mirrored` | |---|---:|---:|---:| | `1` (the speed set) | 7.6 | **88** | 10 | | `0` | 6.2 | **39** | 13 | Waiting for the remapping cuts that message by 56% and costs about 18% of the frame rate, which matches the README's own explanation for "rainbow, pixelated skin" - and also shows that waiting is not the whole story, since 39 lines remain. Two smaller things from the same logs, in case they are useful: `placed unordered texture view not mirrored (null: writes through it are lost)` for a dozen placed 2D textures, with `times` reaching 2048, so at least that many bindings land on a null slot; and 29 lines of `a pipeline creation method that is not implemented: the title goes without this pipeline shape`. Full log excerpt with byte-exact lines and `file:line` for each message is available on request; it is long, so I left it out of this comment. Written with an AI assistant.
ardgndg commented 2026-11-27 20:28:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ardgndg on 2026-11-27T20:28:24Z.


doesn't work when I enable mouse capture through f1

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7227539365 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/9#issuecomment-7227539365). Originally posted by [ardgndg](https://github.com/ardgndg) on 2026-11-27T20:28:24Z. --- doesn't work when I enable mouse capture through f1
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!9
No description provided.