Skip to content

XWAU TFTC VR guide

Marcos Orallo edited this page Jul 1, 2023 · 1 revision

Installation

Follow the default install guide for XWAU/TFTC and make sure it works properly in non-VR mode.

Compatibility and requirements

X-Wing Alliance Upgrade does not have any specific requirements for VR. If other SteamVR games run fine in VR, you should have no problem in running XWAU.

Valve's official SteamVR runtime

The process to configure SteamVR properly for each head mounted display (HMD) is slightly different depending on the vendor/model. However you always need to make sure you have SteamVR installed in your Steam library..

Note that you can (and should, for XWAU) run SteamVR without running Steam. You just need to create a shortcut to the app in your Desktop or Task Bar, or launch it from your Start menu.

Quest/Quest2

Link/AirLink

Virtual Desktop

VD may have some advantages over the official (Air)Link for Oculus and other standalone VR headsets.

  • Performance/latency may be better in certain system/game configurations.
  • Reprojection (Synchronous Space Warp) happening on the Headset, which leaves a bit more GPU power for actually rendering the game on the PC.

You need to buy the standalone version of Virtual Desktop in the Oculus Quest store, and NOT the original one in the PCVR store.

Oculus Rift

  • Make sure your Rift (S) device is properly configured in Oculus Home application and that you can see the SteamVR "grid" environment when you launch it and put your HMD on.

Windows Mixed Reality

Using SteamVR with Windows Mixed Reality

OpenComposite

Open Composite is an alternative implementation of OpenVR API (the interface SteamVR exposes to applications) that will translate the API calls into OpenXR. This way applications can use the OpenVR API without running SteamVR. It can have some benefits for non-SteamVR native VR devices like Oculus, Windows Mixed Reality, Pimax etc.

You can install Open Composite as the default OpenVR runtime for all your applications, but unless you know very well what you are doing, we recommend you to deploy it only for XWAU by copying the openvr_api.dll file in the XWA folder (after saving a copy of the default DLL, in case things don't work properly)

XWA VR configuration

There are 2 ways to enable VR in X-Wing Alliance Upgrade/TFTC:

Using Babu Frik's

  1. Run Babu Frik's from the X-Wing Alliance Launcher
  2. Select Customize the VR Options in the VR / Head Tracking Choices section
  3. Choose Use Steam VR option.

The effects also introduce an inertia effect cockpit that makes the cockpit "lag" relatively to the ship movement. This can be unpleasant to some people, or even inducing sickness. You can disable it in the "Customize Dynamic Cockpits" section.

Manual config file modification

You can also enable/disable VR quickly by modifying some configuration files in the root of your XWA folder with Notepad or any text editor of your choice.

  • VRParams.cfg
    • VR_Mode = SteamVR
  • CockpitLook.cfg
    • tracker_type = SteamVR
    • cockpit_inertia_enabled = 1

Additionally in CockpitLook.cfg you can configure another parameter to make sure the camera stays in the cockpit as much as possible in the hangar, to increase immersion.

  • disable_hangar_random_camera = 1

VR runtime configuration

  • Render resolution and supersampling

    • The game will render in VR in the resolution provided by the SteamVR runtime, based on the resolution of your VR device.
    • Increasing the render resolution beyond the native resolution of the displays inside the VR device will increase the image quality, both in clarity (due to lens distortion) and aliasing.
  • Reprojection/Asynchronous Space Warp

    • Most VR runtimes have reprojection techniques to generate frames based on the pose tracking. This allow for smooth camera movement even when the frame rate of the game rendering falls below the native refresh rate of the device.
    • The downside is that the frame generation may generate visible artifacts. The lower the game rendering framerate, the worse the graphic artifacts will be.
    • Currently the ddraw.dll implementation does not use the depth buffer to improve the frame generation, as used by Oculus' Asynchronous Space Warp 2.0 (ASW2.0).

Oculus Tray Tool

Oculus tray tool is a very convenient utility that allows to tweak advanced parameters of the Oculus Runtime, among others:

  • Per-game profile with specific CPU priority, supersampling, ASW settings.
  • Per-game Oculus Link encoding resolution, bitrate and sharpening settings.
  • Power options to set high-performance power plan and disable USB power saving on demand.
  • Oculus debug tool performance/debug overlays

It is not required but it can be convenient for advanced users.

How to launch the game in SteamVR mode

After you have configured all the requirements as described above If you are using the official SteamVR runtime (and not OpenComposite):

  1. Close Steam
  2. Launch Oculus Home
  3. Launch SteamVR
  4. Launch the game

You can also run the game directly and it will launch SteamVR in the background, but you will not see the SteamVR window where you can see the status of the tracking, change options, enable the mirror window... Also, the SteamVR process may stay running in the background after the game has closed.

Performance optimization

VR mode is quite demanding compared to playing the game in "pancake mode" (non-VR, 2D graphics in the monitor) for several reasons:

  • The current generations of VR headsets have native resolutions that are equivalent or higher to rendering in 4K resolution.
  • The game needs to render in stereo, two different images for your two eyes.
  • It is critical to maintain a high framerate (minimum 72fps, ideally 90fps or higher) in VR to avoid jerky camera tracking and potential user sickness.

In VR mode, vsync is enforced by the VR runtime. This means that if the frame rate falls below the native refresh rate of the headset (typically 90Hz), the frame rate will be reduced in half (45fps). If the game cannot maintain 45fps, it will be reduced to a third of the refresh rate, etc.

That is why it is usually better to sacrifice image quality for smoothness.

GPU or CPU limited?

Historically, XWA performance has been a heavily limited by CPU. However, in the latest years, there have been significant optimizations and new features that have reduced the CPU load and increased the GPU usage:

  • D3dRendererHook: implements geometry calculations with shaders in the GPU (Golden ddraw 1.3.35, effects ddraw 2.0 and later)
  • RayTracing: global real-time shadows implemented in GPU shaders (NOT using specific ray-tracing hardware support from modern GPUs).
  • Batch facegroup draw calls per texture (hook_32bpp from 2023-05-19 and later)
  • Instanced Stereo Rendering (Effects ddraw.dll 2.4.4 and higher)

There are many ways to determine if your setup is CPU or GPU limited, but one of the easiest is to monitor the usage with native or third party programs. https://www.howtogeek.com/757556/what-is-a-cpu-or-gpu-bottleneck-in-pc-gaming-and-how-to-fix-it/

The ideal configuration is that both GPU and CPU are used to their maximum capacity.

XWA options

If CPU is the bottleneck --> ensure you have all the CPU increase graphic options/quality that are dependent on GPU only (resolution, effects...) until GPU is used at 100%

Optimum settings to reduce the CPU load:

  • Ddraw.cfg
    • D3dRendererHookEnabled = 1 will offload geometry calculations to the GPU.
    • ProcessAffinityCore = 0 will allow the game to run different threads in multiple cores (although the engine is not optimized for it)
  • Make sure you are using hook_time.dll
  • Update your hook_32bpp
  • Update effects ddraw.dll to 2.4.4 or later (included in TFTC 1.3.3 and XWAU 2023)

If GPU is the bottleneck --> decrease graphic options until the CPU is used at 100%.

Settings to reduce GPU load, sorted by approximate performance impact.

  • Disable hit effects in the game options (it may have an impact only in certain setups)
  • Disable multi-sample antialiasing (MSAA)
    • ddraw.cfg > EnableMultisamplingAntialiasing = 0
  • Disable Raytraced global dynamic shadows
    • SSAO.cfg > raytracing_enabled = 0
  • Reduce rendering resolution in SteamVR options or the native VR runtime.
  • Disable Ambient Occlusion (use simple Deferred shading mode)
    • SSAO.cfg > ssao_type = Deferred
  • Disable Bloom
    • Bloom.cfg > bloom_enabled = 0

If even with all this your are unable to reach the target framerate, you can also lower the refresh rate of the device to better adjust to the maximum FPS you are getting. For example in Quest with Link/AirLink, you can configure 72Hz instead of 90Hz so 72fps will be the new target.

FAQ/Troubleshooting VR

Q: I can see the game in the monitor mirror window, but it is not displaying anything in the VR device A: check that you have Hook_CockpitLook.dll in the XWA directory. A: Try re-centering the screen by pressing the dot/period key twice or recalibrate your HMD.

**Q: How do I re-center the screen A: Look straight ahead and press the dot/period key twice.

Additional Information