im trying to make my game work online, and i have physiscs base movement where the player can collide with other players, but i don't know what properties to sync in the syncronizer in order for the collisions to move properly. i've tried syncing the linear velocity but when they collide they bounce , which they shouldn't, or with inertia they sometimes got stucked or had some weird behaviour. Which property or combination of properties should i sync? thanks in advance
There are many things that can cause jitter. But In general you should sync position rotation velocity and angular velocity while allowing the physics to happen on both client and server in the interim between packet frames.
Here is a work in progress multiplayer synchronizer I made for my physics based game.
This implementation has a ring buffer to smooth out network jitter at a cost of network delay.
ok, thanks. I will take a closer look to that in the future. im still on a physics glitch problem with networking, but on a different one jaja. i will make a different post for it.
You should check out my code related to the physics glitch in the previous post.
The main problem is that packets get serviced on the process cycle and this does not work well for the physics server. You can however change that behaviour by disabling the automatic mutiplayer api poll and manually polling during the physics process.
The second solution is to delay applying packet data until the physics cycle, (this is what i did in my previous post.).
There is no advantage between the two, but you may want to buffer packets anyway if the player is a rigidbody to begin with. This is to setup for client side prediction.