Questions on Unity 5's physics/multiplayer physics

Hey everyone.

Unity 5 is looking pretty neat. But I have a few questions regarding the new physics update.

I was developing a multiplayer game a while back, with Unity 4, and my game relied on physics, a lot.

A few problems, which probably weren’t entirely Unity’s fault.
And by no means am I an expert, especially when it comes to multiplayer.

But a few problems were, clients that were not the host, upon colliding with rigidbodies, forces weren’t really applied. The host could push boxes with ease, and it was great. But any clients that tried the same, almost didn’t push them at all.

Other various problems were physics rigidbodies are quite laggy/jittery in multiplayer.
And I even did lerping and other various scripts to try and combat it.

But it was still pretty bad.

I had an idea a while back for a multiplayer racing game.
But if my past game couldn’t handle simple VERY SLOW physics. Then how the hell was I gonna tackle a racing game, with rigid bodies going quite fast?

I hope Unity 5 helps with these issues.

I’ve also heard rumors of Unity 5 to use deterministic physics? which would be so incredible you wouldn’t believe
But I’m not sure if it’s true?

Thanks for reading.

I could be wrong, but I don’t think that Unity 5’s physics will improve this particular issue. :confused: It would basically have to be a part of the networking system to synchronize the state of physics.

Well that’s disappointing.

How on earth do people create fast paced multiplayer physics games without them jittering all over?

To be honest… I have no idea.

u can never sync the local physics over the network without jittering, unless, you predict the next position of the physics object and use some thing like MoveTowards(lastSyncPos , predictedSyncPos), something to make the moves between the frames smooth

When dealing with physics in multiplayer, you need one master, i.e an authoritative server, that determines the physics calculations. The clients, should not have any physics calculated on at their end, because this wil lead to conflicts.

Let the server calculate/simulate the physics, and send the resulting transforms to the clients.

So if you’re a client, and you press the forward key to move your car, this forward value gets passed up to the server, which applies the forward value/force to the rigidbody, and in turn, the transform of your car on the server gets sent down to the client, and the client syncs your local car’s transform to the value coming from the server.

This technique has been used well with uLink and Monster Truck Racing Arenas, and even though is there is slight lag in the steering input, even at 250ms ping it still works well and gives predictable, well resolved results.