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

Closed
github-bot wants to merge 1 commit from github-bot/gh-1356 into main AGit
Owner

@⁠lyufeng000 on GitHub · 2026-11-28 17:56 UTC · original
lyufeng000:9950x-4090-mouse-track → main · +3671 −74 · 18 files · 1 commits · closed without merging

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)
**@⁠lyufeng000** on GitHub · 2026-11-28 17:56 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356) `lyufeng000:9950x-4090-mouse-track` → `main` · +3671 −74 · 18 files · 1 commits · closed without merging ## 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)
- Native 1:1 mouse aiming and UI cursor management:
  Add `victory-loader::callhook` (using `tls::near` trampoline pages) and
  `victory-hle::mousehook` to inject raw mouse deltas directly as 1:1 camera
  radians with native ADS/zoom scaling (`VICTORY_NATIVE_MOUSE`, enabled by
  default), coordinated with `gameinput` (1.5 ms camera-blend latch) and
  `lifecycle` (`RAWINPUTDEVICE`, `WM_INPUT`, `WM_SETCURSOR`, LMB recapture
  swallow). Automatically releases and restores the cursor on menus, map,
  modals, and the F1 overlay, with live hotkeys (`F8`, `F9`, `[`, `]`).
- Radial weapon wheel mouse sector selection and trigger scrolling:
  Suppress camera injection while `hud_quick_select` is open, map raw mouse
  deltas to a sticky unit-disk virtual right stick, and map mouse wheel
  notches to `RT`/`LT` trigger pulses (`PreRelease -> Pulse -> Gap`) with
  `VICTORY_WHEEL_SCROLL_INVERT` support.
- Pure-memory vehicle seat detection and camera auto-center bypass:
  Resolve local player seat (`None` / `Driver` / `AircraftPilot` / `Passenger`)
  from entity/component memory to split non-aircraft driving controls (`W`/`S`
  throttle/brake, `LShift`/`LCtrl` pitch, `RMB`/`LMB` -> `LB`/`RB`) from
  on-foot/aircraft bindings. Redirect `camFollowAutoCenter::Update` on normal
  frames in vehicles to bypass auto-centering cleanly without spring snap-back,
  toggleable live via `F8` or `F1 > VEHICLE AUTO-CENTER`
  (`VICTORY_VEHICLE_AUTO_CENTER`).
- Pre-launch invisible DLSS / Frame Generation warm-up:
  Replace the in-game warm-up auto-restart with a pre-launch
  `victory dlss-warmup` subprocess backed by an invisible 1x1 DXGI/Streamline
  host window (`victory-gpu::host`, `streamline.rs`), recording per-build marks
  under `%LOCALAPPDATA%\victory\warmed` (`--dlss-warmup`, `--no-dlss-warmup`,
  `VICTORY_DLSS_WARMUP`).
- Portable `Start-GTA6.bat` launcher and asset policy update:
  Add a path-agnostic `Start-GTA6.bat` launcher with interactive game directory
  prompting (supporting spaces, quotes, drag-and-drop of folder or
  `game_scarlett_master.exe`), persistent config outside the repository
  (`%VICTORY_HOME%\game_dir.txt` or `%LOCALAPPDATA%\victory\game_dir.txt`), and
  tuned launch/mouse flags. Add `"bat"` to `xtask/src/policy.rs`
  `ALLOWED_EXTENSIONS` with a unit test.
- Documentation and lint hygiene:
  Update `README.md`, `docs/architecture.md`, and add
  `docs/notes-9950x-4090.md`; resolve the clippy warning in
  `crates/victory-hle/src/modules/gameinput.rs`.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:57:20 +00:00
Author
Owner

@⁠MaroonCoffee on GitHub · 2026-11-28 21:41 UTC · original

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** on GitHub · 2026-11-28 21:41 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7246200299) 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.
Author
Owner

@⁠MaroonCoffee on GitHub · 2026-11-28 21:52 UTC · original

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.

**@⁠MaroonCoffee** on GitHub · 2026-11-28 21:52 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7246334992) 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.
Author
Owner

@⁠0z0sk0 on GitHub · 2026-11-29 10:42 UTC · original

Must be closed

**@⁠0z0sk0** on GitHub · 2026-11-29 10:42 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7254615379) Must be closed
github-bot closed this pull request 2026-11-29 11:28:08 +00:00
Author
Owner

@⁠lyufeng000 on GitHub · 2026-11-29 11:23 UTC · original

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

**@⁠lyufeng000** on GitHub · 2026-11-29 11:23 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1356#issuecomment-7255080611) Superseded by #1570 (merged in v2026.11.29.01) and follow-up #2225.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

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