[ad_1]
Hi all, I’m making an attempt Colyseus extension. The downside I confronted is after I change place schema within the again finish, the entrance finish onChnage callback calls solely after 3-4 frames of precise sport, so it not strikes easily as if I’ll change place in cocos element replace technique. I can perceive it took a while to convey knowledge from again finish, however how builders do that clean motion in multiplayer video games?
Hey @Horchynskyi,
As you noticed, the frequency you obtain updates from the server goes to be decrease than your native replace/body fee. If you merely apply the brand new x/y place on the client-side, you’ll get a lagged really feel.
A typical method to unravel that is to use linear interpolation. As you’ve got extra render frames than frames receiving knowledge, these additional frames are used to “smooth out” the native place in the direction of the most recent place despatched by the server.
There’s a information for Phaser obtainable right here which you’ll be able to adapt for Cocos Creator: Part 2: Linear Interpolation
Hope that helps! Cheers!
[ad_2]