Multiplayer question about host switching

0 favourites
  • 2 posts
From the Asset Store
Toggles Dials Switches and Alerts ! A foundational sound grouping of Analog type switches and Steampunk effects
  • Have gone through all multiplayer tutorials.

    Its been mentioned that if the host goes down all the peers will be disconnected. Wondering if there is any way to switch the host to next peer when the first user goes offline/disconnected?

    Any inputs is appreciated!

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have gone through all multiplayer tutorials.

    Its been mentioned that if the host goes down all the peers will be disconnected. Wondering if there is any way to switch the host to next peer when the first user goes offline/disconnected?

    Any inputs is appreciated!

    Automatically? No but...

    It's doable but it is astronomically advanced events. There are 2 category to approach this, whether a forced kick or a permitted leave. However, I only managed to create mechanism for chat only, for games it would be crazy and might be not doable by just sheer patience and will, preserving game state is a big job.

    Forced kick:

    All peer should keep the log on live events. Once the host left forcefully, peer can have the on kicked trigger to initiate the room creation again. In this case, it's like a race of who can connect to signal first. Upon room creation, connected peers will be updated with logged message, and resume chat like usual.

    Permitted leave:

    This allows more control on who's get to be the host, which the host can choose one of the peers name, broadcast the name of the newroom and the chosen peer name, once all peer confirmed to receive the data, everybody can safely leave the current room and wait for the new host to create room and all peer can join in once the room is available on roomlist. Then update the chat state as usual.

    For games, it depends on the complexity of your game, the difficulty of events setup goes exponentially with the complexity of games. Note that the suggested method, will need 1~5 seconds of recovery, so it's pretty advance.

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