Multiplayer - Syncing positions.

0 favourites
  • 1 posts
From the Asset Store
The official Scirra Multiplayer Signalling Server for helping peers find and connect to each other
  • Hello,

    So I just did a simple multiplayer project, and only have two instances of one object during gameplay. i.e one instance for host and another for peer. Obviously, the object, let's call it Obj1, is synced along with it's position.

    Now, as with most, the peer experiences lag, and the position it sees is delayed. I was going to look into reducing lag, when I thought about sending Obj1's position via a multiplayer message (every tick), instead of syncing positions.

    I tested this by making a copy of Obj1, i.e Obj2.

    So during gameplay.

    Peer input is sent to Host via client input state > Host reads input and sets Peer's Obj1's position > Host now sends Peer's Obj1's position via a multiplayer message back to peer > Peer receives message and sets Obj2's position from the message. (Obj1's position is still synced so I can compare Obj1's and Obj2's position on Peer side)

    From this I saw that, Obj2's position is more accurate. The position gets updated faster and hence more true to what Host sees.

    Any comments on this?

    NOTE that this is done every tick, and sending a message every tick is intensive. Plus it's prone to jitters. Obj2's position sometimes goes to (0,0) for a tick and get's back to wherever.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)