Impulsefactor *still* does not apply to unit explosions
Moderator: Moderators
Impulsefactor *still* does not apply to unit explosions
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?
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?
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;
}
}

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;
}
}
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 
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.

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.
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....
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....
It was revision 1099:
svn log
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.
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

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
