5dof support for TrackIR and improved 6dof for VR

A Forum dedicated to the Suggestion, Creation and Editing of XWA Dynamic Link Library Files

Moderator: JeremyaFr

5dof support for TrackIR and improved 6dof for VR

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

Post by blue_max » Mon Dec 30, 2019 7:17 am

I haven't had much time to work on XWA during these holidays; but after the hyperspace effect I finally understood how XWA's coordinate system works (more-or-less anyway). So I figured I could hijack the cockpit shake (that thing that happens when we get hit by lasers or get damage by engine wash) to support positional tracking inside the cockpit look hook. This is what it looks like:
6dof-cover.jpg
https://www.youtube.com/watch?v=UY93UgHgbcU

There's one drawback to this approach: we'll lose cockpit shake. So, if someone else has figured out a better way to alter the cockpit's camera position/translation, do please let me know :D

On the other hand, with this hack we get 5dof support for TrackIR (which I believe is pretty much the Endgame for TrackIR since I don't think camera roll would add much); and we also get a much better support for 6dof in VR. I don't actually have TrackIR, so the video above was recorded on the regular game and it's a simulation of what it's going to look like.

I've got one question for TrackIR users, though: which axis is "up"? Is that the Y+ axis perhaps? :P
You do not have the required permissions to view the files attached to this post.

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

Post by blue_max » Mon Dec 30, 2019 7:22 am

A couple more screenshots:
6dof-1.jpg
6dof-2.jpg

Also, thanks Jeremy for pointing out where the Gunner Turret orientation could be read from and keiranhalcyon7 for requesting that I fix the hyperspace effect for the Gunner Turret. Honestly, keiranhalcyon7's request took me several days of :kopfwand: but I think it was well worth it in the end :D
You do not have the required permissions to view the files attached to this post.

User avatar
Trevor
Ensign
Posts: 420
Joined: Thu Dec 04, 2014 7:11 pm

Post by Trevor » Mon Dec 30, 2019 12:53 pm

HOLLY Sh....!!!

It finally works without culling or clipping :):):):)

Cant wait to test and re-write the fov numbers again to match (since remember I "overscanned" to compensate for viewport clipping)

Trev

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

Post by blue_max » Mon Dec 30, 2019 5:22 pm

That's right, Trevor, no more clipping! (Unless of course, you actually lean so far that you end up outside the cockpit). Sorry; but yes, that means you'll probably have to adjust the FOV once again.

Also, I figured that maybe I could "park" my X-Wing and walk around it, and sure enough:
6dof-4.jpg
And it's also possible to duck below the dashboard:
6dof-3.jpg
6dof-5.jpg
My wife was probably wondering what the hell I was doing crawling on the floor :D
You do not have the required permissions to view the files attached to this post.

User avatar
Driftwood

Admiral (Moderator)
Posts: 2074
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Mon Dec 30, 2019 6:21 pm

Wow, this would definitely improve dynamic HUD functions if/when enough cockpits get reworked.

I dunno if losing cockpit shake is a big deal or not either way honestly. Maybe? I'll have to see...

User avatar
Vince T

Fleet Admiral (Administrator)
Posts: 12866
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Mon Dec 30, 2019 6:25 pm

Ah crap, this means I can no longer cheat by ommitting those faces you don't see in default cockpit view! :motz:

Looking really great! This makes the whole cockpit so much more vivid!
Your ship, Captain. I need a drink. - Vince Trageton

My Steam Workshop

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

Post by blue_max » Mon Dec 30, 2019 6:39 pm

General_Trageton wrote:
Mon Dec 30, 2019 6:25 pm
Ah crap, this means I can no longer cheat by ommitting those faces you don't see in default cockpit view! :motz:
I wouldn't worry too much about that. I checked several cockpits yesterday and none of them had any blank spots within a normal (sitting) motion range. The noseless X-Wing was the exception; but Darksaber fixed that several months ago (thanks again, DS!) It's only when I try to lean outside the cockpit, or walk around that I start seeing blank spots and none of these actions are regular use anyway.

BTW, the TIE-* cockpits are very small and feel somewhat claustrophobic. It's really easy to "bump your head" against the cockpit walls; but I think that's actually by design.

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

Post by blue_max » Mon Dec 30, 2019 6:55 pm

Forgot to ask: does anyone know what's the equivalence between in-game fixed-point units and meters? Empirically, it looks like it's somewhere around 400 in-game units to 1 meter.

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 577
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Dec 30, 2019 7:00 pm

Wow, that looks awesome!
blue_max wrote:
Mon Dec 30, 2019 7:22 am
Honestly, keiranhalcyon7's request took me several days of :kopfwand: but I think it was well worth it in the end :D
Hah! When I asked for that, I considered it as a "bonus objective". Looks like it's paying dividends!

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 577
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Dec 30, 2019 7:09 pm

blue_max wrote:
Mon Dec 30, 2019 6:55 pm
Forgot to ask: does anyone know what's the equivalence between in-game fixed-point units and meters? Empirically, it looks like it's somewhere around 400 in-game units to 1 meter.
I thought it was 65536 units = 1 mile (which is almost, but not quite, one inch per unit), as a legacy from the engine's decent from SWotL. That would be approximately 40 units per meter, though, not 400.

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2581
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 30, 2019 7:30 pm

The scale is 0.0244140625 (1 / 40.96)

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

Post by blue_max » Mon Dec 30, 2019 7:42 pm

Hmmm... Well, maybe the cockpit/X/Y/Z/Reference units are using a different scale then? ~40 definitely does not work :?

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2581
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 30, 2019 7:56 pm

Which variable are you referring to?

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

Post by blue_max » Mon Dec 30, 2019 8:44 pm

I'm referring to cockpitX/Y/ZReference in PlayerDataEntry:

Code: Select all

...
	__int16 pitch;
	__int16 yaw;
	__int16 roll;
	__int16 cameraRoll;
	__int16 cameraPitch;
	__int16 cameraYaw;
	int cockpitXReference;
	int cockpitYReference;
	int cockpitZReference;
	__int16 cockpitPitchReference;
	__int16 cockpitYawReference;
	__int16 cockpitRollReference;
...
My XWAObject.h is a bit old, so maybe they've been renamed. I'll post the offsets later when I get back home.

User avatar
JeremyaFr
Commander
XWAU Member
Posts: 2581
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Mon Dec 30, 2019 9:13 pm

The game engine multiplies these values by 0.0625.

0.0625 * 0.0244140625 = 0.00152587890625
1 / 0.00152587890625 = 655.36

It appears that scale is 655.36

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

Post by blue_max » Mon Dec 30, 2019 9:18 pm

That makes sense. Thanks Jeremy!

User avatar
keiranhalcyon7
Lieutenant JG
Posts: 577
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Mon Dec 30, 2019 10:53 pm

That makes sense. The 3d cockpits were a new feature in XWA, and ~one-inch resolution would be too coarse for positioning in the cockpits. 0.0625 is 1/16, so the scaling operations are very fast.

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

Post by blue_max » Tue Dec 31, 2019 9:41 pm

The Falcon's cockpit is large enough that you can actually walk around inside the cockpit a little bit:
6dof-6.jpg
6dof-7.jpg
6dof-8.jpg
Also, I've got a beta version that needs testing for TrackIR -- any volunteers?
You do not have the required permissions to view the files attached to this post.

User avatar
Driftwood

Admiral (Moderator)
Posts: 2074
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Jan 01, 2020 2:27 am

If you're looking to test the limits of your 5DOF try using the AEG-77 Vigo, its bridge is rather huge.

User avatar
Vince T

Fleet Admiral (Administrator)
Posts: 12866
Joined: Fri Apr 27, 2001 11:01 pm
Contact:

Post by Vince T » Wed Jan 01, 2020 8:47 pm

Geeze so after all it wasn't all for nothing building more complete interiors for some of my transport ships! A dream come true at last :D
Your ship, Captain. I need a drink. - Vince Trageton

My Steam Workshop

User avatar
Driftwood

Admiral (Moderator)
Posts: 2074
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Wed Jan 01, 2020 9:38 pm

General_Trageton wrote:
Wed Jan 01, 2020 8:47 pm
Geeze so after all it wasn't all for nothing building more complete interiors for some of my transport ships! A dream come true at last :D
Your corvette interior designs in fact came to mind when I saw the extent of the movement capabilities. You would be able to get rid of the multiple POV placement coordinates with this.

I am curious though, how little/much movement translates the view so radically?

And a thought I had was if you can implement head roll I don't think it would be a bad thing, being able to alter one's view naturally like in most modern simulators, ARMA, DCS, ect. makes a huge difference in comfort and performance. For me at least, it was always hard to play a modern sim and then jump into XWA with no head tracking at all. It's so static and it really is amazing how much situational awareness you lose not being able to, or at the very least jerkily be able to change your view.

As for losing the camera shake on collision/damage, can you copy the section of code and modify one to implement the 5DOF and keep the camera shake?

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

Post by blue_max » Thu Jan 02, 2020 12:56 am

Driftwood wrote:
Wed Jan 01, 2020 2:27 am
If you're looking to test the limits of your 5DOF try using the AEG-77 Vigo, its bridge is rather huge.
Where can I find this craft? In the DSUCP?

The extent/scale of motion is fully configurable. For the test above I actually had a factor of 3 because I don't have much room, so I was able to walk around the Falcon with a few steps. However, when I'm actually playing I like to keep something that is closer to a natural feel.

Head roll is currently implemented in VR as a hack because the edges cannot be seen anyway so it doens't matter; but I can't do that for non-VR users. However, for TrackIR I don't think head-roll is too relevant... unless I misunderstood your comment?

If it helps, most of the screenshots above where taken without VR or TrackIR support. The way I've got positional tracking setup is with a ping-pong ball glued to a green LED and a couple of PS3 Eye cameras. The whole setup is about $30 or so. I just attach the ping-pong ball to the VR visor or to a headband that I wear around my forehead using velcro. To turn around I just activate mouse look. I imagine that for people without TrackIR or VR, this ping-pong setup would actually make the Dynamic Cockpit more usable and it does help create an illusion of depth too.

I'll see if it's possible to recover cockpit shake due to damage *and* still have 5dof.

And yes, thank you guys for making such detailed interiors :D

EDIT: I figured that since I published the fix for the Dynamic Cockpit in a different thread, I might as well put it here too. So, here's the preview of 6dof (you'll need release 1.0.10 and then put these file on top):

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

Just be aware that the Dynamic_Cockpit.cfg file is customized to shrink the HUD. So, keep that file from version 1.0.10 if you don't want that effect.

Oh, and there might be bugs :P

User avatar
Driftwood

Admiral (Moderator)
Posts: 2074
Joined: Wed Oct 22, 2003 11:01 pm
Contact:

Post by Driftwood » Thu Jan 02, 2020 5:12 am

Vigo is up for download on my google page, also on DTM's website. http://www.mtdindustries.com/xwa/OPT/AE ... -03-18.zip

Other stuff is available on my google page also. https://sites.google.com/view/rebel-spe ... authuser=0

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

Post by blue_max » Sun Jan 05, 2020 6:31 am

I finally got the AEG-77 working. Thanks Driftwood! It's really fun to explore this bridge and it looks great in VR too:
AEG-77-bridge.jpg
That hologram in the middle appears to be floating in the air in VR. This cockpit is also going to be very helpful for a number of things soon...
You do not have the required permissions to view the files attached to this post.

TheLastStarfighter
Recruit
Posts: 7
Joined: Thu Dec 26, 2019 4:59 pm

Post by TheLastStarfighter » Wed Jan 08, 2020 10:45 pm

This is amazing work. Is it possible to play in a capital ship or at least watch it from a vantage point somewhere inside?

Post Reply