Hard Light Productions Forums

Modding, Mission Design, and Coding => The Modding Workshop => Topic started by: JSRNerdo on September 06, 2016, 06:13:25 pm

Title: Invisible ship warpin effect
Post by: JSRNerdo on September 06, 2016, 06:13:25 pm
Hello! I want to do a dumb thing again! In short, I want to use warp-effect to make a great big portal, then have lots of ships come out that portal at once. Right now, I don't think this is very possible because all those ships have their own warp effect. I could use other warpin types, but they would just make them appear without the speedup-speeddown sequence. So what I'd like to do is make just the warpin effects for those ships invisible, and just once. How would I go around doing this?
Title: Re: Invisible ship warpin effect
Post by: Buff Skeleton on September 06, 2016, 06:31:43 pm
Color me interested in learning how to do this as well -- could be useful for some stuff I'm working on. I imagine you might need to do some table editing at the least!
Title: Re: Invisible ship warpin effect
Post by: LaineyBugsDaddy on September 06, 2016, 07:22:30 pm
I thought there was a feature introduced for jump gates and capships with fighters out in hyperspace in TBP that can do that, but I don't know what it's called.
Title: Re: Invisible ship warpin effect
Post by: Trivial Psychic on September 06, 2016, 07:23:21 pm
I had proposed something like this for TBP some time ago.  I suggested that there be an option in the ships editor when showing no warp effect, to preserve the acceleration and deceleration effects.
Title: Re: Invisible ship warpin effect
Post by: mjn.mixael on September 06, 2016, 07:30:00 pm
Now this is an interesting question!

I know of no way to actually alter the warp itself other than changing the warpin/warpout type. All other warp changes, afaik, are game wide affecting all ships always.

You have a couple problems to solve.

One is the warpin speed. You want ships to "come through" the portal at higher than max velocity and then slow down. This may be something you can do with the coordinate manipulation SEXPs, but I'm unsure. And they can be tricky to understand. Either way, I'd start there.

The second problem is the clip plane. Ships that come through subspace have a "clip plane" that is what the code uses to cause the front of the ship to gradually be visible as it comes through the warp. Depending on your usage, this may not be an issue. If this is a cutscene or other "controlled camera" situation, then you can be sure that the camera doesn't see behind the warp. This, in effect, nullifies the issue as the player could never see behind the warp. If not, then you need some way for them to gradually become visible. FSO has a cloaking effect that could approximate the gradual appearance and, iirc, the effect is based on an internal sort of shader or animation that could possible be altered. I don't know of anyone who's actually done that, but it's worth a bit of research. Another, and more performance costly, option is to texture swap the ships to an animated texture that wipes from transparent to not transparent. That could get really tricky with UV maps, though.

Now, none of this includes ideas or thoughts that use LUA or other more advanced modding. Those things are the things I still hire out to Axem. :)

Of course, the last option is to request a new feature as Trivial Psychic suggested.
Title: Re: Invisible ship warpin effect
Post by: AdmiralRalwood on September 06, 2016, 07:37:29 pm
FSO has a cloaking effect that could approximate the gradual appearance and, iirc, the effect is based on an internal sort of shader or animation that could possible be altered.
It wouldn't be a very good starting place since the cloaking effect applies to the whole ship at once and just makes it shimmer out of view (once the animation is finished, FSO simply doesn't render the cloaked ship, rather than continuing to render it and just making it invisible with the shader... just in case anyone was wondering how that worked, internally); you might think that the FS2 loadout animation would be a better starting point (after all, it actually performs a "wipe" effect similarly to subspace portals); unfortunately it also uses a clip plane, and they're defined in the code rather than in the shaders.

Another, and more performance costly, option is to texture swap the ships to an animated texture that wipes from transparent to not transparent.
I would expect that not to work right because of FSO's issues regarding transparent textures, and specifically replacing a non-transparent texture with a transparent one, or vice versa.

Of course, the last option is to request a new feature as Trivial Psychic suggested.
Honestly, I think doing this code-side in some way would probably be the easiest.
Title: Re: Invisible ship warpin effect
Post by: Dragon on September 08, 2016, 01:23:22 pm
A hacky idea of approaching that would be to replace the "knossos" warp animation with an invisible texture. Then you could set the ships to use it and they'd do what you want. Of course, you'd lose the ability to use the knossos (green instead of regular blue) warp effect. If you don't intend to use it otherwise, you may try that.
Title: Re: Invisible ship warpin effect
Post by: Buff Skeleton on September 08, 2016, 05:44:30 pm
Can you clone that effect and create an invisible version, perhaps? Like with a tbm used to clone and modify a ship or weapon?
Title: Re: Invisible ship warpin effect
Post by: LaineyBugsDaddy on September 08, 2016, 07:27:53 pm
Seems odd that this was never made a feature for TBP, though. I was sure they had something for the jump gates, but I guess it's just my memory playing tricks. Might be a good idea to look into coding this as a feature though, since TBP is being worked on again, regardless of IPA's outrageous claims in the matter.