Multiplayer - NonAuthoritative Host

  • Hey there fellow Constructers.

    Does anyone have any experience with the Multiplayer Plugin, to use it for a non-authoritive host scenario?

    All the examples, and the plugin functions seem to restrict us to use an authoritive Host which controls all gameplay for the peers.

    This is good in case you want to prevent players from cheating, within a competitive multiplayer game, such as the advanced shooter example in Construct 3.

    But what if you're trying to create a coop-experience, or other scenarios were you simply want to trust all Peers to improve their input experience and prevent issues such as rubber banding and so on.

    I've been experimenting with the multiplayer plugin and managed to trust peers by simply controlling your character directly. That's great!

    But the problem is that all data is still sent to the host in the first place, before the host hands it off to all the other peers.

    Even though the experience for peers (to walk for instance) is butter smooth this way.

    But all the data sent, is still getting extremely delayed for all other Peers, since it relays through the Host in the first place.

    I would like to directly Broadcast my position (and more data) to ALL players (Peers) directly.

    A straight forward Peer to Peer network without Host would be great.

    But the Multiplayer Plugin seems to force me to use a Host in any case.

    Since the Multiplayer Plugin seems to be deeply integrated with an authoritive Host in mind, i'm not sure if it's technicaly even possible.

    Main Problem being: The function

    Add client input value sends data always only to the Host

    What i think would be a great solution for me:

    - I (peer) send my position (x,y) and data(variables) directly rather than my inputs

    - I use extrapolation to predict the movement of other peers i see (smoothing their movement for my view) so they don't stutter in case of packet loss or delay

    This way everyone will have pixel perfect movement/control because they control themselfs locally.

    Movement of other players should look just fine due extrapolation.

    And all actions of others peers aren't further delayed through the host.

    A hybrid solution would also be ok, so the Host could still exist and take over the authoritative role for certain actions.

    But it's not really a requirement for me.

    Any thoughts/ideas on the Multiplayer Plugin?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The short answer is that there is no way for peers to directly communicate, messages must be passed through the host.

    The longer answer is that even when using a non-authoritative host, which is definitely viable by ising messages instead of sync, bypassing the host won't solve your latency (delay) problems. If sending a message directly to a peer takes 20ms, and sending it through a host takes 40ms, there is basically no different at all. There is never a guarantee that a peer to peer latency will be lower than peer to host to peer since latancies can vary wildly.

    Basically in summary, regardless of host authority, if you set up your interpolation (and extrapolation) well, there should be no practical difference between relaying messages through the host vs sending directly to all peers, unless host latency is garbage.

  • Thanks for the reply!

    I will relay everything through the host in that case.

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