sonic2kk / steamtinkerlaunch

Linux wrapper tool for use with the Steam client for custom launch options and 3rd party programs
GNU General Public License v3.0
2.16k stars 73 forks source link

Inject VR support into some flat UE games #266

Closed frostworx closed 3 years ago

frostworx commented 3 years ago

By using #264 in combination with #265 it is possible to inject real VR support into several flat UE4 games. Looks like most UE4 games, which were built with OpenVR (so those which ship "Engine/Binaries/ThirdParty/OpenVR") can be played in real VR (in game menus won't be compatible though). The current (wip & offline) implementation of above features already works as expected, but enabling VR mode, by calling the corresponding commands in the injected UE4 console is not properly working (yet). Depending on the list of possibly VR-able games with might or might not be worth the effort to fully implement this without requiring any user-interaction.

No idea if there's an easy (automated) way to find all (non-vr) games on steam which ship "Engine/Binaries/ThirdParty/OpenVR" (f.e. looks like steamdb doesn't help here), so no idea yet which games can be "VR-ed".

At least the following games (random order) could maybe (don't own them all yet and haven't tested them all) be made to work:

There are also some games, which shipped "Engine/Binaries/ThirdParty/OpenVR" before and can be reactivated by using an older steam depot:

Feel free to search and report more possible compatible games!

frostworx commented 3 years ago

The UE4 console commands required to VR a flat game are basically (might be improvable):

vr.bEnableHMD 1
vr.bEnableStereo 1
vr.HeadTracking.ResetPosition

(depending on the game the commands need to be applied while in game-play and don't work or might even crash when called from the main game menu)

frostworx commented 3 years ago

If this does work it would be pretty easy to add customized vr-autostart scripts to the corresponding games.

So add to the game command line parameters either via -exec=/path/to/vr-autostartscripts or raw via -ExecCmds=vr.bEnableHMD 1, vr.bEnableStereo 1, vr.HeadTracking.ResetPosition

frostworx commented 3 years ago

Looks like there is not much interest in this.... Anyway: executing a console command (script) directly via command line probably can't work, as the console itself is injected into the game after the game was executed

For the same reason, I'm not sure if there's even a possibility to start a script automatically on game start (using [SystemSettings] commands in Engine.ini probably won't work)

What definitely does work is at least the following:

[/Script/Engine.Console]
HistoryBuffer=exec stl-vr-patch

The user starts the game regularly then, but can easily enable VR by

frostworx commented 3 years ago

The rest could be automated (maybe optionally) as well by sending following keys to the game window

frostworx commented 3 years ago

Initially I had problems with sending tilde reliably to the game window, therefore the HistoryBuffer idea. This is working now, so the Input.ini functions are no longer needed.

frostworx commented 3 years ago

Partly added in release v6.13 "might expand depending on feedback"