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

Merged
leonidarider merged 1 commit from upstream-pr/1892 into main 2026-11-29 08:16:52 +00:00
leonidarider commented 2026-11-29 01:47:58 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by leonidarider on 2026-11-29T01:47:58Z.


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
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5546556429 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1892). Originally posted by [leonidarider](https://github.com/leonidarider) on 2026-11-29T01:47:58Z. --- ## 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
ifBars commented 2026-11-29 18:02:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by ifBars on 2026-11-29T18:02:30Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7260161841 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1892#issuecomment-7260161841). Originally posted by [ifBars](https://github.com/ifBars) on 2026-11-29T18:02:30Z. --- 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.
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!1892
No description provided.