Who handles collision detection/response?

Started by
13 comments, last by SGreth 20 years, 3 months ago
In a client/server archetecture who should handle the collision detection? Consider the following, somewhat complicated, solution. -Each client does their own collision detection of their object (say the space ship they''re flying). -The server does collision detection for all AI objects. -The server does collision detection for all weapons to help prevent client-side hacking. Any comments/ideas on this solution? More importantly, I''m interested to see how everyone else is doing collision detection and response in a client/server environment. Thanks, ~S''Greth
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
Advertisement
it is likely that you would want your sever doing only as little as is nessecary to maintain secure connections for players, thusly i would say all calculations should be client side with the sever well, serving.
In the Unreal Engine, as an example, both sides do it. The server does it authoritatively, however, so the client is just giving the player an approximation of the actual result.

ld
No Excuses
I was originally going to use that approach but my concerns were the following.

1) If the server doesn''t do collision, how can AI objects do any pre-emptive collision checking.

2) Is it secure to have clients doing their own weapon hit-checking. I could see a quick hack where the client just sends out messages saying "I hit obejct X" even if they didn''t. Of course you could *try* and previent this with encrypted packets and other preventative measures, but they aren''t foolproof.
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
quote:Original post by liquiddark
In the Unreal Engine, as an example, both sides do it. The server does it authoritatively, however, so the client is just giving the player an approximation of the actual result.

ld


That was kind of the approach that I was thinking about. Each client does collision detection for it''s body/hull/object, but when it comes to weapons the server should be the authoritative testing agent for those objects.
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
I think that the client should do all of its own collision detection so that it can render the game even when the connection is laggy, but the server should do its own collision detection to prevent hacking, and override the client if the results differ.
quote:Original post by psykr
I think that the client should do all of its own collision detection so that it can render the game even when the connection is laggy, but the server should do its own collision detection to prevent hacking, and override the client if the results differ.


As an example...
With this approach a client would do the collision detection for weapons (to display the special effect of a laser hitting an object...) but the actual damage would be dealt out when the server detects the collision.

this sounds like a good way to do things.
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
It''s how the Torque Game Engine works,

and it was good enough for Tribes.
quote:Original post by BarnyardMessiah
It''s how the Torque Game Engine works,

and it was good enough for Tribes.


If that''s how Tribes did it then it''s good enoguh for me!
Long live Tribes what a great game.
"The difference between insanity and genius is measured only by success."~Bruce Feirstein
Any time the client is allowed to make world state changes, it leads to cheating and stabability problems, much like a peer to peer network game works, and why most people choose client-server now.

The server should do world calculations like hit detection and such to keep the game world data accurate, and send out delta info. The client should do only the amount needed for prediction (i.e. starting with QuakeWorld). Again, it is good if you can let the client do some of the work, but be carefull of cheating.




interNEKO

This topic is closed to new replies.

Advertisement