Game Development Community

Projectile Collision on Client and not Server?

by Jay Barnson · in Torque Game Engine · 02/16/2006 (12:13 pm) · 1 replies

About 1 out of every 6 shots or so, my projectiles were doing no damage when they'd hit an object moving towards the shooter. After a bit of hunting around and adding some "scaffolding" in projectile.cc, it seemed that the offending collisions were being detected by the client, but not the server.

It doesn't look like the collision volume of the projectile itself is being used in the collision detection (it's just a castray call). This is a single-player game, so I *COULD* theoretically make the client collision detection authoritative - but that might not help me on a low-framerate client.

I could also slow down the enemy targets or increase their collision volume - but I would rather not.

Does anyone have any other suggestions for improving the collision detection on the server?

About the author

Jay has been a mainstream and indie game developer for a... uh, long time. His professional start came in 1994 developing titles for the then-unknown and upcoming Sony Playstation. He runs Rampant Games and blogs at Tales of the Rampant Coyote.


#1
02/18/2006 (11:27 am)
Okay - If there's a better solution I'd like to hear it, but for now I've made the client authoritative and it seems to work. I made creative use of netObject::mServerObject. I made it public, and passed the target object's mServerObject on to the client projectile's server object. The server-side, on it's next update, sees the 'forced collision' object and performs its onCollision and explode functions based on it's current position.

It seems to work thus far.

Don't try this for multiplayer, kids! But i'm doing an arcade-action game, so fast response to collisions is critical.