Daggerfall Unity VR with the Vive Pro

Discuss coding questions, pull requests, and implementation details.
User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul »

how do I activate the flail? I just see my hands in vr but not the flail... ;)

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

Just realized I didn't take the flail prefab out of the Untracked folder. Sorry about that. I'll fix it right away.

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

Done. There's no activation of the flail in the demo, it should just appear in your hand now.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul »

thank you - trying now ;)

now, I see the handle but not the chain and ball - collision/interaction with the objects seem to work though:

Image

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

Okay. Try now.

EDIT: Also, I just finished a first pass at a VR Weapons Manager. You can enter your character sheet, select a weapon, and it will spawn it (or actually a cube representing it) in your hand. Then if you throw it at an enemy, it will damage it with the weapon. Then you can pick it up again with the laser, or go back into the character sheet and unequip/reequip it to reset it back in your hand.
It's pretty rough, but you could technically play the game like this, lol. I'll put up a video later; I worked way too late and I need sleep.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul »

yeah now it works, thanks you ;)

this is really amazing. Swinging the flail feels good in vr!

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

Yay! I'm glad you like it :)

Always a good feeling when someone has fun with something you made :D

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

There's actually an interesting little hack I had to do in order to make the flail chain rotate toward the ball correctly. It turns out that SteamVR (or maybe OpenVR?) has some code somewhere that runs after all of the update functions, updating the position and rotation of the controller very shortly before rendering. Which makes sense, you want things to feel as tight and low-latency as possible in VR.

But that made it so that wherever I put the chain rotation code, it would always be a frame behind the actual transform data of the handle. It made it so that the chain was always lagging in front of or behind the ball. The fix was to slap a camera on the flail and execute the rotation code OnPreRender, lol.

Vwing
Posts: 16
Joined: Thu Aug 29, 2019 11:33 pm

Re: Daggerfall Unity VR with the Vive Pro

Post by Vwing »

So, I made a lot of progress in the last couple weeks. Finally feels playable, so long as you're okay with sticking to melee weapons. I even made it so the direction you hit an enemy correlates with the direction the weapon strikes :)

https://youtu.be/R340n1rKwls

The flail is the funnest weapon. I think bows will rival it once I incorporate the default SteamVR bow.

This might be a good time to build it as an actual mod and let everyone try it out. I made a few necessary changes to the base code, though. Once I've cleaned everything up a bit more, and incorporated the non-mod-specific code to my master, should I just go ahead and submit a pull request?


EDIT:
If you want to try it out, just pull from my VR branch and import this unitypackage containing the untracked models, textures, audio, etc.

You can play in the DaggerfallUnityGameVR scene.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Daggerfall Unity VR with the Vive Pro

Post by Nystul »

awesome! will give it a try soon! keep up the amazing work

Post Reply