New High-Res Hyperspace Effect

Need help editing the game? Check for help here!

Moderators: Darksaber, General_Trageton, Forceflow

Re: New High-Res Hyperspace Effect

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1796
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Fri Dec 06, 2019 8:18 pm

blue_max wrote:
Fri Dec 06, 2019 7:39 pm
Is there a way to tell when we're in the turret or in the regular cockpit? Something like a boolean or flag in XWA's memory?
Hello,
There is a TurretIndex field in the players table (a word value at offset 0x219 in the player struct) that indicates which turret is active (0: cockpit view, 1: first turret, 2: second turret ).

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Fri Dec 06, 2019 10:35 pm

JeremyaFr wrote:
Fri Dec 06, 2019 8:18 pm
Hello,
There is a TurretIndex field in the players table (a word value at offset 0x219 in the player struct) that indicates which turret is active (0: cockpit view, 1: first turret, 2: second turret ).
Thank you Jeremy! So that means we can have multiple turrets -- each with its own orientation. I wonder if the camera's orientation is updated by the game for each turret position too.

User avatar
keiranhalcyon7
Ensign
Posts: 361
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Sat Dec 07, 2019 3:28 am

That RotJ-style effect looks great! Do you have a link for the hyperspace exit?
blue_max wrote:
Fri Dec 06, 2019 7:39 pm
keiranhalcyon7 wrote:
Thu Dec 05, 2019 7:39 pm
Also, it would be really super awesome if you could make it look correct in prologue mission 2, where they force you into the turret.
I haven't played this mission yet; but let me guess... If we're in the turret maybe we see the hyperspace trails coming from one side (which would be correct); but then we see the hyperspace tunnel in front of us (which would be wrong). Is that the problem here?

Is there a way to tell when we're in the turret or in the regular cockpit? Something like a boolean or flag in XWA's memory?
That is exactly the existing game behavior.
blue_max wrote:
Fri Dec 06, 2019 10:35 pm
Thank you Jeremy! So that means we can have multiple turrets -- each with its own orientation. I wonder if the camera's orientation is updated by the game for each turret position too.
I suspect that whether you're in a turret or the cockpit is less relevant than the difference between the camera facing vector and the ship's facing vector.

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Dec 07, 2019 6:36 am

keiranhalcyon7 wrote:
Sat Dec 07, 2019 3:28 am
That RotJ-style effect looks great! Do you have a link for the hyperspace exit?
Yeah, I've been looking at how the hyperspace exit looks like in ROTJ from the links posted above and the trails begin long, they have a distinct bluish tint and then they speed away. This is what I've got:

https://www.shadertoy.com/view/3l3GzN
keiranhalcyon7 wrote:
Sat Dec 07, 2019 3:28 am
blue_max wrote:
Fri Dec 06, 2019 7:39 pm
I haven't played this mission yet; but let me guess... If we're in the turret maybe we see the hyperspace trails coming from one side (which would be correct); but then we see the hyperspace tunnel in front of us (which would be wrong). Is that the problem here?
That is exactly the existing game behavior.
Hmmm... has it always been like that?
keiranhalcyon7 wrote:
Sat Dec 07, 2019 3:28 am
I suspect that whether you're in a turret or the cockpit is less relevant than the difference between the camera facing vector and the ship's facing vector.
True, hopefully the game updates the camera position accordingly. If so, then yes, the effect can probably be fixed.

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Dec 07, 2019 9:34 pm

keiranhalcyon7 wrote:
Sat Dec 07, 2019 3:28 am
I suspect that whether you're in a turret or the cockpit is less relevant than the difference between the camera facing vector and the ship's facing vector.
I just checked and the camera gets reset to (0, 0) when the turret is activated, so I can't use that. I tried looking at the yaw/pith/roll in PlayerDataTable; but they correspond to the current craft's heading, not the turret.

I can see the flag that Jeremy pointed out getting set properly; but has anyone figured out where the current turret's orientation is stored?

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1796
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sun Dec 08, 2019 12:30 pm

There is a gunner matrix (9 short values: Front, Right and Up vectors) in the player struct at offset 0x21E.

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sun Dec 08, 2019 6:33 pm

JeremyaFr wrote:
Sun Dec 08, 2019 12:30 pm
There is a gunner matrix (9 short values: Front, Right and Up vectors) in the player struct at offset 0x21E.
Awesome! I'll take a look. Thanks Jeremy!

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Mon Dec 09, 2019 9:26 pm

I've updated the shaders a litle bit and added support to look around with the mouse:

https://www.shadertoy.com/view/3l3Gz8
https://www.shadertoy.com/view/WdyXDR
https://www.shadertoy.com/view/3l3GzN

I may be able to fix the hyperspace effect while using a Gunner Turret, and maybe I could even enable mouse look while jumping through hyperspace... I would need to update the mouse look; but... maybe.

User avatar
General_Trageton

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

Post by General_Trageton » Mon Dec 09, 2019 10:04 pm

Looking really great now!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's Modding HQ | Blue Phantom Chronicles WIki | My Steam Workshop

Rookie_One1
Lieutenant Commander
Rebel Alliance
Posts: 1398
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Mon Dec 09, 2019 10:06 pm

I wonder how hard it would be to fix the turrent orientation while we are at it (logically speaking, the bottom of the turret should point toward the front of the ship)

Concerning the effects, they really look great, only thing I think could make it better at that point is making the tunnel a bit darker, but other than that it look great!
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Dec 10, 2019 12:53 am

Rookie_One1 wrote:
Mon Dec 09, 2019 10:06 pm
I wonder how hard it would be to fix the turrent orientation while we are at it (logically speaking, the bottom of the turret should point toward the front of the ship)
Could you please elaborate a little bit on this point? I'm using the YT-1300 Corellian Transport from Prologue Mission 2 to test this, and I noticed that the "horizon" is rotated by 90 degrees with respect to the cockpit. Is that what you mean here? If I understand correctly, the turret is the one on top of the YT-1300; but I could be wrong (Is it on the side? Or the bottom?)

User avatar
keiranhalcyon7
Ensign
Posts: 361
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Tue Dec 10, 2019 1:45 am

Rookie_One1 wrote:
Mon Dec 09, 2019 10:06 pm
I wonder how hard it would be to fix the turret orientation while we are at it (logically speaking, the bottom of the turret should point toward the front of the ship)
While I agree, this isn't the place to do that. The place to do that would be in the turret arcs for the Corellian transports.
...only thing I think could make it better at that point is making the tunnel a bit darker, but other than that it look great!
I think the tunnel brightness at the perimeter is fine, but I would reduce the size of the white fade in the center. I might also suggest making the tunnel texture evolve over time, so that the tunnel itself doesn't look so static.

The exit animation is still wrong for RotJ-style; the star streaks do not whiz past at any time in the movie version of the exit effect. They just collapse from streaks to points.

Rookie_One1
Lieutenant Commander
Rebel Alliance
Posts: 1398
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Tue Dec 10, 2019 4:53 am

Sorry, was just thinking for the turret arcs.

For the exit animation, Keiran is right, they are collapsing, it's just that they are collapsing the other way from ANH(instead of collapsing forward from the pov of the pilot, they are collapsing toward the pov of the pilot)

https://youtu.be/f38a6pYL_jE?t=58

That said the original game animation does make the the streaks whiz past and the ROTJ animation does make it look that way at first(although in ROTJ case, it's only an impression)
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

Bman
Lieutenant JG
Posts: 735
Joined: Mon Apr 05, 2004 11:01 pm

Post by Bman » Tue Dec 10, 2019 6:22 am

Question... the current hyperspace animation is driven by .dat file. Will that conflict with this project ? If so, I suppose the images in the .dat file could be replaced with transparent (black) and resized to 8x8 pixels to save memory. Looks great by the way.
W-I-P: ISD-II, XQ-1 Platform1, (Imp) Escort Carrier, Misc, & TFTC.

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Tue Dec 10, 2019 7:46 pm

I must admit it is very hard to distinguish between the trails zooming past or just shrinking to stars in the final stage; but that shouldn't be too hard to fix. I'm also working on an updated version of the tunnel with 3D noise to make it less repetitive (and keiran is also helping me too, thanks BTW!)

No OPTs ot DATs were harmed in the making of this effect. I can make it toggleable at runtime if necessary so that you can switch back and forth between the original jump and this one. If no one is interested in the original jump effect anymore, then yes, I guess the DAT file could be replaced; but I doubt the storage gain would be significant. I'd rather keep the current DAT.

User avatar
keiranhalcyon7
Ensign
Posts: 361
Joined: Tue Jan 02, 2018 6:41 am

Post by keiranhalcyon7 » Thu Dec 12, 2019 7:35 am

After exchanging some PMs, blue_max and I have arrived at this tunnel effect:

https://www.shadertoy.com/view/Wtd3Wr

This uses a 3d noise function to allow the tunnel texture to evolve over time rather than simply rotating and passing by, as well as the swirl effect from the previous version and some color tweaks.

User avatar
General_Trageton

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

Post by General_Trageton » Thu Dec 12, 2019 8:17 am

Sweeet!
Your ship, Captain. I need a drink. - Vince Trageton
Vince T's Modding HQ | Blue Phantom Chronicles WIki | My Steam Workshop

Rookie_One1
Lieutenant Commander
Rebel Alliance
Posts: 1398
Joined: Thu Feb 26, 2004 12:01 am

Post by Rookie_One1 » Thu Dec 12, 2019 2:06 pm

Do like!
Rookie One, is that you?? - Ru Merleen, Rebel Spy at Imdaar Alpha
Current Holder of the Frying Pan of Death

User avatar
Darksaber

Fleet Admiral (Administrator)
Posts: 10422
Joined: Mon Jan 10, 2000 12:01 am
Contact:

Post by Darksaber » Thu Dec 12, 2019 2:46 pm

Nice
“You can please some of the people all of the time, you can please all of the people some of the time, but you can’t please all of the people all of the time”.”
- John Lydgate

Good Things Come To Those Who Wait....
Darksaber's X-Wing Station

User avatar
ual002
Lieutenant JG
Galactic Empire
Posts: 529
Joined: Wed Sep 24, 2008 2:23 am

Post by ual002 » Fri Dec 13, 2019 3:26 am

I've always wanted a player prompt to return to realspace while in the hyper tunnel. That way even though the other actors would still being going about their business, if I needed to hop up for a drink or restroom, I could do it in "hyperspace".
For the glory of his majesty Emperor Palpatine! Image Image Image Image

rogue518
Commander
Posts: 2098
Joined: Wed Jul 12, 2000 11:01 pm
Contact:

Post by rogue518 » Sat Dec 14, 2019 1:15 am

Looking Good!!!

Sincerely, Rogue518
'Stay in Attack formation!' Darth Vader aka: Anakin Skywalker During the 'Battle Of Yavin'

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Dec 14, 2019 9:15 am

ual002 wrote:
Fri Dec 13, 2019 3:26 am
I've always wanted a player prompt to return to realspace while in the hyper tunnel.
I don't think this is possible right now; but maybe with some specialized hooks later?

Thanks for your comments guys, and thanks to keiranhalcyon7 too for helping with the tunnel effect. I've added his code and this is what the tunnel looks like right now:
hyper9.jpg
hyper10.jpg
These screenshots are from the YT-1300's Gunner Turret. I forgot who requested this; but yeah, I think I kind of fixed the effect for the gunner camera... It actually took me a lot longer to fix it than I expected; but at least I got to understand XWA's coordinate system *very* well :P
You do not have the required permissions to view the files attached to this post.

blue_max
Lieutenant JG
XWAU Member
Posts: 561
Joined: Wed Mar 20, 2019 5:12 am

Post by blue_max » Sat Dec 14, 2019 9:17 am

And one more; because I really like how the tunnel looks like right now after keiranhalcyon7's additions:
hyper11.jpg
You do not have the required permissions to view the files attached to this post.

JeremyaFr
Lieutenant Commander
XWAU Member
Posts: 1796
Joined: Mon Jan 18, 2010 5:52 pm
Contact:

Post by JeremyaFr » Sat Dec 14, 2019 9:40 am

It looks good :applaus:

User avatar
Phoenix Leader
Ensign
Rebel Alliance
Posts: 317
Joined: Wed Aug 08, 2018 2:20 pm

Post by Phoenix Leader » Sat Dec 14, 2019 11:30 am

Amazing work!

Post Reply