X-Wing Alliance VR mod

Need help editing the game? Check for help here!

Moderators: Darksaber, General_Trageton, Forceflow

Re: X-Wing Alliance VR mod

User avatar
ual002
Ensign
Galactic Empire
Posts: 287
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Thu May 16, 2019 6:01 pm

I had been putting of a VR headset, but this news right here is all I needed, I just hadn't played any real world flight sims in a while and I liked my track IR.

Any recommendations? I wanna go full ham if I'm gonna do this.
For the glory of his majesty Emperor Palpatine! Image

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu May 16, 2019 6:23 pm

I'm probably not the best person to recommend a VR headset -- my experience is limited to the PSVR and Google Cardboard. But anyway, PSVR is the cheapest and you can also use it for the PS4; but it also has the lowest resolution. Next up, I think, is the Oculus: it's more expensive; but has better graphics. I *believe* the top of the line is the Vive: the most expensive and the best quality. Someone else would have to fact-check these statements, though.

Now, here's the thing. Thanks to justagai, I was able to add native (but experimental) support for FreePIE in XWA. This means that the game can now read headtracking data directly from any source that is FreePIE-compatible. No more mouse-look mode. If your headset is compatible with FreePIE, you'll get the best experience. If not, you'll have to map headtracking data to mouse motion somehow. I believe some guys have been able to do this through Virtual Desktop and Oculus; but I don't know of anyone who has successfully done it with the Vive.

I plan to add native support for SteamVR too. By this, I mean that I want to read headtracking data from SteamVR and have XWA respond to it. But I'm not there yet. So, what I'm trying to say is this: if you buy a headset, you may not be able to apply headtracking to XWA directly yet. That may be a somewhat big disappointment if you just shelled out a few hundred dollars just to be able to play this game in VR. As part of your research effort, I would suggest checking for headsets that can map headtracking data to mouse motion or that can be read by FreePIE... Or wait a little bit to see if I can figure out how to talk to SteamVR.

User avatar
ual002
Ensign
Galactic Empire
Posts: 287
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Thu May 16, 2019 6:47 pm

Yea, several people in other circles are telling me Vive PRo for best resolution, but I believe that is tied to steam. So maybe I can just follow your progress here. If you start making SteamVR progress, I'll assume that means you're closer to proper Vive support. In the mean time, what sort of TrackIR support can FreePIE provide outside mouse tracking? Although a neat gimmick, mouse tracking solutions of the past didn't give me the immersion I was looking for.
For the glory of his majesty Emperor Palpatine! Image

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu May 16, 2019 9:44 pm

FreePIE provides absolute head rotation angles: yaw, pitch and roll. I read that directly and change the in-game camera to match your head's rotation (the game does not support roll, though -- maybe I can hack it in later somehow).

In other words FreePIE does not go through the mouse: you can look around even if mouse look is disabled in-game. In this way, the in-game rotation matches your own body's range of rotation too. No more fiddling with mouse sensitivity options, etc.

I'm not sure about TrackIR; but I guess TrackIR would be the input for FreePIE? I'm currently using an experimental build of Trinus PSVR to provide the input for FreePIE instead -- and so far it works great.

And yes, I'm trying to connect the game to the SteamVR tracking data. If you can wait a few more weeks, maybe this would be a better option.

User avatar
ual002
Ensign
Galactic Empire
Posts: 287
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Fri May 17, 2019 12:43 am

Im in no rush, and can test maybe with track IR if you get that working in the mean time.
For the glory of his majesty Emperor Palpatine! Image

Justagai
Cadet 1st Class
Posts: 154
Joined: Mon Dec 08, 2014 10:59 pm

Post by Justagai » Fri May 17, 2019 10:14 pm

I think the best bet with TrackIR would be to provide FreePIE scripts to hook the TrackIR data and then have the user download FreePIE to use the scripts. Getting a hold of the TrackIR SDK will require that you contact the developers in the first place unfortunately: https://www.naturalpoint.com/trackir/developers/

I think this would be a fair compromise and I hear there are scripts out there already that can do the job.

User avatar
Trevor
Cadet 1st Class
Posts: 130
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri May 17, 2019 11:04 pm

I believe some guys have been able to do this through Virtual Desktop and Oculus; but
Ah, I forgot to correct you on this.
Virtual Desktop does NOT provide mouse movement (though Virtual space does with the caveat of being stretched and in a fixed place in space (just like looking at a monitor)

When I have been testing the VR I have simply been using the mouse to look round.

the oculus would need its own api loaded to be able to use native head tracking.

Trev

User avatar
ual002
Ensign
Galactic Empire
Posts: 287
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Sat May 18, 2019 4:42 am

In the point of natural point and track IR they are really stingy with their code as i understand it.
For the glory of his majesty Emperor Palpatine! Image

Fek'LeyrTarg
Cadet 1st Class
Posts: 220
Joined: Mon Mar 03, 2008 12:01 am

Post by Fek'LeyrTarg » Sat May 18, 2019 1:55 pm

But there's also OpenTrack, which supports both Freetrack and TrackIR protocols:
https://github.com/opentrack/opentrack/releases

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat May 18, 2019 8:39 pm

I'm in the process of adding SteamVR support now. I can display some of the images through SteamVR (only the Concourse so far) and I can read the sensor tracking data; but I'm going to need to figure out how to convert the pose matrix returned by SteamVR into the correct yaw/pitch needed by this game (if someone knows how to convert OpenVR pose matrices into yaw/pitch, please let me know as that will save me some amount of trial-and-error here).

So, my guess is that once this is done, both Oculus and Vive headsets would be supported through SteamVR. PSVR users can either use Trinus PSVR or iVRy.

I'm currently experimenting with the the GOG version through SteamVR: Fun!

User avatar
Trevor
Cadet 1st Class
Posts: 130
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sun May 19, 2019 12:31 pm

Awesome I cannot wait to test the new version

Trev

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon May 20, 2019 5:49 pm

I was able to add support for SteamVR over the weekend; but the result is... well... crappy. OpenVR forces us to use of a blocking function that causes a severe drop in the framerate (it goes down to maybe 15fps). The problem is that OpenVR was designed for modern games where the game logic and rendering is performed in different threads. For XWA, this is all done in a single thread. After reading a lot of sources, I think I can solve this problem by creating a dedicated sub-renderer system that runs in a different thread.

Besides that, the lens distortion is handled by SteamVR and the end result is... also kind of crappy. The cockpits look more like paper cutouts than actual 3D. I think SteamVR is probably over-compensating for the lens distortion. I've got some ideas on how to fix that; but again... it was kind of disappointing.

Oh, and I'm experiencing gimbal lock quite literally when looking around using SteamVR. The matrix-to-Euler conversion formulas that I'm using have the side effect of locking your head forward. It's like there was this magnet at the center of the screen and if you look close to it, your head snaps to the center. This is totally my fault and can be fixed with better math, though.

Sadly, I can't just ignore SteamVR because my understanding is that Vive users have no option (?) I've read that as soon as Vive headsets are turned on, SteamVR runs (?) So, anyway, this is going to take a bit longer than I expected. I could probably release the FreePIE support in the meantime, though, since that hook is independent of SteamVR and it works really well.

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu May 23, 2019 6:42 am

I think I was able to solve most of the performance problems with SteamVR and added proper tracking. The performance is not as good as direct SBS; but it's playable. Here's a sample screenshot:
2019-05-22-PM_11_21_19.jpg
You do not have the required permissions to view the files attached to this post.

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu May 30, 2019 2:38 am

I've got an experimental build that supports SteamVR: it will work; but I'm not sure it will look good. In particular, I fear it may cause some eye strain. So, before issuing a formal release, I'd like some volunteers to help me test this on other headsets (looks good to me on a PSVR; but I'm aware it may not look good on other hardware).

Please contact me if you're interested in testing this experimental build.

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Jun 17, 2019 5:40 am


User avatar
ffaaway
Cadet 2nd Class
Rebel Alliance
Posts: 92
Joined: Mon May 05, 2003 11:01 pm

Post by ffaaway » Mon Jun 17, 2019 2:41 pm

blue_max wrote:
Mon Jun 17, 2019 5:40 am
Coming soon in the next release:

https://www.youtube.com/watch?v=wUD9ADy ... e=youtu.be
LOL WUT!? you got it working, incredible!!! Insanity!!! Inconceivable!!!
X-Wing pilot since 1993 and still kickin'

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Jun 17, 2019 5:34 pm

It's a bit hacky and it's not perfect; but yeah, 6dof works. I'll release it soon.

I think I can do something similar with TrackIR now. I would probably have to disable roll, though, unless people don't care about seeing gaps in the corners of the screen.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1515
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Mon Jun 17, 2019 10:55 pm

I personally would rather give up 6dof for aesthetics in this case. It's cool that it works. But it's entirely immersion breaking, and I don't like the result.

I do applaud your efforts though, if there was any way in the future to avoid the visual glitches, then I'd be all for 6dof

blue_max
Cadet 2nd Class
Posts: 65
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Jun 18, 2019 5:41 am

Head roll doesn't look that bad inside the HMD and it helps avoid some dizziness; but I see your point, Driftwood: it's very easy to break immersion by leaning. I've added some limits to try and prevent this; but 6dof will be optional and configurable by the users. On the other hand, I see value in leaning forward: it doesn't break immersion and helps make things readable in VR. But no worries, I'm trying to make all these details configurable and optional.

User avatar
Driftwood
Lieutenant Commander
XWAU Member
Posts: 1515
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Tue Jun 18, 2019 6:15 am

Well keep up the good work. Leaning forward makes sense, I'd just keep trying to figure out ways to keep from breaking immersion.

Maybe I'm being overly picky. I'm just glad track ir is now an option.

Post Reply