Giter VIP home page Giter VIP logo

kerbal-vr's Introduction

Kerbal-VR

An add-on for Kerbal Space Program (KSP) to enable the use of a virtual reality headset (HTC Vive, Oculus Rift, etc), as supported by OpenVR.

This mod is currently only tested with the HTC Vive, in "seated" mode

FOLLOW the installation instructions below, this is not like other KSP mods

Built for KSP v1.1.3

This mod does not work on KSP 1.2, or 1.3, due to some breaking changes in the engine. See issue #7.

Demonstration video


This is an early WIP mod to allow the use of the HTC Vive (and potentially any HMD supported by the OpenVR SDK) in KSP. The primary focus is for use in IVA. Head-tracking works, but displaying the game screen on the HMD currently has caveats.

Currently testing with:

  • HTC Vive
  • Windows 10
  • Intel Core i5-6600K (overclocked to 4.1GHz)
  • EVGA GeForce GTX 970 4GB GDDR5 (04G-P4-3975-KR)
  • 16GB DDR4 (PC4-17000)
  • SteamVR / OpenVR SDK (beta version 1468542587)

This KerbalVR plugin captures the orientation information from the HMD and translates it into head-tracking movement (position & rotation). It will also render the IVA view directly into the HMD. However, rendering is slow, even on a decent rig that I'm testing with. Maybe needs some code re-work to reduce inefficiencies. But even with all graphics settings set to low, I can only get about 40-60 fps, which makes for a nauseating VR experience.

It's still fairly playable for short amounts of time. I'd also recommend installing the RasterPropMonitor mod to make it easier to navigate your craft in IVA. However be warned, I've seen the game crash randomly while using VR. Not sure if it's KSP-specific issues, or VR-related issues.

While in VR, your viewpoint is not limited to being inside the cockpit. If you have the proper setup and space to move around irl, you can actually "walk" outside your craft and see it from outside (and it's way cooler than what I can describe here).

Somehow VR will only work with KSP using OpenGL, i.e. you need to use the "-force-opengl" flag on the executable. It will not work if you try to run KSP normally, nor with the "-force-d3d11" flag (even with the OpenVR function calls set up to use DirectX rendering). To enable the OpenGL flag, create a Shortcut to either KSP.exe or KSP_x64.exe, and on the shortcut Properties, append "-force-opengl" to the Target, e.g.:

Target: C:\Games\KSP_win\KSP_x64.exe -force-opengl

Installation

  1. Download the latest KerbalVR release.
  2. Copy the KerbalVR folder into your KSP GameData folder. The KerbalVR folder contains KerbalVR.dll.
  3. Copy openvr_api.dll into the root of the KSP directory, i.e. openvr_api.dll should be next to KSP.exe and KSP_x64.exe. Use either the 32- or 64-bit version of openvr_api.dll, according to your bit-version of Windows.

Should look something like this:

+-- Game Data
|   +-- KerbalVR
|   |   +-- KerbalVR.dll                     <-- MAKE SURE THIS IS HERE
|   +-- Squad
|   +-- <other mods>
+-- KSP.exe
+-- KSP_x64.exe
+-- openvr_api.dll                           <-- MAKE SURE THIS IS HERE
+-- <other KSP files/directories>

Usage

Instructions:

  1. Start SteamVR
  2. Start up KSP with the "-force-opengl" flag
  3. During flight, enter IVA, and press the 'Y' key to initialize the HMD
  4. You can press 'Y' again to reset the default position
  5. Any errors should come up in the Debug log (press Alt-F12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.