best way to do 3D collision in a networked game

im making an online game and i was wondering what is the best way to do collision between objects? i have done some networking in the past and i have had the server control the collision (it was 2d collision), or should i have the client do the detection?

Look at the roaming ralph example.

Make the same but shared via users(P2P) and make server test it so ppl couldn’t cheat :wink:

if i have the server test for collision then how would i do it?

You’d have to replicate your scene on the server.

Doing collision tests on the server is generally harder than doing it on the client, and it doesn’t automatically prevent cheating. (If preventing cheating is really important to you, you have to design your game very carefully with this in mind. Performing collisions on the server has little to do with the bigger picture of preventing cheating.)

In general, unless you are real comfortable with the fundamental concepts of client-server communications, I wouldn’t recommend trying anything fancy like server-based collisions. Just do it on the client, the easy way.


im not concerned with cheating, but does this sound like it would work?

the client sends the server data on where the character is located every frame or every time the character moves and the other characters and objects in the game are send to the client every frame.

jup. that’s basically how it works. how often you send, when and if you send the data depends on your game itself. an FPS needs lots more updates. some RPG’s might be fine with only 2 positions per second.