Hard Light Productions Forums

Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: TrashMan on January 25, 2005, 05:54:24 pm

Title: Shockwave animations
Post by: TrashMan on January 25, 2005, 05:54:24 pm
Say, how about adding a $shockwaveAni: field in the tables?

Each weapon can have it's own specific shockwave it will produce.
To keep backwards compability, if none is specified, it uses the default one.


Oh..and hte ability to ORDER ships via events in FRED to PUT POWER IN THEIR ENGINES. Would be usefull to give capships a small speed max increase...
Title: Shockwave animations
Post by: TrashMan on January 26, 2005, 05:09:23 pm
Quote
Originally posted by TrashMan
Say, how about adding a $shockwaveAni: field in the tables?

Each weapon can have it's own specific shockwave it will produce.
To keep backwards compability, if none is specified, it uses the default one.


Oh..and hte ability to ORDER ships via events in FRED to PUT POWER IN THEIR ENGINES. Would be usefull to give capships a small speed max increase...


*BUMP*
*tries to get the attention of hte code wizzards, since one shockwave is really starting to piss him off*
Title: Shockwave animations
Post by: karajorma on January 26, 2005, 05:27:23 pm
I think they're ignoring you until you realise that this wasn't a request thread :p
Title: Shockwave animations
Post by: Goober5000 on January 26, 2005, 07:23:40 pm
:wtf:

This most certainly is not a request thread.  And I think that was rather disrespectful.

And coming on the tail of all the other things...
*bans TrashMan from posting in the SCP forum*
Title: Shockwave animations
Post by: vyper on January 27, 2005, 08:23:45 pm
Either you're taking the piss again, or the power is seriously starting to go to your head Goob.

edit: corrected Heard to head. It appears I thought Goober was creating an over zealous mass of farm-yard animals.
Title: Shockwave animations
Post by: Goober5000 on January 27, 2005, 08:38:28 pm
It's not just this one incident... he's had a history of this sort of thing.  We've been talking about implementing such a policy anyway.  I'll see how it works out.
Title: Shockwave animations
Post by: -Norbert- on January 28, 2005, 04:41:37 am
Just sad, that is had to happen on such a thread like this (even though it's justified).
Title: Shockwave animations
Post by: Goober5000 on January 28, 2005, 05:40:06 am
Good point.  Thread split. :)
Title: Shockwave animations
Post by: TrashMan on January 31, 2005, 03:29:11 pm
ERm...any of you code wizzards care to comment on this?

Too stupid? Not worth it? No time?


Hell, I would do it myself, but I got only basic programming skillz (Basic, Pascal, Prolog, LIST..oh and C++ and Java too)

I do have a friend who is a master programmer (worked on several games, made dozens of programs for some firms and stuff), and I tried to get him to help wihth the SCP, and alltough he is interested, he sez he regretfully doesn't have the time.

But from what I know (and what he told me), adding that shockwave feature would be a simple thing to do...
Title: Shockwave animations
Post by: taylor on January 31, 2005, 03:46:53 pm
Add the tbl entry is uber simple.  Making it support more than one shockwave type takes a little more work but is certainly doable with a few hours work.  There is only one major problem, memory.  Having it load multiple shockwave animations is going to suck up RAM by the basket full.  We would have to restrict it to 2 or 3 types at most, including the default, in order to keep memory usage down.  It can be done but the end result might be more trouble than it's worth for the end user.
Title: Shockwave animations
Post by: TrashMan on January 31, 2005, 05:54:50 pm
How much memory can 3 shockwave ani's take?

And who needs uber-shockvawe ani's? The stock FS2 ani still looks better to me than any I?ve seen so far.
Title: Shockwave animations
Post by: WMCoolmon on January 31, 2005, 06:37:08 pm
A helluva lot. Everything is stored in pcx format, unless you use PCX2DDS, so that's 60 frames of data sitting in memory for just a 4-second 15-fps anim. Next you have all the ships' textures, and their models, as well as any background inages (Which exist in memory as their full size)

It very quickly adds up, and moving data between the normal RAM and the RAM on the video card means slowdowns.
Title: Shockwave animations
Post by: TrashMan on January 31, 2005, 07:03:23 pm
Hmm...
Well..I would be just as happy if someone just did a slightly better version of the normal FS2 blue shockvawe....

Can't have them all I guess...
Title: Shockwave animations
Post by: WMCoolmon on January 31, 2005, 07:08:53 pm
There's the yellow and orange shockwave in the mediaVP. I'm not sure if you'd term it better, though. ;)
Title: Shockwave animations
Post by: StratComm on January 31, 2005, 07:28:51 pm
I've always been more partial to the spherical shockwave myself, meaning it's a circle instead of the planar ring thing we keep bringing back.  I think Inf. release 1 had a good spherical shockwave, though I can't remember exactly if that was indeed where I saw it.
Title: Shockwave animations
Post by: taylor on February 01, 2005, 12:23:38 am
Quote
Originally posted by TrashMan
How much memory can 3 shockwave ani's take?

A 60 frame, hi-quality version of the original in TGA format is (512x512x4x60) == 60meg.  And that's just for one.  DDS can save a good bit of memory but the quality is less so you'd probably have to use a larger image so (1024x1024x60) == 60meg.  Not saving anything there.  You can cut down the number of frames but it still adds up.  Most video cards are only going to have 128meg of RAM onboard so with two of those animations loaded you've used all available memory.  We've still got to load all model data into video memory for rendering and textures for background nebula, planets, base maps, glow maps, specmaps, weapon effects, missiles, all explosion anis, warp maps, etc.  Basically, it's a whole lot.

I personally think this is a good idea and would look cool in-game but the price is pretty high to get it.
Title: Shockwave animations
Post by: phatosealpha on February 01, 2005, 12:57:57 am
Could you achieve a slight increase in variety at a low cost in memory just by varying the palettes or or by having the base shockwave animation be white and then using lighting effects to reach a desired color?  Or maybe it would be possible to have the actual shockwave ani only be for a quarter of the explosion graphic and have it duplicated to the other 3 quarters?

Apoligies if this is crazy or useless.
Title: Shockwave animations
Post by: SadisticSid on February 01, 2005, 05:04:15 am
Quote
Originally posted by phatosealpha
Could you achieve a slight increase in variety at a low cost in memory just by varying the palettes or or by having the base shockwave animation be white and then using lighting effects to reach a desired color?


That's really good thinking actually. Being able to define the shockwave colour would certainly meet my needs (e.g. a reddy-orange shockwave for Shivan ships exploding, a blue one for Terrans, etc.).
Title: Shockwave animations
Post by: TrashMan on February 01, 2005, 03:05:27 pm
Quote
Originally posted by taylor

A 60 frame, hi-quality version of the original in TGA format is (512x512x4x60) == 60meg.  And that's just for one.  DDS can save a good bit of memory but the quality is less so you'd probably have to use a larger image so (1024x1024x60) == 60meg.  Not saving anything there.  You can cut down the number of frames but it still adds up.  Most video cards are only going to have 128meg of RAM onboard so with two of those animations loaded you've used all available memory.  We've still got to load all model data into video memory for rendering and textures for background nebula, planets, base maps, glow maps, specmaps, weapon effects, missiles, all explosion anis, warp maps, etc.  Basically, it's a whole lot.

I personally think this is a good idea and would look cool in-game but the price is pretty high to get it.


WTF??? 60MB????

since when does 1 512x512 tga take up 1 mb.
Last time I checked it was around 200-300kb...
Title: Shockwave animations
Post by: TrashMan on February 01, 2005, 03:07:20 pm
Quote
Originally posted by phatosealpha
Could you achieve a slight increase in variety at a low cost in memory just by varying the palettes or or by having the base shockwave animation be white and then using lighting effects to reach a desired color?  Or maybe it would be possible to have the actual shockwave ani only be for a quarter of the explosion graphic and have it duplicated to the other 3 quarters?

Apoligies if this is crazy or useless.


PURE GENIUS!!!!:D :yes:
Title: Shockwave animations
Post by: StratComm on February 01, 2005, 03:10:16 pm
It all depends on whether or not the graphics card supports modifying a graphic on the fly like that.  As far as I know, you'd have to apply a color mask to it before you sent the image to the card, which takes us right back to the graphics memory available to hold the explosion.
Title: Shockwave animations
Post by: DaBrain on February 01, 2005, 03:13:15 pm
Although I doubt the result will be as good as completly pre-rendered shockwave, it's a very good idea.

But I think it won't save a much memory as you think. AFIAK full grayscale is still 8-Bit.
Title: Shockwave animations
Post by: phatosealpha on February 01, 2005, 03:17:25 pm
Doesn't the lighting system essentially do that?

Hmm.  Do glowmaps have any effect on place where the texture is 100% transparent?  Might be able to jury rig something up with a standard shockwave and a very small, solid color glowmap that gets scaled or something.

Though, I'm probably suggesting things that the engine can't do or something.


Edit:  Oh, I wasn't really considering the size of the base map itself.  Not really much you can do about that, I figure.   The reason for all white was primarily because I figure white things take on the color of whatever light they're in, but say a blue shockwave in red light would appear black.  So, I was thinking more of getting 4 shockwaves of the same appearance but different color for the memory use of one.
Title: Shockwave animations
Post by: StratComm on February 01, 2005, 03:18:28 pm
The advantage is, in theory, that only one image is loaded into GPU memory and thus you only have one large animation file as opposed to several.  I don't think that's how it works, but that's the idea I seem to be hearing.
Title: Shockwave animations
Post by: taylor on February 01, 2005, 04:15:32 pm
Quote
Originally posted by TrashMan
since when does 1 512x512 tga take up 1 mb.
Last time I checked it was around 200-300kb...

RLE compressed it may take up 200-300K but it can't be used that way.  It has to be uncompressed first.  Memory usage is computed like this: width * height * bpp.  A TGA with an alpha channel is 32-bits which is 4-bytes.  A height and width of 512 means that you need 512*512*4 = 1048576 bytes (1 meg) of memory.  The same formula is used to calculate memory usage for all image formats.  The only exception is DDS since it can be sent to the video card still compressed.  An uncompressed 32-bit 512x512 TGA should be about 1meg on disk.
Title: Shockwave animations
Post by: WMCoolmon on February 01, 2005, 06:00:58 pm
Actually, the quarter shockwave idea would probably work pretty well, you could map the texture onto four different polygons - you'd even only have to draw one frame per frame, you could just rotate the polygons at different angles.

Lighting, specmapping, glowmapping, etc wouldn't really need to be applied either. And you'd only need to have one palette while drawing those four frames, and maybe you could batch all the explosions on screen to increase speed? I've just about hit the limit of my admittedly-sparse graphics knowledge...
Title: Shockwave animations
Post by: TrashMan on February 02, 2005, 07:11:03 am
Cool...so it can be done?..right?
Title: Shockwave animations
Post by: Mav on February 08, 2005, 07:56:12 am
Quote
Originally posted by TrashMan
Hmm...
Well..I would be just as happy if someone just did a slightly better version of the normal FS2 blue shockvawe....

Can't have them all I guess...


Umm... FS2-shockwave was more greenish. If you mean FS1 however (which indeed was blue), you can be helped - go to F2S, go to "modificatiions", and look for "Refined Explosion - By Mav ". :D
Title: Shockwave animations
Post by: DaBrain on February 08, 2005, 08:10:27 am
Quote
Originally posted by WMCoolmon
Actually, the quarter shockwave idea would probably work pretty well, you could map the texture onto four different polygons - you'd even only have to draw one frame per frame, you could just rotate the polygons at different angles.

Lighting, specmapping, glowmapping, etc wouldn't really need to be applied either. And you'd only need to have one palette while drawing those four frames, and maybe you could batch all the explosions on screen to increase speed? I've just about hit the limit of my admittedly-sparse graphics knowledge...



If the code dosn't allow it, you can simulate it with the frames.
In the first frames the shockwave quarter is on the bottom of the image and it moves up slowly. It should look like the speed is increasing in-game.
Title: Shockwave animations
Post by: TrashMan on February 08, 2005, 09:14:56 am
Quote
Originally posted by Mav


Umm... FS2-shockwave was more greenish. If you mean FS1 however (which indeed was blue), you can be helped - go to F2S, go to "modificatiions", and look for "Refined Explosion - By Mav ". :D


Downalod from where exactly? I couldn't find that shockvawe.
Title: Shockwave animations
Post by: Mav on February 08, 2005, 03:13:02 pm
http://www.sectorgame.com/f2s/files/mods.php
Currently it's right at the top of that list, so it shouldn't take long to find it.
Title: Shockwave animations
Post by: Woolie Wool on February 08, 2005, 04:24:21 pm
Quote
Originally posted by StratComm
It all depends on whether or not the graphics card supports modifying a graphic on the fly like that.  As far as I know, you'd have to apply a color mask to it before you sent the image to the card, which takes us right back to the graphics memory available to hold the explosion.

FS already does this with weapon glows.
Title: Shockwave animations
Post by: WMCoolmon on February 08, 2005, 06:28:22 pm
Quote
Originally posted by TrashMan
Cool...so it can be done?..right?


I have no clue. :p

What you'd need to do is to change whatever-the-way explosion shockwaves are shown (could be by mapping a polygon, or a 2D image, I think it's the former). Rather than display them at the normal size, you'd display four versions, each rotated 90 degrees from the first. It'd be very similar to displaying four shockwaves at  the same time, but my 3D knowledge ends about the time you get past positioning stuff and telling FS2 to "model_render". Bobb or taylor would have to field this one.
Title: Shockwave animations
Post by: StratComm on February 08, 2005, 06:51:53 pm
If it is being mapped to a plane, then you could make a 4-quad plane and map the animation specially to all of the corners.  I think (since the shockwave doesn't clip) that it's being treated differently, but the 4-corners method is how I get better resolution out of anything I make with radial symmetry.
Title: Shockwave animations
Post by: DaBrain on February 09, 2005, 05:19:28 am
Quote
Originally posted by Mav
http://www.sectorgame.com/f2s/files/mods.php
Currently it's right at the top of that list, so it shouldn't take long to find it.



A 40 frame shockwave will look extremely stuttery for big explosions.
Title: Shockwave animations
Post by: Bobboau on February 09, 2005, 06:59:39 am
Quote
Originally posted by Mav
http://www.sectorgame.com/f2s/files/mods.php
Currently it's right at the top of that list, so it shouldn't take long to find it.


there are a number of mods listed on that site with me as the creator to wich I beleive I am not. specificly:
Quarantine pack - unless someone repacaged some of my stuff, and used the name of another mini-mod
Weapons - I think hunter made these
GTVB Morta - I've never made a vasudan bomber

and the Polaris was made by Dark (though I did add pof data and converted it to FS2 many years ago, I seek no mention from this)

I've been in trouble due to things like this before, and I do not wish to relive that situation.
Title: Shockwave animations
Post by: Flipside on February 09, 2005, 08:52:26 am
I'll let Hunter know and see if he can change them if your that concerned, but I'm sure no-one thinks your trying to steal their glory, God knows you've got enough not to need to nick anyone elses ;)
Title: Shockwave animations
Post by: Bobboau on February 09, 2005, 09:19:08 am
you know it was actualy hunter's stie that got me in trouble the first time.
it was a long time ago, when I was still learning, I was converting the Polaris from FS1 to FS2 and adding all sorts of nifty POF data. I had asked Dark for permission to  distribute it, then all of the sudden DENYED! I got acused of stealing a background pack and I had a nasty news post posted about me on RA (Dark/wingnut/other's old site). turns out the thing had some sort of macro virus that had imbedded it'self into the doc file I used in the first mod I ever distributed, nasty emails were sent back and fourth, eventualy the situation got resolved, I got permission to distribute the converted model, and order was once again restored to the cosmos.
Title: Shockwave animations
Post by: Mav on February 10, 2005, 04:09:03 pm
Quote
Originally posted by DaBrain
A 40 frame shockwave will look extremely stuttery for big explosions.


Possibly right, but it worked quite fine for me so far.
And it really isn't that much more than an antialiased vesion of the FS1 shockwave (though still a bit more); simply because I got to play a bit FS1 again after years and realized that I liked that shockwave, even in its original low resolution.:cool:
Title: Shockwave animations
Post by: WMCoolmon on February 18, 2005, 04:33:38 pm
Okay, I was toying around with some of the functions involved in adding this, here's what I got as a result: :D

http://fs2source.warpcore.org/tempscreenshot/screen158.jpg
http://fs2source.warpcore.org/tempscreenshot/screen159.jpg
http://fs2source.warpcore.org/tempscreenshot/screen160.jpg
http://fs2source.warpcore.org/tempscreenshot/screen160.jpg
http://fs2source.warpcore.org/tempscreenshot/screen161.jpg
http://fs2source.warpcore.org/tempscreenshot/screen162.jpg
http://fs2source.warpcore.org/tempscreenshot/screen163.jpg
http://fs2source.warpcore.org/tempscreenshot/screen164.jpg
http://fs2source.warpcore.org/tempscreenshot/screen165.jpg
http://fs2source.warpcore.org/tempscreenshot/screen166.jpg
http://fs2source.warpcore.org/tempscreenshot/screen167.jpg
http://fs2source.warpcore.org/tempscreenshot/screen168.jpg
http://fs2source.warpcore.org/tempscreenshot/screen169.jpg
http://fs2source.warpcore.org/tempscreenshot/screen170.jpg
http://fs2source.warpcore.org/tempscreenshot/screen171.jpg
Title: Shockwave animations
Post by: NGTM-1R on February 18, 2005, 05:22:53 pm
...ugly, isn't it?
Title: Shockwave animations
Post by: DaBrain on February 18, 2005, 05:41:47 pm
If I got it right, it's just ugly because the EXP is not the right animation for this effect. But I won't say more. ;)