Stellaris In VR-is

Now available via Github for anyone who wants to take a look at the inner workings

 

How it works

A beautiful bodge

Manipulating the view

Resetting the view to the center of the galactic map uses a series of AutoHotkey commands to zoom out, drag the mouse to orient as top down perspective, and then open the console and use the “goto 0 0” command to center the map.

Opening panels is always handled via hotkeys, which means VR-is doesn’t actually have knowledge of which panels are open/closed, only estimations based on an expected blank start state and the history of hotkeys it itself has pressed.

 

Different panels

To achieve the effect of having multiple panels open at once, those that aren’t currently open in Stellaris have their view paused (e.g. opening the technology panel will capture and freeze the view of planetary administration so it can be referenced but no updates will be visible!)

Currently panels are updated if the player touches them with their controller

Going forward this should be expanded into a full ScreenManager class which controls each individual panel and chooses which is being updated when (perhaps based on which one is the closest the the player’s view, and so probably what they are interested in)

 

Ship/Planet selection

These are simply handled by using the hotkeys 1-9, hardcoded in Unity for mockup purposes to be the planet on 1 and the fleet on 2

 

Sending input to Stellaris

AutoHotkey moves the mouse cursor based on relative position of VRTK controllers over each panel

 

Loading Systems/Hyperlanes

The Stellaris save format can be converted to JSON via this tool, which allows VR-is to display an overlay of the map ontop of the main screen (seen in the video as pink hyperlanes)

 

Requested features

Player at the center of a holographic galactic map

Possible and pretty easy based on current features, placing the player in the center of the galactic map loaded from the save.json would allow them to interact with this holographic/resizable/rotatable map while the code transforms this input back into 2d screen space to click the mouse for fleet movement

 

Ship art based on the selected leader background

Possible I guess, just a lot of art work

 

Communication on main screen

Not sure how to detect when communication arrives, but otherwise easy to place in a panel in the scene somewhere

 

Home planet visible from windows

Possible but it would be a static view, due to only being able to have one camera!

 

Multiplayer, commanding the same empire

Possible by streaming Stellaris capture to all connected players, and sending back and input via AutoHotkey, however in this bodge solution they would quickly be overwriting/messing up each others commands as they all try to input at once

Maybe it would have to work like an old timeshare? Haha

 

Galactic community

I imagine this as putting on an AR headset overlay which would display the community voting chamber, and being able to see the actual empires in the balconies of the side they are voting for!

Unfortunately I don’t see how this could be possible currently other than trying to do image recognition on the empire flags, or just hardcoding it

 

Project navigation

Supports SteamVR currently but others would be easy to add due to VRTK

Assets/StreamingAssets contains all the AutoHotkey scripts:

  • panic.ahk – Useful in case you lock yourself in Stellaris through panel interactions (Ctrl+F1 will exit play mode in Unity)
  • resetview.ahk – Run when the player hits the “Reset View” button in VR, tries to recenter the view as top down and showing the whole galaxy

 

Required

Stellaris

Tom’s Hotkeys (Stellaris Mod – adds ability to open Tech panel on T)

OBS (May have to scale down output resolution due to resource intensity of Stellaris and OBS and Unity)

OBS-VirtualCam (Target “OBS-Camera”, no buffered frames)

AutoHotkey

Unity 2019.3.4f1

Stellaris Save to JSON

 

Related:

Portfolio Page