Matchmaking Guide
使用Photon,進入一個房間與人遊戲(或對戰)是非常容易的。
基本上有三種方法:
要麼告訴伺服器找到一個匹配的房間,要麼跟隨朋友進入她的房間,要麼獲取一個房間列表,讓用戶選擇一個。
所有這三種變數都被Photon支持,您甚至可以推出您自己的。
我們認為,對於大多數遊戲來說,最好使用快速和簡單的匹配,所以我們建議使用隨機匹配,也許還可以對技能、等級等進行過濾。
Matchmaking Checklist
If you are having issues matching players, here is a quick checklist:
- Verify that clients are connected to the same Master Server.
Only players connected to same Master Server can play with each other no matter what device or platform they're using.
- Verify that players have different unique UserIDs.
Players with same UserID cannot join the same room. - Before trying to join a room by name, make sure that this room is created.
Alternatively useJoinOrCreateRoom. - If you are trying to join a random room, make sure to choose the same lobby (name and type) used when creating it.
- If you are doing random matchmaking using room properties as a filter make sure to set the keys of those properties to be visible from the lobby when creating the room.
- If you are doing random matchmaking with SQL filters make sure to set the reserved filtering properties keys used to be visible from the lobby.
It is also important to relax the SQL filter with each random matchmaking attempt or use chained filters or create new rooms at some point after a number of failed attempts. - If you are implementing asynchronous matchmaking, make sure to use webhooks with proper configuration (enable "AsyncJoin") or use AsyncRandomLobby.