Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: The SLOTH! on May 09, 2002, 04:12:54 pm

Title: Source Code Question - Cloaking?
Post by: The SLOTH! on May 09, 2002, 04:12:54 pm
Hey hey, I'm very curious as to what new things could come out of the source code, and seeing as though the G.E Program is based upon Wing Commander and Wing Commander has cloaking, I just feel like asking...

Is cloaking now possible?
Think it's possible?
Could anyone do it?
Can  anyone do it?

That'd be simply kick ass...  :D

Later guys,
The SLOTH!
Title: Source Code Question - Cloaking?
Post by: Fury on May 09, 2002, 04:29:13 pm
There's already cloaking, but I bet you want that ships can also visually cloak... I think it's possible but I have no idea how much new code it requires...
Title: Source Code Question - Cloaking?
Post by: The SLOTH! on May 09, 2002, 04:30:31 pm
Only one word can describe that...
Cool

:D
Title: Source Code Question - Cloaking?
Post by: TurboNed on May 09, 2002, 06:26:38 pm
Seems to me there's two ways (at least) to accomplish cloaking.  One is (probably relatively) easy, the other is much harder, but MUCH more realistic and cool looking (though probably quite system intensive).

The first way is for a ship to fade away and then become invisible and not rendered.  Blah.  (-;

The second way is for a ship to assume a texture map that matches what's behind it.  Basically an animated texture map of stars - the faster the ship moves, the faster the stars move.  Basically, the end result would be that one would see something fly by that's distorting the starfield, but only a little bit.  It would be really cool, still visually detectable (if you're REALLY careful and sharp-eyed), and probably REALLY hard to do.  [grin].  Just my thoughts.

  --TurboNed
Title: Source Code Question - Cloaking?
Post by: Stryke 9 on May 09, 2002, 06:31:34 pm
If it were possible with our limited abilities to get stuff with that level of complexity in, we could just give textures refractive properties so you'd actually BE seeing through the ship, with the distortion present.
Title: Source Code Question - Cloaking?
Post by: TurboNed on May 09, 2002, 06:33:29 pm
Quote
Originally posted by Stryke 9
If it were possible with our limited abilities to get stuff with that level of complexity in, we could just give textures refractive properties so you'd actually BE seeing through the ship, with the distortion present.


Does that mean that such a thing is beyond our abilities?  As usual, I was just spewing ideas with absolutely no idea of the do-ability of the ideas.  (-:

  --TurboNed
Title: Source Code Question - Cloaking?
Post by: Stryke 9 on May 09, 2002, 07:08:22 pm
As far as I know. Were we a powerful corporation with a large, full-time staff of professionals and the best equipment available, it would be iffy, and unlikely to happen anytime soon without prohibitive memory and hard disk costs. As it is, we're a bunch of loosely confederated amateurs, all working with completely different software, a vague idea of coding, and divergent, often conflicting interests. If I were you, I wouldn't hold my breath- the best we can hope for, I think, is an upgrade as far as poly counts, textures, etc. and customizability go. But I dunno... stranger things have happened, and the Internet is certainly the place for strangeness...
Title: Source Code Question - Cloaking?
Post by: Fulgrymm on May 10, 2002, 04:31:45 am
I have made a one-use cloak without any code changes, basically using three shells; a visible fighter, an invisible cloaking level and another visible fighter. It works reasonably well, and WS-thunder is using it for his campaign.

There are two things that could be done to improve this system; firstly, the creation of an invisible texture that can actually be shot (the existing 'invisible' allows gunfire through) and second, make it so that when a subobject is destroyed and gone, the object returns if it is repaired.  If both these things are implemented, then the cloak should work with just two shells (visible fighter, invisible cloak) and it could also be made usable more than once.

I'm no programmer though. :(
Title: Source Code Question - Cloaking?
Post by: Sandwich on May 10, 2002, 04:41:02 am
Quote
Originally posted by Stryke 9
As far as I know. Were we a powerful corporation with a large, full-time staff of professionals and the best equipment available, it would be iffy, and unlikely to happen anytime soon without prohibitive memory and hard disk costs. As it is, we're a bunch of loosely confederated amateurs, all working with completely different software, a vague idea of coding, and divergent, often conflicting interests. If I were you, I wouldn't hold my breath- the best we can hope for, I think, is an upgrade as far as poly counts, textures, etc. and customizability go. But I dunno... stranger things have happened, and the Internet is certainly the place for strangeness...


Actually, and I ain't a programmer, but I would think that it would not be all that difficult to call whatever 3D function is needed to make a ship (at the very lowest end of graphics card compatability) 90% transparent. For those with cards that have more advanced functions (T&L..?), an actual distortion would probably be easy as well.

Or heck, take for example what Westwood did with the stealth tank and troopers in Renegade - looks like nothing more than an animated glowy wavy texture in screen (Photoshop calls it screen, at least) mode.
Title: Source Code Question - Cloaking?
Post by: Nico on May 10, 2002, 06:53:33 am
Quote
Originally posted by Fulgrymm
I have made a one-use cloak without any code changes, basically using three shells; a visible fighter, an invisible cloaking level and another visible fighter. It works reasonably well, and WS-thunder is using it for his campaign.

There are two things that could be done to improve this system; firstly, the creation of an invisible texture that can actually be shot (the existing 'invisible' allows gunfire through) and second, make it so that when a subobject is destroyed and gone, the object returns if it is repaired.  If both these things are implemented, then the cloak should work with just two shells (visible fighter, invisible cloak) and it could also be made usable more than once.

I'm no programmer though. :(


bah, the destroyable subsystem trick... we do that for the tranforming veritech in the robotech mode. Come on! with the source, if I want a solution to things like that, it's surely not by tweaking a tweak :p.
Opacity settings are already  available for models in FS2 ( thrusters ). Now it's just a matter of changing this setting accordng to a key binding, which would also turn stealth mode on.
Dunno how hard it is to model, but it's most likely very possible to do in FS2.
Title: Source Code Question - Cloaking?
Post by: The SLOTH! on May 10, 2002, 09:05:35 pm
Sounds promising, I like it.  :D
Title: Source Code Question - Cloaking?
Post by: penguin on May 10, 2002, 09:22:44 pm
Quote
Originally posted by Fulgrymm
I have made a one-use cloak without any code changes, basically using three shells; a visible fighter, an invisible cloaking level and another visible fighter. It works reasonably well, and WS-thunder is using it for his campaign.

There are two things that could be done to improve this system; firstly, the creation of an invisible texture that can actually be shot (the existing 'invisible' allows gunfire through) and second, make it so that when a subobject is destroyed and gone, the object returns if it is repaired.  If both these things are implemented, then the cloak should work with just two shells (visible fighter, invisible cloak) and it could also be made usable more than once.

I'm no programmer though. :(
Heh, I am a programmer, but I ain't a modder :p

An easy :doubt: way to do it would be when cloaking is enabled, set the alpha value of all the model's textures to (say) 10%.  (Alpha is pretty much the same as transparancy... 100% = opaque, 0% = complete transparency)  Then whatever textures are on the model would show up very faintly, especially against a bright background, like the nebula -- in dark space, it would be very hard to see at all.

A problem would be the model would look like it was a hollow skin made of cellophane -- you would be able to see the textures on the other side as well, I think.  But there are probably ways around this, and it might not be too noticable in play.

And if you wanted to get really clever, you could tie the subsystem damage to the alpha level:
 - fully functioning cloaking subsystem = 10% alpha;
 - 50% damage to subsys = 30% alpha
 - 70% damage = 50% alpha
 - subsys destroyed = 100% alpha (no transparency)
Or you could make it flicker between cloaked/visible if it's damaged, that would look cool :nod:

*sigh* So many ideas, so little time...
Title: Source Code Question - Cloaking?
Post by: IceFire on May 10, 2002, 10:50:07 pm
I like the alphablending idea.  Its done onboard the video card anyways if im not mistaken....
Title: Source Code Question - Cloaking?
Post by: Bobboau on May 10, 2002, 10:56:30 pm
actualy you wouldn't see the polys on the other side, it's called backface culling

I think it would be cooler if there was some sort of distortion effect, maybe move the pixels behind a polly by ten or so in a random direction
or a direction relitive to the polys position relitive to the center of the screen
Title: Source Code Question - Cloaking?
Post by: penguin on May 10, 2002, 11:33:17 pm
Quote
Originally posted by Bobboau
actualy you wouldn't see the polys on the other side, it's called backface culling

I think it would be cooler if there was some sort of distortion effect, maybe move the pixels behind a polly by ten or so in a random direction
or a direction relitive to the polys position relitive to the center of the screen

:devilidea we could have a raytracing plugin for freespace... transparent objects would have a refractive index and act as lenses.  Another cool feature would be when you fly next to an Ares you can see your own ship reflected in the canopy.

Of course your framerate will be measured in frames/day...

--

:o forgot about backface culling and CW winding and all that.  But for complex shapes, you'd still be able to see the front faces of polys on the other side, you know, like the spiky things on Maras (sorry I'm even less coherent than usual tonight)  I don't know if it would look odd or not, have to see it in action...
Title: Source Code Question - Cloaking?
Post by: ZylonBane on May 11, 2002, 12:46:13 am
For the manpower available, and the huge quantity of other things to be done, I think we should be happy with a simple alpha effect. Probably the best way to control it would be through a set-alpha SEXP (and maybe a corresponding ship-alpha for reading the current alpha).