[BUG] - PEAK - r2modman is forcing vulkan
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.
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.
Interesting, if I set the steam to launch with dx12, it does not attach any launch params
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, this seems to have been exactly my issues, and the quoted fix works; thank you!
@CyR1en, you are a gentleman and a scholar. 🙌
Bump, Even when I "Set custom launch parameters" through the r2modman itself, still forces Vulkan
@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.
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
Had the same issue. Here is a simple workaround without modifying the files that worked for me:
- 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"
- 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
- Start the game from within Steam
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