I am creating a game which will be PvP, so, 1 player vs 1 player. So, 2 player max. The game, will randomly match players looking to play.
What I am wondering is, how the game will determine host and client.
So, is this a random decsion? Is it the player who looks for a game first? How does it work? How does the network determine, which player is Host and which is Client?
You press play before me. What will happen is a cue to look for other players wanting to play. None exist until I press play. Now that the server sees you and i, it matches us ( I am assuming this is the process (coming from photon)).
I am not sure if it matters, but then at this point, where two players are assigned to a room, is the host client role decided in the background automatically?
Perhaps I am not at the point yet where I have come across this in the tutorial.
If no rooms are availables on matchmaking server (on Unet server) : your first client, who want a room, have to create it.
It’s not “Automatically”, you have to see if a room is available and if not : create it and become a host.
BUT
Imagine you want to host some rooms(to prevent cheat or whatever) on a professional server. Developer will launch some servers, this servers host the game and your client will connect to them.
I haven’t tried yet the second solution (no money/knowledge for that ^^).