Closed frostworx closed 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)
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
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:
stl-vr-patch
with above vr commands and place it into $GAMEDIRECTORY/Binaries
Input.ini
and add[/Script/Engine.Console]
HistoryBuffer=exec stl-vr-patch
The user starts the game regularly then, but can easily enable VR by
exec stl-vr-patch
by selecting it from the console historyThe rest could be automated (maybe optionally) as well by sending following keys to the game window
exec stl-vr-patch
from the console historyInitially 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.
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:dotnet DepotDownloader.dll -app 1506640 -depot 1506641 -manifest 2972482185570779622 -username XXX -password YYY
) - just bought it. quick test: injection works and in game vr view is correct - keyboard input didn't react anymore after enabling VR - probably can be resetted with an other ue4 command.Feel free to search and report more possible compatible games!