How do I rejoin to room in multiplayer with 2 player?

0 favourites
  • 8 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi,

    Think about Clash Royal game !

    we have 3 minute for play and when i disconnect internet or in low bandwidgh , my enemy see the message ( the enemy left the game ). and if i connect again , i can play game with that enemy from last action! ( sorry for bad english )

    is there any way, do like it?

  • Maybe you can associate the peerId of the client with something on the host and store the peerId on a localStorage on client.

    If the player is disconected you pause the game, show yyour message and wait until someone connect again.

    Then when you connect to the host again (assuming you know which room to connect) you can just check the peerId on your localStorage with the peerId on the host. If they match you can just continue the game like nothing ever happened.

  • thank you for reply.

    but another problem is , first player is host, ok? so if host disconnect from internet or left room for any reason, Peer can't play on that room, because the room is not exist anymore!

  • up!

  • Yes, that's an issue. In this case I don't have a workaround in mind, but you can always have a dedicated server and keep a instance of your game running to be the host and make all the players connect trhough it. I don't know how pratical it would be in a real scenario tho, and escalability could be a problem in the future.

  • You could have the peer, who had the host disconnect, create a new game in the same room and instance though. Then the first host could join back and continue as cb130felix has explained.

    Otherwise you would have to have the peer leave the room and wait for a game of the same type to show up, join it and then have that host reset everything back to how it was.

  • Hi again!

    is it logical to i create room with max peer : 3 ? one for host and two peer ? ( in game like clash royal )

    in this case , i have host witch transmit data with to peer ?!

    (sorry for bad english ):

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • up!

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