This refers to a Real-Time (20 player) game. I know that when the host disconnects, the game ends for all peers.
Is there any possibility where the game somehow continues? by one of these techniques/improvisation:
1) A change of host to a random peer (when the original host leaves)
2) Multiple hosts during a game so lesser chances for the game to end quickly.
3) Transfer all peers randomly to different rooms quickly, WITH, their instance variables saved and continued on that new room (let's say the players eat and get bigger, when host disconnects, the player is sent to another room with his bigger size to continue with different players) - This way the player won't be frustrated compared to him getting kicked out with what he had earned.
4) The game does not disconnect, instead all the peers (excluding us) convert into AI Bots (with random movements as the developer would program)
..or some other way?
I'm really curious, especially about Point number 3.
You could do host migration so long as you have at least one person in the room. Point 3 is also possible so long as there is another host there. For both cases here, if there are not enough people playing the game, then the methods will not work effectively.
Thanks briggybros but are there any tutorials/examples of changing host without disconnecting the game?
Has anyone ever tried something like this, so they can share their experience please?
Does it matter that the game disconnects? You could just save everyone's data to a peer when the host disconnects, start a new room with that peer as the host and then force all the other peers to join that new room. If you have a host migration gui while it happens and do all the connection stuff in the background then it would just be a few seconds and then straight back in!
That makes sense. Good idea!
Develop games in your browser. Powerful, performant & highly capable.
How would i achieve this?