Impulsefactor. Explosions. Damage.

Impulsefactor. Explosions. Damage.

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
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Impulsefactor. Explosions. Damage.

Post by Argh »

Ok, here's what's going on. I'll post pictures later, but this should do for now- anybody with experience modding can verify my results very easily.

Very simply, default damage values are not used to determine the depth of a crater made by an explosion. However, default damage does determine what graphics are shown.

This is both good and bad. Good, because I thought there was no way around this, and was resigned to having dinky lil' explosions in NanoBlobs. Bad, because one of the other features of the mod has had to be scrapped, because what really controls this ... is impulsefactor.

Test this yourselves- it's very easy.

Assign a damage value of 1000 per shot to a XTA unit- say, the Peewee. Do not specify Impulsefactor. Shoot the ground. Giant craters will ensue, huge explosion graphics will be shown (even though they have nothing to do with the actual radius of the explosion), and you will very quickly be lagged to standstill as your CPU tries to handle the craziness.

Second experiment. Keep the default damage value at 1000, but specify an Impulsefactor of 0. No craters, period, but it all looks the same- same big, scary explosion. Not nearly as much lag, though- setting impulsefactor to 0 effectively removes terrain deformation. NanoBlobs will, of course, feature no terrain deformation (because I really, honestly... don't think it adds a great deal to gameplay, considering the costs entailed on the performance end and resulting playability issues with the kinds of massive battles you see in Blobs on a routine basis).

Third experiment. Make the default damage 1, and make the impulsefactor 1000. The results are... icky. You will see super-deep (but tiny) craters and teeny-tiny explosion-puffs. But, hey- now your shots can knock other people's units back (while doing hardly any damage, of course).

Last experiments, which I have not done yet, but will report on tonight, unless somebody beats me to it... in the last experiment, I will try a default damage value of 0, and see what happens. My prediction is that it will look/act just like experiment three, but I will go test it. Then I'll try it with stun on, and see what that does. I predict that stun will not show a smokepuff nor make a crater, but it probably won't use impulsefactor either. If it does... well, at least I have an option...

Very simply, this is not cool. It feels like a kludge that was based on XTA, and it looks fine with that... but it puts a lot of artificial limitations on the game designs that we can build, especially considering that Spring's default particle FX are all we have to play with.

Impulsefactor is kind've useless as a pure physics toy, if it's tied directly to the code for making craters- I don't want lag in exchange for being able to knock units around.

I'd really, strongly prefer that it was un-tied from that value, and we had yet another value for craters- say, "craterdepth", that wasn't tied to default damage at all- and yet another value, for the type of explosion called, would be nice, too.

Then we could have much more variety in weapons- things that would knock units back, but hardly hurt them... things that would make big craters, but do little damage to units (say, to make "entrapment" mines, or other toys) or things that do something in-between. For example, in NanoBlobs... I don't want terrain to deform at all, at least for the default weapons... but I'd really like a "physics gun" or be able to tie up multiple weapons using the force-fire property and have a "single gun" that is actually several weapons with overlapping properties, so that I can have layered effects (obviously, not on rapid-fire things, as that'd lag like mad).
User avatar
SwiftSpear
Classic Community Lead
Posts: 7287
Joined: 12 Aug 2005, 09:29

Post by SwiftSpear »

You can still have weapons that do massive damage but only make small explosion graphics. Just set your default weapon damage to something really low and then create an armor class that all your units fit into, specify whatever damage you want for your special armor class and there you have it, a weapon that looks like a really puny explotion when it hits ground but does a motherload of damage when it hits a unit.

[edit] Impulse factor is also the factor that throws units around when an explosion hits them. So if you don't use any impulse factor on your weapons your units won't be physically thrown by them at all. That of course can be a blessing or a curse.
User avatar
Optimus Prime
Posts: 755
Joined: 03 Oct 2005, 14:31

Post by Optimus Prime »

Hey cool! So i can save a bit performance by doing impulse factor to 0 in FF :). Thanks!

OK tested and here are my Results on a 3 GHZ, 1 GIg Ram and Radeon 9800

Startsettings:
- speed 3.0
- max zoom-out level
- impulsefactor not defined (so default damage)

Test 1:

100 Wildcats shooting the ground at max zoom-out level with speed 3

- speed goes down to 1.65-1.68
- fps 16-17

Test 2:

100 Wildcats shooting the ground at max zoom-out level with speed 3 and impulesfactor set to 0

-speed goes down to 1.86-1.90
- fps 18-20

---------------------------------------

so you can save up to 10% of performance in battle with an impulesfactor of 0. Thats not bad and now in Version 1.14 of FF ;)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Post by Argh »

And, with larger packs, or larger area effects, this level of efficiency is, if anything, much higher. I've taken out all impulsefactor in NanoBlobs, and it made a huge difference in performance with the units with larger area-effects.
Warlord Zsinj
Imperial Winter Developer
Posts: 3742
Joined: 24 Aug 2004, 08:59

Post by Warlord Zsinj »

SWS uses impulse factor for a number of things. We played around with it so that now an artillery shell won't just obliterate infantry; it will do just enough damage to them that they are flung into the air, and are then killed once they hit the ground.

Your second experiment sounds like it could be a good way to implement a "force push" weapon on the jedi and sith units; although those deep craters are a bit concerning...
User avatar
SinbadEV
Posts: 6475
Joined: 02 May 2005, 03:56

Post by SinbadEV »

Well... I was thinking you could also have a force crush aswell... apparently impulse factors can be negative... which should, in theory, given a larger area of effect... slam a bunch of infactry men into eachother... could be the sith version of the same attack...
User avatar
Isaactoo
Posts: 124
Joined: 08 Dec 2004, 21:53

Post by Isaactoo »

Negative impulsefactors didn't work last time I tried it (a few versions ago). It'd be awsome if it did work, for things like a tractor beam or a mine that pulls enemy units into eachother.
User avatar
Isaactoo
Posts: 124
Joined: 08 Dec 2004, 21:53

Post by Isaactoo »

(please delete)
User avatar
Nemo
Spring 1944 Developer
Posts: 1376
Joined: 30 Jan 2005, 19:44

Post by Nemo »

Isaactoo wrote:Negative impulsefactors didn't work last time I tried it (a few versions ago). It'd be awsome if it did work, for things like a tractor beam or a mine that pulls enemy units into eachother.
They work just fine, but not with beam lasers, so true tractor beams are more or less impossible.

Undoing ties between tags in general is a great step, since it gives modders much more flexibility when creating content.
Post Reply

Return to “Engine”