A mods folder: load every DLL in %LOCALAPPDATA%\victory\mods before the title runs #1892

Manually merged
github merged 1 commit from github-bot/gh-1892 into main 2026-11-29 08:21:30 +00:00 AGit
Owner

@⁠leonidarider on GitHub · 2026-11-29 01:47 UTC · original
ragetools:mods-folder → main · +30 −0 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC

What it changes

victory already loads one mod in a slot of its own (MFG Unlocker) and whatever DLL sits beside victory.exe under a Windows name. A mod that is neither has no clean way in: it has to pose as a system DLL or inject itself from outside.

This adds a mods folder. Every .dll in %LOCALAPPDATA%\victory\mods is loaded by name order, after MFG Unlocker's slot and before the title runs, through the same victory_hle::streamline::load_mod call that slot uses. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing.

It is called on both paths that run a title (play and run), so a script that runs the title directly loads the same DLLs.

30 lines: load_mods in apps/victory/src/play.rs, two calls in apps/victory/src/main.rs.

What uses it

We wrote it for OpenRage's mod loader: a DLL that serves loose files from a mods folder beside the game in place of the archives' own, with no archive rewritten (the loader is crates/tools/or-loader there, the guide is docs/guides/GTA_VI_Modding.md). Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way.

How it was tested

  • GPU and profile: NVIDIA RTX, Series X, 1440p, DLSS performance, frame generation 2x, no ray tracing
  • Before: a mod DLL had to be injected by a separate launcher
  • After: a DLL dropped in the folder is loaded on every start; used with a file-serving mod loader over about a day of play sessions; the same two calls rebased onto current main build and run
  • For shader changes, the wave sizes tested: not a shader change
  • cargo test passed for the crates it touches: no (not run; cargo build --release -p victory passes)

Checked for overlap

  • I searched the open pull requests and issues for mod loading, mods folder and DLL loading, and found none. Related: none
**@⁠leonidarider** on GitHub · 2026-11-29 01:47 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1892) `ragetools:mods-folder` → `main` · +30 −0 · 2 files · 1 commits · merged 2026-11-29 08:16 UTC ## What it changes victory already loads one mod in a slot of its own (MFG Unlocker) and whatever DLL sits beside `victory.exe` under a Windows name. A mod that is neither has no clean way in: it has to pose as a system DLL or inject itself from outside. This adds a mods folder. Every `.dll` in `%LOCALAPPDATA%\victory\mods` is loaded by name order, after MFG Unlocker's slot and before the title runs, through the same `victory_hle::streamline::load_mod` call that slot uses. Each one is named on the console whether it loaded or not, and a DLL that fails to load costs the run nothing. An empty or missing folder changes nothing. It is called on both paths that run a title (`play` and `run`), so a script that runs the title directly loads the same DLLs. 30 lines: `load_mods` in `apps/victory/src/play.rs`, two calls in `apps/victory/src/main.rs`. ## What uses it We wrote it for [OpenRage](https://github.com/openragee/openrage)'s mod loader: a DLL that serves loose files from a `mods` folder beside the game in place of the archives' own, with no archive rewritten (the loader is `crates/tools/or-loader` there, the guide is `docs/guides/GTA_VI_Modding.md`). Nothing in this change is specific to it: any mod DLL dropped in the folder loads the same way. ## How it was tested - GPU and profile: NVIDIA RTX, Series X, 1440p, DLSS performance, frame generation 2x, no ray tracing - Before: a mod DLL had to be injected by a separate launcher - After: a DLL dropped in the folder is loaded on every start; used with a file-serving mod loader over about a day of play sessions; the same two calls rebased onto current `main` build and run - For shader changes, the wave sizes tested: not a shader change - `cargo test` passed for the crates it touches: no (not run; `cargo build --release -p victory` passes) ## Checked for overlap - [x] I searched the open pull requests and issues for mod loading, mods folder and DLL loading, and found none. Related: none
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 01:54:18 +00:00
github-bot changed title from [pr-feature] A mods folder: load every DLL in %LOCALAPPDATA%\victory\mods before the title runs to A mods folder: load every DLL in %LOCALAPPDATA%\victory\mods before the title runs 2026-11-29 02:23:18 +00:00
github manually merged commit 4aef76079a into main 2026-11-29 08:21:30 +00:00
Author
Owner

@⁠ifBars on GitHub · 2026-11-29 18:02 UTC · original

Thanks for the mods folder. We'd like Palmhook (a mod host for this title) to install as a DLL in this folder instead of as a patched victory.exe, but the folder alone isn't enough for that yet:

  • A mod in the folder is loaded before the title is mapped, and it isn't called again. A mod that patches title code needs a call once the image is mapped and bound, before the title runs.
  • There's no hook at present, so a mod can't draw over the picture with the runtime's device and command list.
  • There's no way for a mod to keep the keys it uses for itself, such as an open mod menu, from reaching the title.
  • Loading through streamline::load_mod marks MFG Unlocker as present for any DLL. #2113 fixes that.

#2846 (draft) adds optional victory_mod_* exports for the first three points. A DLL that exports none of them behaves exactly as it does with this PR.

**@⁠ifBars** on GitHub · 2026-11-29 18:02 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1892#issuecomment-7260161841) Thanks for the mods folder. We'd like Palmhook (a mod host for this title) to install as a DLL in this folder instead of as a patched `victory.exe`, but the folder alone isn't enough for that yet: - A mod in the folder is loaded before the title is mapped, and it isn't called again. A mod that patches title code needs a call once the image is mapped and bound, before the title runs. - There's no hook at present, so a mod can't draw over the picture with the runtime's device and command list. - There's no way for a mod to keep the keys it uses for itself, such as an open mod menu, from reaching the title. - Loading through `streamline::load_mod` marks MFG Unlocker as present for any DLL. #2113 fixes that. #2846 (draft) adds optional `victory_mod_*` exports for the first three points. A DLL that exports none of them behaves exactly as it does with this PR.
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!1892
No description provided.