Cross-Platform (Steam and SteamVR) Launch Option

What we need:

  • On launching the game, a preliminary options menu needs to show up on the player’s Monitor/TV screen, allowing them to choose whether they’re playing with or without a VR Headset.
  • Once the option is set, we need the game to then launch through SteamVR using the HMD if set to VR, or just on the monitor through Steam if set to Standard.

Why we need it:

We’re working on a VR game that we want to make cross-platform, including standard PC without a VR headset. We’re also trying to set it up so that players with and without VR headsets can play together, so it makes the most sense to do so a single versions of the game.

Because of this cross platform option, the menu needs to show up on the players monitor/TV initially so they can choose what hardware they’re playing the game with first, then launch the game through either SteamVR or standard Steam.

What I have come up with as the most straight-forward solution would be to have the game launch through standard Steam, showing a menu for “Play” or “Play in VR”, along with controller selection/configuration, and set up the “Play in VR” button to close the game and relaunch it through SteamVR.

I just need to find the proper way to tell it to close and relaunch in VR.

Hi Last_Marvik,

Unreal will actually auto-detect if an HMD is present or not.
If that doesn’t work for you there is a neat Blueprint node available:

This will tell you if there is an HMD present or not. You may also peek into the code behind this node to see how you could achieve the same thing in C++ in case you need it :slight_smile:

I personally find it rather annoying if games I want to play in VR ask me something on the 2D screen because I like to start them from the VR Steam Overlay and would have to take off the HMD again just to answer that question :confused:

Hope I could help :slight_smile:

Thanks for the input, I’ll have to test a few builds to see if that node will be a feasible solution. I suppose theoretically, since VR games also display on the screen, I can have it spawn different player pawns based on the return of that node and all would be well.

The primary issue will be if the absence of a HMD prevents a game from being launched in SteamVR, in which case I’m back at square one with needing a way to have the game launcher detect whether to start with Steam alone, or the SteamVR app.

Regardless, I’ll give it a shot and see if it works or if I find a workaround. It might take a few days for me to do so though, since I’m asking this question preemptively. Working on some of the higher priority mechanics right now, but we’ll get to that point shortly.

You’re welcome

I just ran a quick test and UE4 will detect if the SteamVR app needs to be started. When no Vive was connected it just started on my normal screen and after I connected the Vive and did NOT have SteamVR running it started that, so no need to check anything here :slight_smile:

If I may suggest something:
-Have a little script that will detect if HMD present (see above) and if so possess the VR Pawn otherwise your “2D Screen” one :slight_smile:

Thanks for running that test! If it was that simple to do, I should be able to run a quick one myself shortly, as I was told to hold off if I thought it would take more than a couple hours and focus on gameplay.

I’ll mark your reply as the answer for now then, and if I run into issues when I test the build launching from a steam library I’ll either return to this question or ask again.