Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.



Overview

HTC Vive support is now included with CRYENGINE. This article will guide you through setting up VR and also includes important information that you should know before getting started.

Chapters:

Table of Contents
maxLevel2
minLevel2
excludeOverview

Getting Started

  • Runtime: In order to use the HTC Vive you need to install Steam.
  • HTC Vive Documentation: Please read the documentation regarding device setup and configuration - Available from Steam.
  • Video Drivers: Update your Video Card Driver(s) and ensure that you are running the most recent revision that supports the HTC Vive.
  • Recommended PC Spec: Information regarding hardware requirements - Available from HTC.
Note
titleHelp with installation and Setup

For help in configuring your device, please use the official HTC Vive application and documentation (available in the link above).

Starting the Engine with the Vive Enabled

To enable VR in CRYENGINE then follow the steps below: 

  1. Connect the device to your computer
  2. Make sure the vendor runtime/application recognizes your headset as ready for use
  3. Enable the OpenVR plugin by adding the following line to the plugin section of your .cryproject file

    Code Block
    { "type": "EPluginType::Native", "path": "CryOpenVR" },


    Warning

    If this line is added to the end of the .cryproject file’s plugin section, the comma at the end of the line should be omitted. If not, a parsing error will be generated when launching the project file.


  4. To the system.cfg or user.cfg file of your project, add the following lines:

    Code Block
    sys_vr_support=1
    hmd_tracking_origin=21


    Info

    The hmd_tracking_origin CVar sets the HMD's tracking origin point to:

    • The actor's feet, when its value is 0;
    • The camera (actor's head), when its value is 1.


  5. Launch the Engine (as admin).
Info

If sys_vr_support is set to 1, Sandbox will always launch with Stereo Mode and Stereo Output set to Dual Rendering and VR Headset respectively. This, however, can be changed/switched off at any point of time

Once launched, the Engine should be rendering to your head-mounted device. To edit your level:

  1. Click the  button at the top of the Sandbox Editor’s Viewport to bring up the display options.
  2. Scroll down to the Stereo Settings section, and set the Stereo Mode to No Stereo Output.

    No Stereo Output

Note
  • The No Stereo Output Stereo Mode overrides the Stereo Output setting, even if the latter is set to VR Headset.
  • Launch the Engine as admin if you encounter error 308.

Input Configuration

If so desired you can bind this directly to a key/gamepad button. This can be achieved via Flow Graph using the Debug:InputKey node.

Alternatively, you could modify the <game_folder>\Libs\Config\DefaultProfile.xml file and assign a button there.

See Setting up Controls & Actionmaps for more information.

Flow Graph

We have exposed some controls/functions that are related to the HMD device and the Motion Controllers. This can be accessed through Flow Graph.

  • VR:TransformInfo

Allows quick access to position and rotation information related to the VR device.


  • VR:Tools

Allows you to hook up an input to trigger the RecenterPose command.


  • VR:ControllerTracking

Similar to the VR:TransformInfo node. This node will allow you to access position and rotation information of a controller. Additionally, you can provide a scaling value as well as a reference entity.


Note
titleHTC Vive use

FlowNodes below are Device/Platform specific, exposed for solely for the purposes of device specific interaction, and not interoperability.

  • VR:OpenVRController

Allows you to retrieve the button states as well as the trigger and touchpad values of the given Controller. (Index should usually be either 0 or 1).

Frames per Second

The HTC Vive will play your game at exactly 90 FPS if you can make it run at exactly 90 FPS or above.

Note

If at any point your game runs at a fraction less than 90 FPS, it will temporarily default down to 45 FPS until 90 FPS is restored.

Please keep in mind that anything less than 90 FPS is generally not considered to be a pleasant experience in VR.

Possible Issues You Can Encounter

The Sandbox Editor fails to run after enabling VR

Solution:

  1. Remove any VR plugins from your .cryproject for e.g. { "type": "EPluginType::Native", "path": "CryOpenVR" }
  2. Remove sys_vr_support from your system.cfg or .cryproject
  3. Ensure that any other VR specific features are disabled

NOTE: When reverting back to game mode then all of the above steps/any changes made must be reverted

Running the Sandbox Editor with the user.cfg

This will try to enable VR in Editor Mode which it will attempt, but can't do.

Solution: Rename the user.cfg to something else such as _user.cfg

This will bypass the file being read on loading of the Sandbox Editor.

Note
Make sure to change the name back to user.cfg when you want to use VR again in the Launcher.

In some instances the Launcher (GameSDK.exe) boots to a black screen

The game is active in the background but nothing is visually represented on screen.

Solution: Delete the the user folder in the root of the build. Then relaunch the GameSDK.exe.