Native 1:1 mouse aiming, vehicle controls, pre-launch DLSS warm-up, and portable launcher #1356

Closed
lyufeng000 wants to merge 1 commit from upstream-pr/1356 into main
lyufeng000 commented 2026-11-28 17:56:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by lyufeng000 on 2026-11-28T17:56:02Z.


Summary

Tested on AMD Ryzen 9 9950X (16C/32T) + NVIDIA GeForce RTX 4090 24 GB (driver 621.14) + 32 GB RAM + Windows 11 Build 26300 against retail Xbox Series X build 1.0.2.1 (b99f876b...).

This PR brings four quality-of-life & input improvements plus hardware notes and docs:

  1. Native 1:1 Mouse Aiming & Automatic Menu Cursor Release (VICTORY_NATIVE_MOUSE=1 by default)

    • Adds victory-loader::callhook (using tls::near rel32-reachable trampolines) and victory-hle::mousehook hooking look_pull_140e4e3d0 (0x140e4e3d0, verified 8-byte prologue) to inject raw mouse deltas directly as 1:1 camera radians with native ADS/zoom scaling ([block + 0x30/0x34]).
    • Automatically releases and restores IDC_ARROW on Pause, Map, Shop/Modal UI, F1 overlay, or focus loss; click-in recaptures with LMB swallow to prevent misfires.
    • Live hotkeys: [ / ] adjust sensitivity by ±15%, F9 toggles capture override, F8 toggles vehicle auto-center bypass.
    • Preserves VICTORY_NATIVE_MOUSE, VICTORY_MOUSE_SENS, VICTORY_MOUSE_INVERT_Y, VICTORY_WHEEL_SENS, VICTORY_WHEEL_SCROLL_INVERT, and VICTORY_VEHICLE_AUTO_CENTER across victory play restarts (KEPT in apps/victory/src/play.rs). Setting VICTORY_NATIVE_MOUSE=0 falls back cleanly to upstream VICTORY_MOUSE_CAPTURE.
  2. Radial Weapon Wheel Mouse Selection & Vehicle Controls

    • Suppresses camera injection while hud_quick_select (0x2c790e9c) is open; raw mouse deltas drive a sticky unit-disk virtual right stick, and mouse wheel notches cycle sub-slots via RT / LT trigger pulses (PreRelease -> Pulse -> Gap) reliable at 15–25 FPS.
    • Pure-memory vehicle seat detection (None / Driver / AircraftPilot / Passenger) splits non-aircraft driving (W = RT throttle, S = LT brake/reverse, LShift/LCtrl = bike/boat pitch, RMB/LMB = LB/RB when wheel closed) from on-foot & aircraft controls.
    • Redirects camFollowAutoCenter::Update (0x007c_5ee1 -> 0x00b6_9900) on normal frames in vehicles to bypass auto-centering cleanly without spring snap-back; live-toggleable via F8 or F1 > VEHICLE AUTO-CENTER (VICTORY_VEHICLE_AUTO_CENTER).
  3. Pre-Launch Invisible DLSS / Frame Generation Warm-up (victory dlss-warmup)

    • Replaces the jarring in-game 10 s auto-restart on first launch of a new build with a brief pre-launch subprocess (victory dlss-warmup --output <WxH> --frames 24) using a hidden 1x1 unfocused tool window (host::set_hidden_window(true)) and clean slShutdown teardown.
    • Controlled via --dlss-warmup, --no-dlss-warmup, and VICTORY_DLSS_WARMUP (0 / force); honors legacy warm-up marks under %LOCALAPPDATA%\victory\warmed.
  4. Portable Start-GTA6.bat Launcher, Asset Policy & Docs

    • Adds a path-agnostic Start-GTA6.bat launcher (zero hardcoded local paths) that checks VICTORY_GAME_DIR -> %VICTORY_HOME%\game_dir.txt / %LOCALAPPDATA%\victory\game_dir.txt -> read-only %~dp0game_dir.txt, and interactively prompts & persists the game folder outside the repository on first run.
    • Adds "bat" to ALLOWED_EXTENSIONS in xtask/src/policy.rs (with unit test).
    • Updates README.md, docs/architecture.md, and adds docs/notes-9950x-4090.md documenting measurements, observed issues, RVAs, and branch changes.

Verification

  • cargo xtask policy: passed (asset policy: 298 files ok)
  • cargo clippy -p victory-hle -p victory-loader -p victory -p xtask --all-targets --locked & --all-features --locked: 0 warnings across all modified crates (unrelated pre-existing warnings in victory-gpu/src/{shadow.rs,descriptor.rs} left untouched)
  • cargo test -p victory-loader -p victory-hle -p victory -p xtask --locked: all passed (victory 28+2, victory-hle 202+1 / 3 ignored, victory-loader 48+3, xtask 6)
  • Start-GTA6.bat verified in cmd.exe with isolated VICTORY_HOME (prompt, invalid-path retry, persistence, auto-load on second run, drag-and-drop exe path, --help passthrough)
  • Live gameplay tested on Ryzen 9 9950X + RTX 4090 (4k + DLSS Quality Preset K + 2x FG, >8,750 DLSS frames)
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5543044721 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356). Originally posted by [lyufeng000](https://github.com/lyufeng000) on 2026-11-28T17:56:02Z. --- ## Summary Tested on **AMD Ryzen 9 9950X (16C/32T) + NVIDIA GeForce RTX 4090 24 GB (driver 621.14) + 32 GB RAM + Windows 11 Build 26300** against retail Xbox Series X build `1.0.2.1` (`b99f876b...`). This PR brings four quality-of-life & input improvements plus hardware notes and docs: 1. **Native 1:1 Mouse Aiming & Automatic Menu Cursor Release (`VICTORY_NATIVE_MOUSE=1` by default)** - Adds `victory-loader::callhook` (using `tls::near` `rel32`-reachable trampolines) and `victory-hle::mousehook` hooking `look_pull_140e4e3d0` (`0x140e4e3d0`, verified 8-byte prologue) to inject raw mouse deltas directly as 1:1 camera radians with native ADS/zoom scaling (`[block + 0x30/0x34]`). - Automatically releases and restores `IDC_ARROW` on Pause, Map, Shop/Modal UI, `F1` overlay, or focus loss; click-in recaptures with LMB swallow to prevent misfires. - Live hotkeys: `[` / `]` adjust sensitivity by ±15%, `F9` toggles capture override, `F8` toggles vehicle auto-center bypass. - Preserves `VICTORY_NATIVE_MOUSE`, `VICTORY_MOUSE_SENS`, `VICTORY_MOUSE_INVERT_Y`, `VICTORY_WHEEL_SENS`, `VICTORY_WHEEL_SCROLL_INVERT`, and `VICTORY_VEHICLE_AUTO_CENTER` across `victory play` restarts (`KEPT` in `apps/victory/src/play.rs`). Setting `VICTORY_NATIVE_MOUSE=0` falls back cleanly to upstream `VICTORY_MOUSE_CAPTURE`. 2. **Radial Weapon Wheel Mouse Selection & Vehicle Controls** - Suppresses camera injection while `hud_quick_select` (`0x2c790e9c`) is open; raw mouse deltas drive a sticky unit-disk virtual right stick, and mouse wheel notches cycle sub-slots via `RT` / `LT` trigger pulses (`PreRelease -> Pulse -> Gap`) reliable at 15–25 FPS. - Pure-memory vehicle seat detection (`None` / `Driver` / `AircraftPilot` / `Passenger`) splits non-aircraft driving (`W` = RT throttle, `S` = LT brake/reverse, `LShift`/`LCtrl` = bike/boat pitch, `RMB`/`LMB` = `LB`/`RB` when wheel closed) from on-foot & aircraft controls. - Redirects `camFollowAutoCenter::Update` (`0x007c_5ee1 -> 0x00b6_9900`) on normal frames in vehicles to bypass auto-centering cleanly without spring snap-back; live-toggleable via `F8` or **F1 > VEHICLE AUTO-CENTER** (`VICTORY_VEHICLE_AUTO_CENTER`). 3. **Pre-Launch Invisible DLSS / Frame Generation Warm-up (`victory dlss-warmup`)** - Replaces the jarring in-game 10 s auto-restart on first launch of a new build with a brief pre-launch subprocess (`victory dlss-warmup --output <WxH> --frames 24`) using a hidden 1x1 unfocused tool window (`host::set_hidden_window(true)`) and clean `slShutdown` teardown. - Controlled via `--dlss-warmup`, `--no-dlss-warmup`, and `VICTORY_DLSS_WARMUP` (`0` / `force`); honors legacy warm-up marks under `%LOCALAPPDATA%\victory\warmed`. 4. **Portable `Start-GTA6.bat` Launcher, Asset Policy & Docs** - Adds a path-agnostic `Start-GTA6.bat` launcher (zero hardcoded local paths) that checks `VICTORY_GAME_DIR` -> `%VICTORY_HOME%\game_dir.txt` / `%LOCALAPPDATA%\victory\game_dir.txt` -> read-only `%~dp0game_dir.txt`, and interactively prompts & persists the game folder outside the repository on first run. - Adds `"bat"` to `ALLOWED_EXTENSIONS` in `xtask/src/policy.rs` (with unit test). - Updates `README.md`, `docs/architecture.md`, and adds `docs/notes-9950x-4090.md` documenting measurements, observed issues, RVAs, and branch changes. ## Verification - `cargo xtask policy`: passed (`asset policy: 298 files ok`) - `cargo clippy -p victory-hle -p victory-loader -p victory -p xtask --all-targets --locked` & `--all-features --locked`: 0 warnings across all modified crates (unrelated pre-existing warnings in `victory-gpu/src/{shadow.rs,descriptor.rs}` left untouched) - `cargo test -p victory-loader -p victory-hle -p victory -p xtask --locked`: all passed (`victory` 28+2, `victory-hle` 202+1 / 3 ignored, `victory-loader` 48+3, `xtask` 6) - `Start-GTA6.bat` verified in `cmd.exe` with isolated `VICTORY_HOME` (prompt, invalid-path retry, persistence, auto-load on second run, drag-and-drop exe path, `--help` passthrough) - Live gameplay tested on Ryzen 9 9950X + RTX 4090 (`4k` + DLSS Quality Preset K + 2x FG, >8,750 DLSS frames)
MaroonCoffee commented 2026-11-28 21:41:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MaroonCoffee on 2026-11-28T21:41:24Z.


I can't speak for the other changes, but I tested a merge with just the mouse changes and this is so much more playable with a mouse. Highly recommend merging mouse changes.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246200299 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7246200299). Originally posted by [MaroonCoffee](https://github.com/MaroonCoffee) on 2026-11-28T21:41:24Z. --- I can't speak for the other changes, but I tested a merge with just the mouse changes and this is so much more playable with a mouse. Highly recommend merging mouse changes.
MaroonCoffee commented 2026-11-28 21:52:24 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by MaroonCoffee on 2026-11-28T21:52:24Z.


I made a separate PR for just the mouse merge since this one has conflicts, and makes multiple changes. Hopefully this'll increase the chance these changes make it in.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7246334992 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7246334992). Originally posted by [MaroonCoffee](https://github.com/MaroonCoffee) on 2026-11-28T21:52:24Z. --- I made a separate PR for just the mouse merge since this one has conflicts, and makes multiple changes. Hopefully this'll increase the chance these changes make it in.
0z0sk0 commented 2026-11-29 10:42:34 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by 0z0sk0 on 2026-11-29T10:42:34Z.


Must be closed

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7254615379 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7254615379). Originally posted by [0z0sk0](https://github.com/0z0sk0) on 2026-11-29T10:42:34Z. --- Must be closed
lyufeng000 commented 2026-11-29 11:23:36 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by lyufeng000 on 2026-11-29T11:23:36Z.


Superseded by #1570 (merged in v2026.11.29.01) and follow-up #2225.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7255080611 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7255080611). Originally posted by [lyufeng000](https://github.com/lyufeng000) on 2026-11-29T11:23:36Z. --- Superseded by #1570 (merged in v2026.11.29.01) and follow-up #2225.

Pull request closed

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!1356
No description provided.