Cloaking network latency.

0 favourites
  • 5 posts
From the Asset Store
[C3] Banner ads, Interstitial ads, Rewared video ads, Rewarded Interstitial Ads
  • Hi,

    I've used Construct's multiplayer plugin for some time now and the thing is, it does most of the work for you, but to make the game look more responsive on the peer's side you have to implement your own techniques. It often looks jumpy and unreal when for example, moving a player with arrows.

    The question is, how can I better cloak and hide network latency?

    For example when a player stops moving, on the peer's side the object is moving ever so slowly pixel by pixel for a few seconds when using local inupt prediction. I to some extent corrected it by rounding the object's co-ordinates on both the peer's and the host's side to the closest integer.

    All suggestions are welcome, even if they only work for specific cases, only work partly and have disadvantages or even if they allow cheating for peers.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I got into an interesting discussion with Ashley about this over a plugin I created to overcome this very problem.

    You can read it here. He didn't like how I worked around this issue and ill be the first to admit i don't know half as much about this subject as he does but I learned (accidentally created) a different method of syncing objects that under low latency conditions works near flawless.

    https://www.scirra.com/forum/viewtopic.php?t=109031

    So I can say that based on my experience your not seeing network latency cause this problem, (I assume all your tests are local but your still seeing lag), what you are experiencing is JavaScript not being fast enough to perform interpolation under low latency conditions. The method i came up with is called extrapolation where objects position is predicted based on its last state. What I do is synchronize instructions instead of objects. IE if player 1 presses left he calls a function on all devices that moves the player left. No object synchronization, just instruction synchronization.

    It appears the upload attachment feature is down for the moment so if you click the link and go to the last page i uploaded a capx the demonstrates how this done. Its more complicated but it does prove the theory. After doing some reading online the conclusion for me is that extrapolation is great under low latency conditions but not so much under high latency. So while it may solve your problem you having now it could create a other problems depending how good your users connection is to the game. Its really a damned if you do damned if you don't sort of thing for now. But check it out. Maybe it will help.

  • I'm eternally thankfull for the time you've spent creating such a long reply.

  • I have no doubt that you know about networking and construct more than I do. And as much as I apriciate your help, I belive I should still wait for you and Ashley to settle on this plugin.

  • Ninetendoo - Thanks but i would consider it settled. I'm not going to release it per his wishes. But the capx (which doesn't use the plugin but is what the plugin is based off of) at least provides a foundation for anyone that wants learn about the method.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)