Explosion / Projectile Death Issues

Explosion / Projectile Death Issues

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

Explosion / Projectile Death Issues

Post by Argh »

Basically, it's really simple:

When projectiles die, most of them do not report the correct projectile position when queried in ProjectileDestroyed().

For example:

BeamLasers report a position that is exactly halfway between the Unit that fired the weapon and the target.

MissileLaunchers and Cannons report the correct X and Z, but Y is always 100000.

Needless to say, this is making developing generic explosion classes with P.O.P.S. a little more annoying than usual, since I don't have the correct data.

The only weapon projectile that reports the correct position that I've seen (haven't tested them all yet) is LaserCannon. I can deal with MissileLauncher / Cannon, at least for ground / sea stuff (of course, air is a bit of a problem).
zerver
Spring Developer
Posts: 1358
Joined: 16 Dec 2006, 20:59

Re: Explosion / Projectile Death Issues

Post by zerver »

Argh wrote:BeamLasers report a position that is exactly halfway between the Unit that fired the weapon and the target.
I'm not surprised. A laser is technically no projectile and in Spring it is represented by a stationary beam.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Explosion / Projectile Death Issues

Post by Argh »

It shouldn't work that way, imo. The projectile's reported position when it's being removed should be the position of the explosion. I'm surprised that nobody else has seen this problem already, but basically it screws up trying to build a general FX system something awful that these things aren't internally consistent.
User avatar
hoijui
Former Engine Dev
Posts: 4344
Joined: 22 Sep 2007, 09:51

Re: Explosion / Projectile Death Issues

Post by hoijui »

if i got it right, nobody cared for it so far, and therefore there is no code in the different weapon type implementations that makes sure this position is transmitted right?

if so, then.. are there weapons where this would be performance relevant (eg.. beam-laser - updating very frequently), and therefore inadvisable to implement?

if not.. who is gonna implement it?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: Explosion / Projectile Death Issues

Post by KDR_11k »

If you want to track explosions use the Explosion callin, not the projectile ones.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Explosion / Projectile Death Issues

Post by Argh »

But I need information that's only present on the synced side, and Gadgets can't use the Explosion callin, apparently.
User avatar
FLOZi
MC: Legacy & Spring 1944 Developer
Posts: 6242
Joined: 29 Apr 2005, 01:14

Re: Explosion / Projectile Death Issues

Post by FLOZi »

Argh wrote:But I need information that's only present on the synced side, and Gadgets can't use the Explosion callin, apparently.
Guess again!

http://spring1944.svn.sourceforge.net/v ... iew=markup
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Explosion / Projectile Death Issues

Post by Argh »

Hmm... weird, it didn't work over here when I tested it the first time.

I'll test it again, that would certainly solve some problems!
User avatar
jK
Spring Developer
Posts: 2299
Joined: 28 Jun 2007, 07:30

Re: Explosion / Projectile Death Issues

Post by jK »

Code: Select all

Script.SetWatchWeapon(weaponId, true)
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: Explosion / Projectile Death Issues

Post by Argh »

Tested... nothing happens when it's in synced code. Is S'44 using the CA GadgetHandler, perchance?

Isn't Script.SetWatchWeapon(weaponId, true)... really expensive? I mean, ideally... I'd like to use this with most weapons, most especially including rapid-fire ones, since the POPS events are significantly faster...


<tests>

OK, seems to be an acceptable price... it slows things down a wee bit, but nothing like as bad as I feared, which is good. I could probably speed things up a bit by writing a separate optimization just for Cannon and other ground-only stuff that isn't a beamlaser.

Image
Attachments
screen00088.jpg
(124.23 KiB) Downloaded 3 times
Post Reply

Return to “Engine”