I was wondering if there were any options for host migration on host quit. I just just wrapped up my mobile 2D shooter game and am ready to start polishing.
Is there currently any ability to migrate host (while using photon Realtime transport layer).
I know that UNET had some options for Host Migration.
If not I will go ahead and look for other options.
We don’t have any built in host migration for MLAPI currently.
There are some ways you could add host migration to a game using the Photon Realtime Transport. Something along the line of the following should work:
While still all clients are connected use a NetworkVariable to agree on a fallback client which will be next in case of the host disconnects.
If the host disconnects have that that fallback client create a new room with a slightly different name like “_1” by starting MLAPI again as host with a different room name and have all other clients connect again to that new room.
To get that to work the fallback client will need some way to store the current game state when stopping MLAPI and spawning the right objects again when entering host mode after the migration.
I’m a bit confused by this. Why do we need to work with Photon? And you mentioned “currently” which implies that Unity has a plan for host migration?
Oh I was not trying to imply that we have plans for host migration. You could do the host migration approach I mentioned with any transport but the procedure is much easier if the transport is relay based and has a concept of rooms. The reason why I mentioned Photon is because the OP mentioned that they are using the Photon Realtime transport.
If you’re talking about the Boss Room Co-op sample, it doesn’t require Photon. But it works with it and they chose to showcase it because Unity’s solution is incomplete. https://discussions.unity.com/t/835947/8