Skip to main content
GameDev.net gamedev.net
🔒 Locked

multiplayer collisions

Started by Uthman Aug 10, 2005 at 12:43 AM 3 replies 500+ views
Original Post
Uthman
Uthman
hello all. i've decided to tackle two biggies in order to improve my current project. the biggies being multiplayer support and collision detection. I have read a lot of texts on multiplayer implementation over the internet and think I have an okay model for a fast paced game like mine to run on. ive also read a lot of articles and a book on collision detection and feel that i will be able to implement this as well. the problem, however, will arise when i try to tackle the both of them; i am currently trying to think of the best model for multiplayer collision detection. i know for sure i want each player's own computer to locally test for collisions with world geometry. if a collision response is solicited, so be it. each players velocity, position and state information is sent to the server and propagated to all of the other players. herein lies the first problem-- the problem of cheating. if only velocity, position and state information is uploaded to the server, i can verify that the player isn't in an 'illegal' position, that they aren't moving faster than some allotted velocity and that they have normal status; but say a user lags out for 5 seconds... god knows what the user did on his computer locally within those 5 seconds and in a fast paced racing game he could be on a totally different sector of the map. how can i verify that no illegal actions have occurred? then comes the second problem--collision with other players. where should this be handled? on the server or locally? my instinct tells me on the server because then everyone is just one hop away from finding out if they collided rather than talking to the server, then to another machine, back to the server then back to a local machine again. but if multiplayer collision is handled by the server, then what happens in the instant two players collide and one car goes through the other because the server hasn't sent back or updated the collision information yet? any ideas, suggestion or implementation tips? thanks
"a low level aho master like you couldn't kill me even if I let you"
BradDaBug
BradDaBug
Do all collision detection on the server. This is the official version of what's going down. Clients can do collision detection too to help smooth things out while they wait for official updates from the server.
I like the DARK layout!
Ravuya
Ravuya
Quote:
Original post by BradDaBug
Do all collision detection on the server. This is the official version of what's going down. Clients can do collision detection too to help smooth things out while they wait for official updates from the server.


Right. Do all the collision detection on the server and only send back approved versions of reality to the clients, which can interpolate their animation in a variety of ways (including using local collision) to make everything look nice and smooth.
Evil_Greven
Evil_Greven
Anything else only helps cheaters.

-Greven
GroZZleR
GroZZleR
Quote:
Original post by Uthman
each players velocity, position and state information is sent to the server


Welcome to Hackland!

Only send input to the server.
"I'm trying to move left now."
"I'm trying to move forward now."
"I'm shooting my gun now."

Let the server react to the message and propogate velocity, position and state information to the clients from that.

In your version, a hacked client could say it was at Toronto moving 3,000 kilometres an hour and the next frame it could say it was in Tokyo moving at 0 kilometres an hour.

Never trust the client for anything.

EDIT: And what the hell is this doing in the Lounge?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.