Automatic matchmaking
Many games do not use a lobby. For example, console games often opt to randomly match players together rather than allowing them to browse a list of games (which could be unwieldy with a controller), or some games also have a "Quick Play" button in the lobby which allows the user to jump right into the action without having to browse the server lists. Usually, players can specify a preference, such as which map to play on, or what game mode they want.
Luckily, random matchmaking in PUN is very easy.
In PUN, you can call the PhotonNetwork.JoinRandomRoom function. This function takes a Hashtable of expected properties, and the desired max player count. It will attempt to join a random room, which will either call OnJoinedRoom ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access