Unreliable projectile::oncollision call
by Brian "Bazz" Staudinger · in Torque Game Engine · 01/01/2004 (2:08 pm) · 21 replies
Does anyone know why the projectile::oncollision call does not allways come.
Im useing the 1.2 demo , and im trying to play impulse keepie-uppy , its strange , sometimes I can see the explosion from the hit but "onCollision: does not get called,,it seems to hapen most when i shoot a falling target in mid air.
Is this a SDK Bug?
Has anyone else seen this or is it just me?
Im useing the 1.2 demo , and im trying to play impulse keepie-uppy , its strange , sometimes I can see the explosion from the hit but "onCollision: does not get called,,it seems to hapen most when i shoot a falling target in mid air.
Is this a SDK Bug?
Has anyone else seen this or is it just me?
Torque 3D Owner Jesse Liles
In the stock projectile.cc line 829 and 830 are being called on the client but not the server about 5% of the time when a slow-moving projectile collides with a flyingVehicle (I have not tested collisions with any other class because the game I'm working on only uses flyingVehicles.) I do realize that the onCollision() call does nothing when executed on the client but explode() does.
The result of this bug is that the projectile appears to collide and explode properly every single time, however, that small 5% of the time, the collision and explosion are only occuring on the client, thus, no damage is being applied and onCollision is not being called on the server.
To test this, I changed these two lines to the following:
if (isServerObject()) { onCollision(rInfo.point, rInfo.normal, rInfo.object); explode(rInfo.point, rInfo.normal, objectType ); }This causes the projectile to pass right through the flyingVehicle without colliding at all.
To reproduce this bug, I have found that the slower the projectile the more often they appear to 'miss'. This was tested with projectiles with a muzzle velocity ranging from 10 up to 55 in increments of 5. The flyingVehicles being used have a mass of 50 and a movement force of 800. While testing I've tried a dedicated server and a client/server 'singleplayer' configuration and the issue occurs with exactly the same frequency either way.
The only variation I can detect in the frequency of this 'miss' occuring is that the slower the projectile's velocity the more likely the 'miss' is to occur.