Author Topic: Fix the "damage lightning"!  (Read 15432 times)

0 Members and 1 Guest are viewing this topic.

Offline Snail

  • SC 5
  • 214
  • Posts: ☂
Re: Fix the "damage lightning"!
I never could see damage arcs correctly and close-up because they disappeared too quickly. Please keep the code in.

 

Offline Turambar

  • Determined to inflict his entire social circle on us
  • 210
  • You can't spell Manslaughter without laughter
Re: Fix the "damage lightning"!
if someone wants to do a mod for homeworld: cataclysm, i think they'd like to know more about this for the Beast.
10:55:48   TurambarBlade: i've been selecting my generals based on how much i like their hats
10:55:55   HerraTohtori: me too!
10:56:01   HerraTohtori: :D

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Fix the "damage lightning"!
Quote
I changed it to use a quad strip instead.  That makes it a solid poly rather than the separate stuff from before, and it also means that there won't ever be a gap in the arcs.
Ok, now that is cool. :D

Question though (what a surprise ;) ): the solid colour strip look kinda makes me think more of a ribbon than a bolt of lightning to be honest, but I'm assuming that you can't assign a texture to the strip?
If that's the case, might some sort of simple colour gradient be possible then? Just a white->blue/purple from the centre to the outside edge I reckon would look awesome.


I've never really thought about it before now, but it's occured to me that the lightning effect could be really useful for quite a lot of things if we could control it.
Eg, if we could define points/pairs of points from/between which lightning can arc, and had a scripted/SEXPed trigger mechanism of some kind, it should become possible to make things like lightning guns, fancy new non-subspace FTL drive effects, have weapon impacts that spew lightning, turrets that charge up with lightning jumping to them from random/set points on the hull, constant lightning effects that are just a feature of a ship etc.

Then if you could define parent objects of these points - so the points would move with their parents, you suddenly get a whole next level of fancy effects. The teleporter in Half Life 1 is a simplistic example of what you could do with rotating stuff, but you should also be able with a bit of work get an in-game Sathanas star killing effect happening. Perhaps you could also set different ships alltogether to act as parents which could be used for all kinds of stuff.

Anyways - there's what I came up with just now. I'll see if I can come up with more during the day. ;)

Oh, and yeah - please leave in the lightning effect for the ship lab. It's the kind of thing that just strikes me as belonging in there. :D
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline Mongoose

  • Rikki-Tikki-Tavi
  • Global Moderator
  • 212
  • This brain for rent.
    • Steam
    • Something
Re: Fix the "damage lightning"!
Those shots are definitely a big improvement to what we have now.  Oh, and one more vote for the ship lab. :)

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: Fix the "damage lightning"!
Question though (what a surprise ;) ): the solid colour strip look kinda makes me think more of a ribbon than a bolt of lightning to be honest, but I'm assuming that you can't assign a texture to the strip?
Actually, it is possible to use a texture rather than just a solid color, it is just a poly like any other effect uses after all.  The problem is that it's almost 100% waste.  The arcs are seldomly more than a couple of pixels wide, and you simply wouldn't be able to see much in the way of texture detail in them even if you were up close.  We'd really just be better off tweaking the coloring rather than messing around with a texture.  That way we can cut the render time down for the arcs and perhaps do some neater things with them in the future without dealing with textures at all.

If that's the case, might some sort of simple colour gradient be possible then? Just a white->blue/purple from the centre to the outside edge I reckon would look awesome.
I was thinking the same thing. :)  I coded the function in question (a new one, to batch the entire arc and render it at one time) so that it's easy to render each arc multiple times, with a different color and width.  That should allow us to have the current blue outside and then a white center, as one example.  There are actually quite a few possibilities, but I haven't gotten far enough to actually test all of that yet.  I was looking over some thing I found through Google last night about that and trying to come up with a few ideas of how that can be applied to our case.

Overall this is still pretty low priority for me, but based on what I shown and told you so far, I'm sure that all of you can come up with an idea or two to make proper use of the new code effect.  About the only reason that I'm working on it right now is that I'm upgrading some other OGL rendering stuff and converting the lightning arcs to use it was a very good test of the new code.

Oh, and this quite effectively kills D3D support, as I am not going to add support for this stuff to anything but OGL.  This means that for everyone that still hasn't made the switch to OGL, you aren't going to have a choice any longer.  Even if the D3D code still compiles, it can't handle the effect without an upgrade.  It will be up to someone else to make the D3D code compatible at some point in the future.  :p

I've never really thought about it before now, but it's occured to me that the lightning effect could be really useful for quite a lot of things if we could control it.
Eg, if we could define points/pairs of points from/between which lightning can arc, and had a scripted/SEXPed trigger mechanism of some kind, it should become possible to make things like lightning guns, fancy new non-subspace FTL drive effects, have weapon impacts that spew lightning, turrets that charge up with lightning jumping to them from random/set points on the hull, constant lightning effects that are just a feature of a ship etc.
The current code just takes two points, it then randomly fills in more points between those two in order to make the full arc.  So it really could do some rather neat things, and be random by design.  With with the new g3_draw_rod(), which actually renders the arcs, it would be easy to do something completely different with it even.  For effects that would really show it off it would be worth using textures on it, or even more elaborate color sets.  The part of the code which actually generates the random stuff in between the two original points is a single, rather simple, function and it wouldn't be difficult to do much more with it in the future.

Oh, and yeah - please leave in the lightning effect for the ship lab. It's the kind of thing that just strikes me as belonging in there. :D
Ok, guess I'll leave it in.  It would probably be more work to remove it at this point anyway.  ;)

The effect does just play out like in-game btw, so it's just random arcs which are going all over the ship.  Because of the random nature of the arc, there is no way to actually pause it or anything, since it doesn't render the exact same way twice.  One thing that it doesn't do (at least not yet) is produce the light effect that goes along with the arc.  I don't know that I'll bother to add that, at least not at first.  It also doesn't work on debris at the moment, so I don't know if that is something anyone wants or not.  It wouldn't be that difficult to add to debris, but it would be something of a pain, so I probably won't add it without a proper virgin sacrifice, or something. :)

 

Offline Vasudan Admiral

  • Member
  • Moderator
  • 211
    • Twisted Infinities
Re: Fix the "damage lightning"!
Quote
It wouldn't be that difficult to add to debris, but it would be something of a pain, so I probably won't add it without a proper virgin sacrifice, or something. :)
lol; no there's no need to add it to debris display - it's just the sorta thing that now it's added, there's no real reason to remove it again. :)
That and it's just a plain cool effect to watch.

Quote
Actually, it is possible to use a texture rather than just a solid color, it is just a poly like any other effect uses after all.  The problem is that it's almost 100% waste.
Oooh, that'd be great for any future uses of lightning we're discussing here that require the bolt to be quite wider. The gradient method sounds very highly adaptable too, which is great.

Quote
The current code just takes two points, it then randomly fills in more points between those two in order to make the full arc.  So it really could do some rather neat things, and be random by design.  With with the new g3_draw_rod(), which actually renders the arcs, it would be easy to do something completely different with it even.  For effects that would really show it off it would be worth using textures on it, or even more elaborate color sets.  The part of the code which actually generates the random stuff in between the two original points is a single, rather simple, function and it wouldn't be difficult to do much more with it in the future.
That certainly sounds promising then. This is the kind of new functionality that I love most of all btw. :D
Stuff that just opens up whole new realms of fancy effect possabilities.

Quote
I'm sure that all of you can come up with an idea or two to make proper use of the new code effect.
Well, I have a couple more secrety secret ideas for some TI specific stuff, but it could also make for great storm effects in TI and SoL's ground missions if need-be, or much stronger EMP effects on ships (think star wars ion cannon level).
They're still coming! ;)
Get the 2014 Media VPs and report any bugs you find in them to the FSU Mantis so that we may squish them. || Blender to POF model conversion guide
Twisted Infinities

 

Offline WMCoolmon

  • Purveyor of space crack
  • 213
Re: Fix the "damage lightning"!
Hehe, I haven't decided actually.  I did actually make all ships in the lab have damage arcs in the lab so that I could test it out easier, so the code is basically there to do such a thing.  It's just not really a useful thing though, so I had never planned to leave that capability in place and was just going to rip it out after I got done testing.  But I suppose I could be convinced to leave it in, if everyone really, really wants it. :)

I forget, is the damage arc stuff all handled by data outside of the ship struct? If so, you could make it a model render flag and let the effect be toggled in the lab...
-C

 

Offline taylor

  • Super SCP/Linux Guru
  • 212
    • http://www.icculus.org/~taylor
Re: Fix the "damage lightning"!
I forget, is the damage arc stuff all handled by data outside of the ship struct? If so, you could make it a model render flag and let the effect be toggled in the lab...
They render if there are any arcs set for the model.  I skip the ship stuff and do the arcs separately in the lab, so that it can be controled easier.  So there isn't a need to make it a MR flag since it just has to be a LAB flag instead.

 

Offline takashi

  • Better than TrashMan
  • 29
Re: Fix the "damage lightning"!
ship lab?

  

Offline Mars

  • I have no originality
  • 211
  • Attempting unreasonable levels of reasonable
Re: Fix the "damage lightning"!