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).
Explosion / Projectile Death Issues
Moderator: Moderators
Re: Explosion / Projectile Death Issues
I'm not surprised. A laser is technically no projectile and in Spring it is represented by a stationary beam.Argh wrote:BeamLasers report a position that is exactly halfway between the Unit that fired the weapon and the target.
Re: Explosion / Projectile Death Issues
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.
Re: Explosion / Projectile Death Issues
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?
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?
Re: Explosion / Projectile Death Issues
If you want to track explosions use the Explosion callin, not the projectile ones.
Re: Explosion / Projectile Death Issues
But I need information that's only present on the synced side, and Gadgets can't use the Explosion callin, apparently.
Re: Explosion / Projectile Death Issues
Guess again!Argh wrote:But I need information that's only present on the synced side, and Gadgets can't use the Explosion callin, apparently.
http://spring1944.svn.sourceforge.net/v ... iew=markup
Re: Explosion / Projectile Death Issues
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!
I'll test it again, that would certainly solve some problems!
Re: Explosion / Projectile Death Issues
Code: Select all
Script.SetWatchWeapon(weaponId, true)
Re: Explosion / Projectile Death Issues
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.

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.
- Attachments
-
- screen00088.jpg
- (124.23 KiB) Downloaded 3 times