X-Wing Alliance VR Mod Released

Want to edit the game, build your own craft and missions? Here you'll find help, tools, guides and people to discuss with.

X-Wing Alliance VR Mod Released

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri May 03, 2019 6:21 pm

Update: The fully-functional release is here:

https://www.dropbox.com/s/es445xceyzpgs ... 2.zip?dl=0

I still call it a "Beta" because it needs more testing; but everything seems to be working now: the campaign, the skirmish mode, the Tech Library, even the external mode.

https://youtu.be/cnUuERqFPqs
Screenshot (272).png
You do not have the required permissions to view the files attached to this post.
Last edited by blue_max on Mon May 06, 2019 6:17 am, edited 1 time in total.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Sun May 05, 2019 7:23 am

Unfortunately I am unable to test it, but I am very curious to read the opinion of those who, like you, have the PSVR or something similar at home.
If you agree, I would like to insert the link of your final release in the "For beginners" topic. I would like to expand that topic inserting useful information about new devices, such as the VR and Track IR.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun May 05, 2019 7:27 pm

Oh, this isn't the final release of this mod -- it's a second beta. It still has a few glitches that I'm fixing right now. But yes, it's probably a good idea to at least place a link to this topic in the "For Beginners" area. Thanks!

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon May 06, 2019 6:19 am

Screenshot (281).png
Screenshot (267).png
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon May 06, 2019 6:21 am

I just tested this with Trinus Cardboard VR and it works. So, Google Cardboard + Trinus Cardboard + Compatible Cell phone can also be used.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Tue May 07, 2019 9:39 pm

I have a couple of questions,
what does stereoscopy_strength = 3.0 actually change?
I know it moves the left and right camera apart, but by what amount?
If it moves 1 cm then this should be called "Interocular Distance" (Usually 6-8cm) (I assume cm because the moves seem quite large when altering at runtime)

Also, I noticed you have the ability to separate text and hud from the view, could this be used to scale the hud seperatly (to allow the view to take up more screen "surrounding" you while having the hud in the middle and visible) and could text be darkened for re-shade so it doesn't bloom (this would be a great start to making XWA fully Post-Process Effect Compatible, i.e., blooming only lights and not everything over x brightness)

but so far, its working great.

To work in Oculus Rift, you need to use Virtual Desktop and SBS Direct.

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue May 07, 2019 10:30 pm

Hello Trevor, thanks for taking the time to check this mod! So, Virtual Desktop + SBS Direct for Oculus Rift. Thanks!

Yes, the stereoscopy_strength is roughly equivalent to IPD: it does move the cameras away from each other. A value of 0 leaves them at the same spot, so you get a flat view. I didn't want to use any real-life units because I don't have a reliable way to convert them.

Were you able to run the VR mod with ReShade? Would you mind posting pics?

I'm not sure I understand what you mean by scaling the HUD. Do you want the aiming HUD to be smaller; but on the same spot? I think I can do that for the regular laser HUD; but the Warhead HUD may not be so easy since it has text.

I can totally make the HUD and text darker to avoid bloom on those elements. It should be relatively easy to do, give me a couple of days and I'll post a new version with this feature. Also, if you could perhaps post a picture with bloom in it and point at the problem areas I'll see if I can fix them all.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed May 08, 2019 12:55 pm

So my suggestion on IPD regarding " I didn't want to use any real-life units because I don't have a reliable way to convert them." would be:
Measure the co-ordinates used in the x-wing and assume a 1.8m person is sitting there.
if the cockpit is say 150 units tall then we can safely assume each unit is 1cm, likewise if the cockpit is 1500 units then each unit is a mm.
then adjust your code to move the cameras by these units and document that they are either cm or mm etc. (also, if both cameras move then either move them by 1/2 a unit each or state ipd must be multiple of 2. (2,4,6,8,10 where most people will either use 6 or 8)
To use any other ipd detracts from the VR aspect and simply makes it a "cheap 3d effect".

Yeah, Re-shade is currently running and its fine, though I don't have any filters on because at present they detract from my experience - however I can post an image showing blooming text and mock up an image without blooming text.

So, scaling the HUD seperatly from view, what I mean is, at present to see the hud I have a square in the center of my vision.
To be immersed in VR I ideally want the view to wrap round me (110' with fov = 110' too) however, at present the hud disappears.
if the hud could be scaled seperatly (by hud I mean everything, the Targeting and text panels, radar, energy bars etc) I could scale it back to my center vision whilst maintaining the wraparound fov.

Trev

P.S. Hopefully this mod continues to grow and mature at which point I would hope Jeremy would pull your code together so we just have 1 ddraw for xwa, that way everyone is singing from the same song sheet VR or otherwise hopefully just a Boolean in the cfg file.

PPS.
It appears as though PreserveAspectRatio needs to be 0 in ddraw.cfg to work correctly (otherwise it scales smaller screens to fit, which makes things taller than they should be even with your aspect ratio key.

Another suggestion to Separate HUD scaling is text size.
At 1920x1080 the text is fine on monitor, but unreadable in VR, so the only readable scale is at 640x480 which unfortunately makes the rest of the view blury.
so it would be good to have text bigger and in view

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed May 08, 2019 5:09 pm

Thanks for your feedback Trevor. Yes, I guess I can estimate the IPD like you're saying. Shouldn't be too hard after all.

I think I can scale all the HUD like you're saying. It'll look a little weird because you'll see the corners of the HUD floating in front of you; but yeah, I think I can do that.

PreserveAspect ratio is very tricky. Did you try scaling the screen size to compensate? I think there's even a key combination to adjust that in-game. If possible, could you post an image of this problem so that I get a better idea of what you're seeing?

About the text size, again, a picture would help a lot. However, I do know that it's really hard to read text near the borders when wearing the PSVR (I run it on 1920x1080). If I scale down the whole HUD *and* the text maybe that problem will go away.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Wed May 08, 2019 5:53 pm

BTW, I *will* continue to work on this and I'm in the process of setting up a github account to upload the source code, etc. Anyway, yesterday I added a new setting in vrparams.cfg to dim the text. You can download the new version here:

https://www.dropbox.com/s/ury8ogay5ez0k ... 3.zip?dl=0

But, again, it would be easier to see a screenshot with the bloom effect to see what else needs to be fixed. I'm guessing the whole HUD will have to be dimmed (which I think I can do as well).

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Wed May 08, 2019 7:54 pm

Here is a mock-up of reduced hud.
I suppose it does look odd, but its the only way to actually use it within VR :P
XwingAlliance 2019-05-08 18-35-12.png


I also have an image showing re-shade working with vr
XwingAlliance 2019-05-08 19-17-05.png

Trev
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Thu May 09, 2019 1:00 am

Thanks for posting the pictures, Trev -- and thank you for your patience in explaining these things to me. Yes, I think I can scale down the HUD. Maybe in a future release someone could re-work the HUD textures so that they look less odd when reduced like that.

The bloom looks great in the second picture. The key to get this done properly is to capture the screen buffer *before* any of the HUD is rendered, use that buffer for ReShade and then render the GUI on top. I must solve that problem...

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Thu May 09, 2019 7:52 pm

yeah, although ideally you want to apply bloom only to lights and specular reflections (of which xwa doesn't seem to support except for software mode on glass and tie fighter panels)
To make this a reality one would need a way of identifying Light textures and apply bloom only to them

Heres another more correct view from the Oculus Rift with its 110 degree FOV
Also, meant to mention in image that aspect was calculated by
1920/2 = 960
960/1080 = 0.88

Also, HWA hacker decided to give the HUD a scale of 1.2 because I used 640/0.8 = 720 (so xwa could partially re-position the hud to match the output aspect ratio) though in retrospect I would rather keep the HUD as 4:3 in the middle of view.
Ill re-post a screen later
{EDIT] HUD won't change with xwa hacker options, but scaled to 1 at 640x720 works good for vr
Also, xwa hacker fov is "vertical" and the DK2 has 110 vertical, but the cv1 only has 90, so check your fov and match
XwingAlliance 2019-05-09 18-35-12.png
Trev
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri May 10, 2019 5:36 am

Hey Trevor, thanks for posting all that information. Honestly, I'm not sure I followed all the technical details. Could you perhaps send me your vrparams.cfg file? I also have no idea how to change my FOV. Sorry, I'm afraid I'll need a litle help here. These last pictures you posted of the A-Wing cockpit, I assume they are mock-ups too, right? Because otherwise I have no idea how you managed to scale *just* the HUD when it took me quite a while to achieve the same effect...

Anyway, here's a new version of the DLL:

https://www.dropbox.com/s/8fyqsm9x0qis2 ... 4.zip?dl=0

In this version I'm using cms for the IPD, as you suggested (so your previous vrparams.cfg file will need some editing). When you press Ctrl+Z only the HUD is reduced instead of the full cockpit -- so you can remain immersed while still seeing all the HUD:
reduced-HUD-1.jpg
reduced-HUD-2.jpg
and finally, I added a VR param to dim the text and HUD -- that should help a little bit when applying Bloom.

BTW, when I added the Ctrl+Z command, I only meant that as a temporary thing -- to check your bearing or read stuff. I didn't expect people to play the full game on that mode. But since you brought that point up, I guess it's important. Anyway, in the future I envision some talented modeler modifying the cockpits to add panels that I can detect so that I can project the text and HUD to those panels. But at this point, I guess we'll have to reach a compromise. Of course, this would all be much easier if we had the source code for the game...

It *is* possible to catch when the graphics engine is going to draw the glow and the lasers so that the bloom can be constrained to these elements. The individual draw calls must load the proper textures first. However, if I understand correctly, every spaceship has its own custom glow textures (maybe some modeler here can confirm this?) -- which means that it's going to be *very* tedious to gather *all* of them and compute their CRCs with the algorithm that I used. Tedious; but not impossible. Computing the CRCs for the lasers is going to be easy because there's really only 3 of them (although the craft pack has several options here).

There's probably another option. All glow textures (and other details, like the crystal on the cockpits) are rendered with ZWrite disabled *before* the HUD is rendered. I guess it's not impossible to detect when the game has disabled ZWrite but hasn't yet drawn any HUDs. That would mean that the game is drawing the glow and thus the bloom effect can be applied. This would save us the tedious business of collecting all the glow textures; but I would still have to manually gather all the laser textures.

Anyway, I was able to separate the GUI from the 3D content, that means I'm one step closer to rendering bloom *only* on the 3D elements without having to dim the HUD. So, hang in there, maybe I'll be able to post a nice bloom effect in the upcoming weeks...
You do not have the required permissions to view the files attached to this post.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri May 10, 2019 6:17 pm

Uh Oh.... your latest dll causes
Annotation 2019-05-10 190437.jpg
Annotation 2019-05-10 190421.jpg
I also have no idea how to change my FOV
To do this you need XWA Hacker and at the top you choose what the 5 preset resolutions are. The third option is FOV (after width and height) which is followed by Hud Scale (which has a max value of 1.49 otherwise text screws up)
These last pictures you posted of the A-Wing cockpit, I assume they are mock-ups too, right?
Yeah I took two sequential screenshots with HUD on and then cockpit off then combined.

Trev
You do not have the required permissions to view the files attached to this post.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri May 10, 2019 10:28 pm

Thanks for reporting the bug, Trevor. I didn't touch that part of the code for this release. So I'm a bit confused as to why it broke now. When does this happen? When the game starts? Did you try to change the resolution at some point? Did you modify something in ddraw.cfg?

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri May 10, 2019 10:30 pm

Also: the vrparams.cfg file is no longer compatible with the previous version. Did you try deleting this file before testing this new release?

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Fri May 10, 2019 11:02 pm

yip, deleted vrparams but still crash on boot.
re-tested standard draw (Jeremy) and it loads fine.

According to your changelog I didn't have the last version but either 0.9.0 or 0.9.1 so any change thereafter could cause the error.

Trev

edit, OK, so I just downloaded them all and tested.
It was 0.9.0 I had that worked, all others fail with said msgbox's (2, 3 and 4)

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri May 10, 2019 11:09 pm

I see, that makes more sense. Thank you for your patience, Trevor. Time to debug my code!

User avatar
Driftwood
Admiral (Moderator)
Posts: 2174
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Fri May 10, 2019 11:37 pm

Two things;

1. ypothetically could the HUD be modified to either have the "frame" bits made translucent, and/or alternatively could the HUD elements be edited and/or combined into something translucent vaguely resembling the helmet visor as seen from the inside. Ie, holographic-ally displayed on the inside of the pilot helmet visor. I think this would just require editing the .dat files relevant to the HUD elements, and obviously some creative editing would be required either way to get a desirable effect.
And only perhaps shrink the HUD down to the point of being at the edge of the POV so it's not as obvious where the frame ends?

2. Trevor, could you post your Re-shade config files and version number. I can't remember if I've asked this question before, but it looks like you've got a pretty good configuration going.

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat May 11, 2019 2:06 am

@Trevor: I couldn't reproduce your problem on my desktop nor my laptop. Are you running ReShade? If so, could you try and remove it just to see if that's causing the problem? I'll post another version soon that adds a more descriptive error message.

@Driftwood: That's a good idea! Yes, it's possible to replace the background HUD elements and make them translucent as you describe. I probably could replace these elements at run-time without editing the .dat files; but I guess we need someone with more artistic skills to prepare these textures. The HUD can already be scaled down or up to suit individual preferences.

User avatar
Trevor
Lieutenant JG
Posts: 541
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Sat May 11, 2019 9:56 am

I've tried everything and it still doesn't work...
Ill wait for your "debug" version :P

Trev

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat May 11, 2019 6:42 pm

Hey Trevor, thanks for your patience. I really tried to reproduce your problem; but it only happened if I used some absurd values for the offscreenBuffer. I sent you a PM with a link so you can download another version with a little bit of extra debug information. It's probably better to continue the conversation through direct messages. In any case, I'm rebasing my mod using Jeremy's master branch, so maybe that'll help fix these issues.

User avatar
DTM
Fleet Admiral (Administrator)
Posts: 2119
Joined: Tue Apr 22, 2003 11:01 pm
Contact:

Post by DTM » Mon May 13, 2019 6:16 pm

I just bought a google cardboard and installed Trinus. After entering the mod, xwa is divided into two screens, for right and left eye, as seen in your screenshots. Trinus also splits the image into two screens, so xwa now has four screens...but I'm human, with only two eyes ... what's wrong with me?

User avatar
blue_max
XWAU Member
Posts: 2295
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon May 13, 2019 6:58 pm

You need to set Trinus to "VR Conversion" and uncheck "Generate SBS". The other option is to set Trinus to "Legacy VR Mode" or "Non-VR" mode where only the mouse is moved but nothing happens to the video output. Sorry, I don't remember the exact names of these options and I've got two versions of Trinus; but it's something like that. I can post some images of the setup I'm using later if you need them. You'll also have to adjust the mouse sensitivity on windows (set it to something low to begin with) and maybe increase the smoothing filter in Trinus as well (I think I use 9.5 for the mouse smoothing). Be warned though: the image quality may suffer a little bit due to the compression.

I'm working on adding native FreePIE support to XWA. If that works, maybe we'll have a better solution for head tracking in the future.

Post Reply