How to coordinate physics in multiplayer?

Hi guys! Today I decide I should finally implement physics in my world (or at least make the world solid). But I don’t know the best way to do it. I can message the physicsSpace to everyone, but that is a dirty solution. Or can I message the server when I do “setWalkDirection(…)” at my BetterCharacterControl? I don’t know well how to do it, and I would like to hear your opinions.


PS: Yes, I know that a multiplayer server is way harder to do than a singleplayer game.

Have an authoritative physics space on the server and physics spaces on the client to do the interpolation, sync button presses directly and the physics state in intervals, buffer the time offset due to the network lag. MonkeyZone is an example of that approach.

@normen so you are basically saying that I should message to the clients changes in the physics space (alpha snapshots)?

Look for “MonkeyZone”. It’s an open source example. One experienced person spent one week to make it.

The most simple and reliable way is to just send every x ms all positions of all changed objects.

of course this wont scale to mmo dimensions, (without tricks) but works fine for stuff in the sice of ut, counterstrike ect.