Page 2 of 7

Re: New High-Res Hyperspace Effect

Posted: Fri Dec 06, 2019 8:18 pm
by JeremyaFr
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 ).

Re: New High-Res Hyperspace Effect

Posted: Fri Dec 06, 2019 10:35 pm
by blue_max
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.

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 07, 2019 3:28 am
by keiranhalcyon7
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.

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 07, 2019 6:36 am
by blue_max
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.

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 07, 2019 9:34 pm
by blue_max
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?

Re: New High-Res Hyperspace Effect

Posted: Sun Dec 08, 2019 12:30 pm
by JeremyaFr
There is a gunner matrix (9 short values: Front, Right and Up vectors) in the player struct at offset 0x21E.

Re: New High-Res Hyperspace Effect

Posted: Sun Dec 08, 2019 6:33 pm
by blue_max
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!

Re: New High-Res Hyperspace Effect

Posted: Mon Dec 09, 2019 9:26 pm
by blue_max
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.

Re: New High-Res Hyperspace Effect

Posted: Mon Dec 09, 2019 10:04 pm
by Vince T
Looking really great now!

Re: New High-Res Hyperspace Effect

Posted: Mon Dec 09, 2019 10:06 pm
by Rookie_One1
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!

Re: New High-Res Hyperspace Effect

Posted: Tue Dec 10, 2019 12:53 am
by blue_max
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?)

Re: New High-Res Hyperspace Effect

Posted: Tue Dec 10, 2019 1:45 am
by keiranhalcyon7
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.

Re: New High-Res Hyperspace Effect

Posted: Tue Dec 10, 2019 4:53 am
by Rookie_One1
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)

Re: New High-Res Hyperspace Effect

Posted: Tue Dec 10, 2019 6:22 am
by Bman
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.

Re: New High-Res Hyperspace Effect

Posted: Tue Dec 10, 2019 7:46 pm
by blue_max
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.

Re: New High-Res Hyperspace Effect

Posted: Thu Dec 12, 2019 7:35 am
by keiranhalcyon7
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.

Re: New High-Res Hyperspace Effect

Posted: Thu Dec 12, 2019 8:17 am
by Vince T
Sweeet!

Re: New High-Res Hyperspace Effect

Posted: Thu Dec 12, 2019 2:06 pm
by Rookie_One1
Do like!

Re: New High-Res Hyperspace Effect

Posted: Thu Dec 12, 2019 2:46 pm
by Darksaber
Nice

Re: New High-Res Hyperspace Effect

Posted: Fri Dec 13, 2019 3:26 am
by ual002
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".

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 14, 2019 1:15 am
by rogue518
Looking Good!!!

Sincerely, Rogue518

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 14, 2019 9:15 am
by blue_max
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

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 14, 2019 9:17 am
by blue_max
And one more; because I really like how the tunnel looks like right now after keiranhalcyon7's additions:
hyper11.jpg

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 14, 2019 9:40 am
by JeremyaFr
It looks good :applaus:

Re: New High-Res Hyperspace Effect

Posted: Sat Dec 14, 2019 11:30 am
by Phoenix Leader
Amazing work!