Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inject VR support into some flat UE games #266

Closed
frostworx opened this issue Jul 19, 2021 · 6 comments
Closed

Inject VR support into some flat UE games #266

frostworx opened this issue Jul 19, 2021 · 6 comments

Comments

@frostworx
Copy link
Collaborator

frostworx commented Jul 19, 2021

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
Copy link
Collaborator Author

frostworx commented Jul 19, 2021

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
Copy link
Collaborator Author

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
Copy link
Collaborator Author

frostworx commented Jul 23, 2021

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:

  • automatically create a console command script stl-vr-patch with above vr commands and place it into $GAMEDIRECTORY/Binaries
  • automatically add that script to the editor menu, so it can be easily edited from there
  • create/edit 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

  • opening the console
  • starting exec stl-vr-patch by selecting it from the console history

@frostworx
Copy link
Collaborator Author

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

  • tilde/backtick/grave to open the use console
  • cursor up top select exec stl-vr-patch from the console history
  • return
    -> profit

@frostworx
Copy link
Collaborator Author

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 frostworx mentioned this issue Jul 27, 2021
@frostworx
Copy link
Collaborator Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant