r2modmanPlus icon indicating copy to clipboard operation
r2modmanPlus copied to clipboard

[BUG] - PEAK - r2modman is forcing vulkan

Open Orbsa opened this issue 6 months ago • 8 comments

Describe the bug r2modman forces vulkan on PEAK If I run the game through steam and check process explorer, there are no additional launch parameters If I run the game with r2modman and no custom launch options It launches with the following -- "C:\Program Files (x86)\Steam\steamapps\common\PEAK\PEAK.exe" -force-vulkan --doorstop-enabled true --doorstop-target-assembly C:\Users\Eric\AppData\Roaming\r2modmanPlus-local\PEAK\profiles\Default\BepInEx\core\BepInEx.Preloader.dll"

Even if I add launch parameters "-force-d3d12 -high" as custom parameters, It still launches with the "-force-vulkan" being read first.

The problem with vulkan is that with my current setup the game will crash any time I alt-tab on my setup.

Orbsa avatar Jul 02 '25 05:07 Orbsa

This is happening for me even if I manually run

"C:\Program Files (x86)\Steam\steamapps\common\PEAK\PEAK.exe"

directly, the resulting call (from steam) is

"C:\Program Files (x86)\Steam\steamapps\common\PEAK\PEAK.exe" -force-vulkan

Even if I have my steam settings set to either ask or only run the game in drectx, or have told steam to add the -force-d3d12 to the cli directly.

I'm still looking for a workaround but it seems like steam itself is adding the offending cli option, rather than r2modman.

This also happens if you just double click the PEAK.exe excutable directly.

JamesKoenig avatar Jul 03 '25 23:07 JamesKoenig

Interesting, if I set the steam to launch with dx12, it does not attach any launch params

Orbsa avatar Jul 04 '25 00:07 Orbsa

Some people have already been looking at dealing with this, to quote a reply the author of this [quoted] repo sent to me:

The main issue is that the first option for Peak’s launch configuration is set to have the -force-vulkan parameter. That means, running the game outside of steam will basically run steam.exe -applaunch which will use the first option. I previously made a tool that swaps these launch configuration so that dx12 is the first option. However this isn’t ideal because Steam will always reset the file called appinfo.vdf. So I made another tool that would patch the UnityPlayer.dll to ignore the Vulkan parameter. If you wanna know more about it you can read about it here: https://github.com/CyR1en/UnityPlayerPatcher

I haven't read through the source but it seems to be addressing this exact situation, and discusses how it's occurring in-depth.

JamesKoenig avatar Jul 04 '25 00:07 JamesKoenig

@JamesKoenig, this seems to have been exactly my issues, and the quoted fix works; thank you!

@CyR1en, you are a gentleman and a scholar. 🙌

mpql avatar Jul 10 '25 10:07 mpql

Bump, Even when I "Set custom launch parameters" through the r2modman itself, still forces Vulkan

Image

kaysrwolf avatar Jul 26 '25 14:07 kaysrwolf

@kaysrwolf This is not an issue with r2modman, thunderstore, gale, or any other mod loader. Any argument regarding dx12 will not work (-dx12, -force-dx12, -force-d3d12). This is because the game uses dx12 if force-vulkan is not used. The reason the game defaults to force-vulkan is due to how the launch configuration for PEAK is set.

Image

As you can see, the first launch option (the default option used when the game is launched outside of Steam) includes the -force-vulkan argument. This is why the game will always run on Vulkan. Referencing the image above, you can see that there is no need for a dx12 argument when launching the game with dx12. It does not matter if you have -force-dx12, -dx12, etc., because the game does not care about those arguments. It only looks for the vulkan argument.

Work around

To solve this issue, I've created a patcher that patches the UnityPlayer.dll, which contains the code for the Unity Engine. This patcher essentially makes it so that it ignores the -force-vulkan argument and launches the game with no arguments. Consequently, this means the game launches using dx12. You can learn more about it here: https://github.com/CyR1en/UnityPlayerPatcher

CyR1en avatar Jul 26 '25 20:07 CyR1en

Had the same issue. Here is a simple workaround without modifying the files that worked for me:

  1. In R2Modman, select the profile you want to use, go to "Help" and copy the arguments under "Launching the game from outside the mod manager"
  2. Go to steam, open the properties of PEAK, set the launch option to "Play PEAK using DX12" and paste the copied launch arguments into the text input
  3. Start the game from within Steam

Flossiii avatar Aug 02 '25 20:08 Flossiii

UnityPlayerPatcher is now integrated in the latest version of the BepInEx pack for PEAK. This is achieved by forking Unity Doorstop, and implementing the patcher in it. This allows me to patch the UnityPlayer.dll in runtime, leaving the dll unmodified after the game closes.

Instead of downloading the patcher and patching the dll to make the game run using dx12, all you have to do now is set the following launch parameter in r2:

--doorstop-bypass-vulkan true

The parameter above also has some alias to make it easier to type:

-dx12
-force-d3d12
-force-dx12

Consequently, you can also set dx11 by bypassing the default Vulkan parameter and then setting the dx11 parameter. You can do this by using the following parameters:

--doorstop-bypass-vulkan true -force-d3d11

CyR1en avatar Sep 15 '25 17:09 CyR1en