Impulsefactor *still* does not apply to unit explosions

Impulsefactor *still* does not apply to unit explosions

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
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Impulsefactor *still* does not apply to unit explosions

Post by Caydr »

Been nagging about this forever, it really hurts gameplay. Units and structures, when self-destructed or just destroyed, always have an impulsefactor of 1, regardless of what their assigned weapon has for an impulsefactor.

One example of game breaking is in the case of a unit with an EMP explosion. Since an EMP explosion would only be useful if it has a large AoE and default "damage", this also means that it will have an enormous impulse on its blast, throwing stuff all over the place which should have just been EMP'd.

Another example is crawling bombs or even just mines. Often times their impulsefactor is the thing that's most dangerous. While 1000 damage versus a commander isn't that severe, the fact that he'll be thrown half a mile away to his demise (probably on a fusion or something, damn it all) is what's truly dangerous. Yeah, realistically that's how it probably should be, but gameplay over realism right?
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Caydr, by staring at the SVN, I found a solution to this, that actually works. Here's an example from NanoBlobs... you should be able to see very quickly which lines are important ;)

I'm not completely, 1000% sure that this complety removed impulsefactor (and, in my mod, cratering where none is desired), but... I am 99% sure.

[SPIREROOK_EXPLOSION]
{
name=SpireRookDeath;
rendertype=4;
soundhit=PlasmaBreach;
impulsefactor=0;
impulseBoost=0;
craterMult=0;
craterBoost=0;

areaofeffect=120;
explosiongenerator=custom:SPIREROOK_EXPLOSION_FX;
[DAMAGE]
{
default=4000;
LIGHT=1000;
REFLEC=700;
HEAVY=1000;
ULTRAHEAVY=1000;
}
}
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

gigady what? Where'd those come from? I've never seen nor heard of those lines before.

So have you tested and they actually apply to unit explosions as well? regular old impulsefactor=0.00000001; doesn't do a thing.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

Found them in the source code, and I was kind've surprised when they actually worked ;)
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Post by FLOZi »

It'd be really bloody ncie if modders were told when such things were added, eh.
User avatar
Snipawolf
Posts: 4357
Joined: 12 Dec 2005, 01:49

Post by Snipawolf »

Geeze, people do need to tell us that....
User avatar
Das Bruce
Posts: 3544
Joined: 23 Nov 2005, 06:16

Post by Das Bruce »

FLOZi wrote:It'd be really bloody ncie if modders were told when such things were added, eh.
One of the reasons why we need more news than just releases.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

It's why I started reading the source in SVN... half of it's figuring out HOW things work, and half of it's figuring out the things that are documented poorly :P

That said... could somebody please add those things to the Wiki?

impulsefactor=0; (float- the initial impulse of an explosion)
impulseBoost=0; (float- a multiplier that affects the impulse value of explosions)
craterMult=0; (float- making this larger/smaller than 1 affects the crater size XZ, based on damage/area).
craterBoost=0; (float- making this larger/smaller than 1 affects the crater size Y, based on damage/area).

The above definitions are from my (quick, fast and not too terribly knowledgable) reading of the relevant sourcecode. If any developer would care to correct me, I'd be obliged. Basically... setting all of those values to 0 finally, FINALLY results in explosions that never, ever cause craters... the increase in game code that results from this, especially late game... is incredible. Methinks that the vast majority of mods would play 100% better if 90%+ of their weapons had these values set to 0, and just reserved craters for the biggest weapons... but hey, that's just me.
hawkki
Posts: 222
Joined: 01 Jan 2006, 19:47

Post by hawkki »

I must agree on this one. We really need more info on whats going on with the development.
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

I'm hereby stating that I'm officially declaring that I'm pissed. These would've helped a long time ago.

This does not apply if they're only in the next version. In that case, I'm pissed at Argh for giving me false hope and making me pissed.

Nobody's commented on my new avatar and I'm also pissed about that.

I've also had one too many, and am pissed. Plus there's this new stain on my couch....
User avatar
jcnossen
Former Engine Dev
Posts: 2440
Joined: 05 Jun 2005, 19:13

Post by jcnossen »

It was revision 1099:

svn log

Code: Select all

Moved impulseFactor from weapon and helper->Explosion to DamageArray.
Unit deathblasts now respect impulseFactor.

Physics tags for weapons:
  impulseFactor As before, a multiplier.
  impulseBoost  Adds to effective damage for knockback.
  craterMult    Multiplier on terrain deformation, defaults to old behaviour (same as impulseFactor)
  craterBoost   Adds to effective damage for cratering.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

JC, it was 71b, I think, where that was supposedly working. It is not working properly at this time. That said, the TDF tags I shared, above, have the same effect- reducing ImpulseBoost to 0 results in ImpulseFactor being multiplied by zero :-)

At any rate... I have done a series of very thorough tests... and basically, there are some bugs with weapons and ImpulseFactor:

1. Just setting ImpulseFactor to zero is not enough to prevent BeamLasers from creating craters. You have to set CraterMult to zero also.

2. Same thing applies for Unit explosions. I have a feeling that both of these things are tied together... I'm just glad that the TDF control tags I needed were put into Spring :-)
User avatar
Caydr
Omnidouche
Posts: 7179
Joined: 16 Oct 2004, 19:40

Post by Caydr »

Woooo! It works!!! FINALLY I can make crawling bombs not explode all over each other and send one another flying!!! FINALLY I can have Twilights that don't send krogoths to the other side of the map on explosion!
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

You're welcome. I'd be more cheerful about it, but I'm just about as annoyed as I've ever gotten with the Spring community at the moment.
Post Reply

Return to “Engine”