State Buffer - Interpolation/Extrapolation, Smoothing
Hi,
I just tried to use a State Buffer to get a better Synchronization.
As references i used
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
http://wiki.unity3d.com/index.php/NetworkView_Position_Sync
and some other old Forum posts.
The Technique works good so far but i got some kind of jitter. After Implementing Extrapolation, i figured out it switch between Interpolation and Extrapolation quite often.Even if it does not, there is no smooth Movement.
My code:
https://pastebin.com/VeiAQ8ft
I would be very Interested in some Optimization, hints, tips..
I just tried to use a State Buffer to get a better Synchronization.
As references i used
https://developer.valvesoftware.com/wiki/Source_Multiplayer_Networking
http://wiki.unity3d.com/index.php/NetworkView_Position_Sync
and some other old Forum posts.
The Technique works good so far but i got some kind of jitter. After Implementing Extrapolation, i figured out it switch between Interpolation and Extrapolation quite often.Even if it does not, there is no smooth Movement.
My code:
https://pastebin.com/VeiAQ8ft
I would be very Interested in some Optimization, hints, tips..
0
Comments
-
Are you using an initial delay to fill the buffer somewhat?
I (personally) have no experience yet with state buffers. Maybe you can keep us posted on what you find out and then others will join the discussion...1 -
Now its working. Set SendRate and SerializeRate to 20 and it should work ok.
There is still a lot of improvement, will post again if made some .
https://pastebin.com/z4g7Yk3d0 -
Thanks @S_Oliver for sharing your code. It helped me start working on my own synchronization code.
The Extrapolation() function in the last pastebin lacks the actual extrapolation though .
I also have found that it is useful to add some sort of smoothing. I compute a position in the future and then move towards it instead of just teleporting.0 -
Your welcome.olistan said:Thanks @S_Oliver for sharing your code. It helped me start working on my own synchronization code.
I didn't elaborate this part.olistan said:
The Extrapolation() function in the last pastebin lacks the actual extrapolation though .
I also have found that it is useful to add some sort of smoothing. I compute a position in the future and then move towards it instead of just teleporting.
Would be nice to see how you improved the Extrapolation part.
@olistan
0 -
https://github.com/SradnickDev/GravityCombat/blob/e6af73048ad50f0f59466e4710cb9de3899e3d8f/Source/Assets/Scripts/PlayerBehaviour/Model/PlayerSyncModel.cs this works just fine.
But it is no general Solution.1