Explosion Speed

Explosion Speed

Discuss the source code and development of Spring Engine in general from a technical point of view. Patches go here too.

Moderator: Moderators

Post Reply
Saktoth
Zero-K Developer
Posts: 2665
Joined: 28 Nov 2006, 13:22

Explosion Speed

Post by Saktoth »

Explosionspeed doesnt seem to do anything. Ive set it as high as 10 and low as 0.01. Nothing seems to change.

So whats up?
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

Try an obscene value like 10^+/-10
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Anything over 128 is practically instant, pretty much.
User avatar
BlackLiger
Posts: 1371
Joined: 05 Oct 2004, 21:58

Post by BlackLiger »

Argh wrote:Anything over 128 is practically instant, pretty much.
So its a binary progression? Anyone tried 64?
manored
Posts: 3179
Joined: 15 Nov 2006, 00:37

Post by manored »

You can play with the speed of explosions? It would be interesting to do a slow-motion blast...
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

The source code doesn't even read that tag from the weapon definitions:
https://taspring.clan-sy.com/svn/spring ... andler.cpp

http://lolut.utbm.info/pipermail/taspri ... 01739.html
PauloMorfeo wrote: In the change log for version 0.73 i can see the line:
"- New weapon tdf tag ExplosionSpeed"

And, in fact, i see some weapons using that tag. But the source doesn't seems
to be loading it from the .TDFs. "WeaponDefHandler.cpp" only has this line:
"weaponDefs[id].explosionSpeed = (8+gd*2.5f)/(9+sqrtf(gd)*0.7f)*0.5f;"

I supose someone forgot to add the loading of that tag to
CWeaponDefHandler::ParseTAWeapon ()? I seem to remember one or two more tags
that i didn't found in the source but i don't remember which ones they are
anymore, i forgot to take note.

Too bad this method of loading tags needs to have people explicitly go load
them from the files.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Hmm, you're right- but they did have that working in at least one build.

I'll just go in and give it a default value, and submit a patch...
User avatar
PauloMorfeo
Posts: 2004
Joined: 15 Dec 2004, 20:53

Post by PauloMorfeo »

Argh wrote:...
I'll just go in and give it a default value, and submit a patch...
Haa, why would you do that? It already has a "default" value assigned.

Why not just add the loading of it from the weapon definitions like Mass was added to features? Seems fairly similar:
trepan wrote:How about something like this? (it compiles ;-) )

Code: Select all

    const string massStr = wreckParser.SGetValueDef("", name + "\\Mass");   
    if (massStr.empty()) {
      // generate the mass from the metal and health values
      fd->mass = (fd->metal * 0.4f) + (fd->maxHealth * 0.1f);
    } else {
      fd->mass = (float)atof(massStr.c_str()); 
    }
    fd->mass = max(0.001f, fd->mass);
P.S. I haven't actually checked if the max() safety is required
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Why give it a default value?

A. Because doing it with that much complex math is laggy.
B. Using a straight value that is very fast shouldn't disrupt most mods' gameplay very much.
C. And it's so much simpler to just get it done that way ;)
SpikedHelmet
MC: Legacy & Spring 1944 Developer
Posts: 1948
Joined: 21 Sep 2004, 08:25

Post by SpikedHelmet »

Omfg, unit idea. Wouldn't it be completely and utterly cool beyond all reasoning to have some sort of nuclear-detonating kamikaze unit whose explosions moved at a snail's pace? So you could send it to the middle of the map, blow it, and slowly watch as it takes 20+ minutes for the map to be completely obliterated. Countdown!
User avatar
Forboding Angel
Evolution RTS Developer
Posts: 14673
Joined: 17 Nov 2005, 02:43

Post by Forboding Angel »

SpikedHelmet wrote:Omfg, unit idea. Wouldn't it be completely and utterly cool beyond all reasoning to have some sort of nuclear-detonating kamikaze unit whose explosions moved at a snail's pace? So you could send it to the middle of the map, blow it, and slowly watch as it takes 20+ minutes for the map to be completely obliterated. Countdown!
how about... no.
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

Argh wrote:A. Because doing it with that much complex math is laggy.
No, why? It only gets computed once at load time.
B. Using a straight value that is very fast shouldn't disrupt most mods' gameplay very much.
I think most mods assume the current default value and would be confused if that just changed.
User avatar
zwzsg
Kernel Panic Co-Developer
Posts: 7052
Joined: 16 Nov 2004, 13:08

Post by zwzsg »

I'd have thought the default value would be instant. Is it even possible to have instant explosions instead of very fast and does it save on ressources drain?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

It's not even close to instant, and the way it works is not exactly the way I'd strongly prefer.

Personally, I'd rather just have instant explosions, but be able to call more explosions through the customExplosionGenerator code if I want to muck around with expansion, randomness, or duration. Yeha, I don't suppose that could be done? That would be more than flexible enough to allow for all sorts of fancy stuff, and going to instant explosions would probably save quite a bit of processing time (which we could then spend either on giving them duration by calling them over multiple frames, or spend on more pretty FX, heh). Just my opinion, of course...
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Post by KDR_11k »

zwzsg wrote:I'd have thought the default value would be instant. Is it even possible to have instant explosions instead of very fast and does it save on ressources drain?
It's instant if you can get it to expand fully on one frame. It saves ressources because the explosion's range check exists shorter and when many explosions occur fewer of them are alive at the same time.

I wish the default was instant but I guess they didn't want to break mods that were built expecting the expanding blasts. I think the last time we had a discussion about that the players were for expanding explosions while the modders were against it except for the really big explosions where the delay is actually visible instead of hogging ressources for no visible gain.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

This appears to have been fixed. I will check it tonight.
espylaub
Posts: 205
Joined: 01 May 2006, 11:35

Post by espylaub »

Forboding Angel wrote:
SpikedHelmet wrote:Omfg, unit idea. Wouldn't it be completely and utterly cool beyond all reasoning to have some sort of nuclear-detonating kamikaze unit whose explosions moved at a snail's pace? So you could send it to the middle of the map, blow it, and slowly watch as it takes 20+ minutes for the map to be completely obliterated. Countdown!
how about... no.
Aaaactually this is a rather cool idea :) Reeeeeally slow expanding "energy fields" (explosions, basically) :D
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

<shrugs> I still think explosions should be able to reference other explosions. We'd be able to do a lot of interesting things with this, like fires that grow more "intense" over time, "gas" that slowly kills things... and, if we could use the randomization like customExplosionGenerator, it could do really interesting stuff, like have one bomb turn into 30-50 "bomblets" when it died, etc.
User avatar
Cabbage
Posts: 1548
Joined: 12 Mar 2006, 22:34

Post by Cabbage »

Omfg, unit idea. Wouldn't it be completely and utterly cool beyond all reasoning to have some sort of nuclear-detonating kamikaze unit whose explosions moved at a snail's pace? So you could send it to the middle of the map, blow it, and slowly watch as it takes 20+ minutes for the map to be completely obliterated. Countdown!
Good for a larf ^^
Post Reply

Return to “Engine”