[GZDoom] OpenVR virtual reality mode

Like feature suggestions, but you've actually written code to make it happen. More likely to make it into the game than some random request in feature suggestions.

Moderator: GZDoom Developers

Forum rules
Please see Code submission guidelines

GZDoom Status:
Image

Legacy Status:
Image Image

QZDoom Status:
Image
dpJudas
 
 
Posts: 3109
Joined: Sat May 28, 2016 1:01 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by dpJudas »

biospud wrote:I feel bad that I sickened the one other developer who has a VR headset.
Don't worry about it. I kind of knew that running around with max speed would eventually get me sick - it also happened with my own Descent clone, despite that in Descent I could only turn with a joystick. I didn't get THAT sick either, because I knew the symptoms meant NOW is the time to stop. :)

About the turn stuff, I don't know particular much about those parts of GZDoom. Maybe someone else knows.
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA

Re: [GZDoom] OpenVR virtual reality mode

Post by biospud »

dpJudas wrote:
biospud wrote:I feel bad that I sickened the one other developer who has a VR headset.
Don't worry about it. I kind of knew that running around with max speed would eventually get me sick - it also happened with my own Descent clone, despite that in Descent I could only turn with a joystick. I didn't get THAT sick either, because I knew the symptoms meant NOW is the time to stop. :)

About the turn stuff, I don't know particular much about those parts of GZDoom. Maybe someone else knows.
I updated my pull request today with positional tracking, and improved yaw rotational latency. It might be more comfortable now. Plus it's a bit more immersive. With the positional tracking I can now peek around pillars, and get on my hands and knees to closely examine the floor texture. I'm not sure if I will implement the snap turning now; to get the solid hmd rotational tracking latency, I got a side effect of sort of "snappy" controller turning.
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [GZDoom] OpenVR virtual reality mode

Post by Nash »

Theoretical question: what would happen if there is mod code that forcefully alters the player's angle, pitch and roll?

This is a popular technique that has been used for many years in a huge amount of already-released mods, especially weapon mods. They call functions from the weapon to throw off the player's view, simulating recoil, for example.

What's the best way to address this for VR hardware?
User avatar
Rachael
Posts: 13720
Joined: Tue Jan 13, 2004 1:31 pm
Preferred Pronouns: She/Her

Re: [GZDoom] OpenVR virtual reality mode

Post by Rachael »

Unfortunately, I think VR should just ignore it. I really see no point in disorienting the player further than they already will be just getting used to the VR controls. Being forced around is really going to cause problems - and it's bad enough with the pushbacks that players can suffer when hit by creatures.

Yes, that means roll, too. That'll really get you.
User avatar
Nash
 
 
Posts: 17454
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia

Re: [GZDoom] OpenVR virtual reality mode

Post by Nash »

Rachael - I think that's a great idea, actually. I see that even in recently VR'ified games (like Fallout 4 or Doom), it appears that they've removed all scripted camera animation from the games.

I get headaches playing on a normal monitor as it is, I don't need the pukefactor to be dialed to 11 once I put a headset on. =P
User avatar
Major Cooke
Posts: 8193
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: [GZDoom] OpenVR virtual reality mode

Post by Major Cooke »

Xaser's lost soulsphere gold edition changes the player's direction to be angled perfectly against two kill lines. If you turn in any way while in motion or move in any way, it'll kill you.

Winter's fury also has a part when finding the Baphomet in stasis, where the player looks up slowly, and then back down again.

Just two cases I can think of off the top of my head where that may cause conflict.

(God be with the mad man who goes VR and those really warpy shaders. It's safe to classify those people who can stomach both warping shaders from that one mod + VR + a full 32 map playthrough as having stomachs of adamantite. Someone out there will do it, just you wait. :P)
Gez
 
 
Posts: 17921
Joined: Fri Jul 06, 2007 3:22 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Gez »

If someone wants to play DOOD + Megabounce + Wobbly Shader in VR, they only have themselves to blame.
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA

Re: [GZDoom] OpenVR virtual reality mode

Post by biospud »

Nash wrote:Theoretical question: what would happen if there is mod code that forcefully alters the player's angle, pitch and roll?

This is a popular technique that has been used for many years in a huge amount of already-released mods, especially weapon mods. They call functions from the weapon to throw off the player's view, simulating recoil, for example.

What's the best way to address this for VR hardware?
There is a partial solution to this problem. The OpenVR virtual reality mode completely overrides the console player camera's pitch and roll angles, to minimize tracking latency. This is called "late scheduled" tracking. This late tracking approach will prevent those mods from rapidly making the player ill with those forced head rotations. But it will also prevent the gameplay value of those motions from being achieved.

The treatment of the yaw view angle is more complicated. Ideally, to avoid motion sickness, non-headset changes to yaw should be avoided too. But adjusting the yaw angle with mouse, keyboard, and controllers is such an integral part of the game, that some compromise must be reached. Frankly I'm still experimenting with finding the best approach to the yaw angle. I'm still struggling to understand the lag and interpolation that occurs with the angle, and how to distinguish yaw changes resulting from headset motion, from changes that come from other sources.

I recall with GZ3Doom that the mod "Call of Dooty 3" has a camera shake effect that is simply a horrible experience in VR. For certain mods like that, VR might be best avoided.
User avatar
Formic.Sapien
Posts: 21
Joined: Thu Jun 15, 2017 6:20 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Formic.Sapien »

HEY Y'ALL! I'm new here, and haven't done much coding before, but I'm EXTREMELY motivated to get GZDoom working properly in VR! I have a capable computer and a vive, I'll be able to test, and maybe some other things.

EDIT: I posted this below, but I can't figure out how to merge a pull request for github builds.
Last edited by Formic.Sapien on Thu Jun 15, 2017 10:57 pm, edited 1 time in total.
User avatar
Formic.Sapien
Posts: 21
Joined: Thu Jun 15, 2017 6:20 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Formic.Sapien »

Other items to be implemented later:
* positional tracking
* render 3D motion controller models
* late scheduled tracking of yaw angle (in menu mode, yaw is not updated)
* always render weapon as if screenblocks was at max
* force/default VR-appropriate settings
* movebob 0
* multisampling on
* gl_billboard_faces_camera true[/quote]

Would you like me to try and assemble (or make? I know a bit of Blender) the weapons? Someone has probably already made them I would predict.
User avatar
Formic.Sapien
Posts: 21
Joined: Thu Jun 15, 2017 6:20 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Formic.Sapien »

There are several people that have made the doom weapons in 3d already. I suppose I could assemble them for you guys to try out. Maybe I could work on getting permission for using them too? I may be able to edit them a little too. I'm not that experienced with modeling and texturing though.

Another thing: I'd love to test your builds for you with my vive, but I have no idea how to build a pull request from github.
User avatar
biospud
Posts: 206
Joined: Mon Oct 14, 2013 2:19 pm
Location: California, USA

Re: [GZDoom] OpenVR virtual reality mode

Post by biospud »

Formic.Sapien wrote:There are several people that have made the doom weapons in 3d already. I suppose I could assemble them for you guys to try out. Maybe I could work on getting permission for using them too? I may be able to edit them a little too. I'm not that experienced with modeling and texturing though.

Another thing: I'd love to test your builds for you with my vive, but I have no idea how to build a pull request from github.
I havent tried any 3d weapons but I predict that preexisting ones would end up being the wrong size in VR.

I'll try to make you a custom build next week if you are still interested in testing.
User avatar
Formic.Sapien
Posts: 21
Joined: Thu Jun 15, 2017 6:20 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Formic.Sapien »

biospud wrote:
Formic.Sapien wrote:There are several people that have made the doom weapons in 3d already. I suppose I could assemble them for you guys to try out. Maybe I could work on getting permission for using them too? I may be able to edit them a little too. I'm not that experienced with modeling and texturing though.

Another thing: I'd love to test your builds for you with my vive, but I have no idea how to build a pull request from github.
I havent tried any 3d weapons but I predict that preexisting ones would end up being the wrong size in VR.

I'll try to make you a custom build next week if you are still interested in testing.
I would love to test, so yes please! If you don't mind, I could have some friends check it out too (doom fans).

As for the weapons: So are you anticipating creating the weapons yourself? Or would you be interested in existing models (which I'm sure can be resized/tweaked)? If you do want them created from scratch I could at least start working on them.
Here's some of my work submitted to the steam workshop, they're not great, but I made them from scratch myself:

http://steamcommunity.com/sharedfiles/f ... s/?id=2963
http://steamcommunity.com/sharedfiles/f ... d=80954930
http://steamcommunity.com/sharedfiles/f ... s/?id=2672

As for the weapon model's disk space size, will GZDoom devs limit their size, are they okay with that extra space in the main?
User avatar
Formic.Sapien
Posts: 21
Joined: Thu Jun 15, 2017 6:20 pm

Re: [GZDoom] OpenVR virtual reality mode

Post by Formic.Sapien »

Don't bother with the build, I got it working. Apparently when you open a pull request on the github desktop it changes the files on your computer at the same time. I built from that. I don't know if it's my build or not, but I don't get a 3D options in the display options menu. I had to turn it on with the launch option (+ vr_mode 10). Is this what supposed to happen, or is something wrong with my menu?

EDIT: I'm sure there's a way have the game interpret the motion controllers as a mouse which is the first step, but the trick will be getting them to output where to fire independent of the direction of the screen, and it'll have to move independently of the Yaw. Would a good solution be to map the whole screen to the controller/weapon, blank the Hud? Then have the perspective of the user be a different entity entirely tracked with the HMD, and then have the hud elements attached to it secondarily? I guess it would depend on what's more difficult: making weapons fire NOT in the center of the screen or creating a 3rd person camera-like display for the HMD. Seems like the latter solution would mess with taking damage so it's probably a bad idea. Maybe if the interpretation area for damage could be modified too.

EDIT 2: First, sorry if you feel like I'm stepping on your toes with this. I realize I may be just stating the obvious. Anyways, if this'll have to be it's own distribution anyways, can you ship it with some setting set by default. It'll be difficult to ensure everyone is turning off their motion bob, and changing the correct mouse settings.
User avatar
RABID
Posts: 2
Joined: Sun Jun 18, 2017 10:46 am

Re: [GZDoom] OpenVR virtual reality mode

Post by RABID »

hey, just wanted to volunteer for testing. i have An Oculus CV1 with touch controllers and and have played about 200 hours of Doom and Doom mods in VR.

Return to “Code Submissions”