How do I handle collisions in my game? We're talking about clients physics vs clients physics

There’s some lag in my game. This is just network lag. No memory leaks or bad scripts.

I want there to be collisions but I don’t want some cart to ram you into a tree. I also don’t want to be sent to the back because a player cart froze in front of me and bounced me back.

How do other videogames handle their physics?

1 Like

Looks to me like you read it wrong. In the original thread it specifically says:

Please keep it civil.

Both of your solutions involve turning off collisions between the carts, which is not what the OP asked for. They’re asking for a way to deal with jittery/laggy physics without players getting flung or teleported back.

In other words they want the carts owned by different players to be able to collide with each other. I have read your post just fine, there’s no reason to get so worked up over it.


I would personally recommend using a velocity cap to prevent flinging, that way the carts can still collide but just not fly off randomly. You can either compare the absolute velocity, or the difference in velocity across 2 frames. I think the latter is a bit better because it also prevents sudden stops, but it’s a bit more complex to implement.

First, :heart: to posters on this thread. I found an educational post from Valve engineers on how they deal with client/server updates. Unfortunately not immediately actionable, but may give you some ideas:

https://developer.valvesoftware.com/wiki/Latency_Compensating_Methods_in_Client/Server_In-game_Protocol_Design_and_Optimization