Room count / custom property?
Options
Hi all,
I've been working on my multiplayer game now for a while, using Photon PUN (Unity). Btw great so far. I pretty much made all things I wanted in actual game session and am now moving to matchmaking bits.
To give a bit of background heres what I have now:
1. N unity scenes to play on
2. Player picks one
3. Room is created or joined based on custom property (scene index, simply)
Its a 2 player battle type game, btw.
All of the networking stuff is processed on scene load (main menu is not networked for now).
Now, I have following scenario I want to achieve and couple of related questions:
***
When player opens list of scenes available, I'd like to show number of open/available (or total if available is not possible) rooms for each scene on UI.
Matchmaking would still be random but since idea is that players can access more scenes (arenas) with more XP, it would be very helpful to see which scene/arena has people playing/waiting for match. Especially in case where there's low amount of players in game.
Something like:
Arena 1 [17]
Where 17 is room count with that custom property.
Based on my readings so far - I think I need to connect all players to photon in Menu scene and then count rooms by properties via RoomsList somehow. Is that right?
See I only need this info for visual/usability purposes in game.
Also, if that's the way to go - one important question: do connected users but not in room (like in this case - people upgrading something or similar in main menu) count towards CCU limit? I hope not
I'm a bit new to Photon all together so bear with me please, I hope I'm not asking too silly question Also typing on mobile do excusenany typos. Thanks in advance and keep up the good work.
I've been working on my multiplayer game now for a while, using Photon PUN (Unity). Btw great so far. I pretty much made all things I wanted in actual game session and am now moving to matchmaking bits.
To give a bit of background heres what I have now:
1. N unity scenes to play on
2. Player picks one
3. Room is created or joined based on custom property (scene index, simply)
Its a 2 player battle type game, btw.
All of the networking stuff is processed on scene load (main menu is not networked for now).
Now, I have following scenario I want to achieve and couple of related questions:
***
When player opens list of scenes available, I'd like to show number of open/available (or total if available is not possible) rooms for each scene on UI.
Matchmaking would still be random but since idea is that players can access more scenes (arenas) with more XP, it would be very helpful to see which scene/arena has people playing/waiting for match. Especially in case where there's low amount of players in game.
Something like:
Arena 1 [17]
Where 17 is room count with that custom property.
Based on my readings so far - I think I need to connect all players to photon in Menu scene and then count rooms by properties via RoomsList somehow. Is that right?
See I only need this info for visual/usability purposes in game.
Also, if that's the way to go - one important question: do connected users but not in room (like in this case - people upgrading something or similar in main menu) count towards CCU limit? I hope not
I'm a bit new to Photon all together so bear with me please, I hope I'm not asking too silly question Also typing on mobile do excusenany typos. Thanks in advance and keep up the good work.
0
Best Answer
-
Hi @Nosf,Based on my readings so far - I think I need to connect all players to photon in Menu scene and then count rooms by properties via RoomsList somehow. Is that right?
Yes, the clients can connect to Photon and then automatically join the lobby by either settingPhotonNetwork.autoJoinLobby = true;
or using the same option in the PhotonServerSettings. After joining the lobby you can use theOnReceivedRoomListUpdate()
callback to get notified about a Room List Updates. In this callback you can use and iterate throughPhotonNetwork.GetRoomList()
to count the occurrence of each available scene / arena by accessing the room's properties (make sure to make the wanted properties available for the lobby).Also, if that's the way to go - one important question: do connected users but not in room (like in this case - people upgrading something or similar in main menu) count towards CCU limit?
They do, as far as I know.I'm a bit new to Photon all together so bear with me please, I hope I'm not asking too silly question
No, definitely not. And if you have further questions or something is not clear, please feel free to ask again.5
Answers
-
Hi @Nosf,Based on my readings so far - I think I need to connect all players to photon in Menu scene and then count rooms by properties via RoomsList somehow. Is that right?
Yes, the clients can connect to Photon and then automatically join the lobby by either settingPhotonNetwork.autoJoinLobby = true;
or using the same option in the PhotonServerSettings. After joining the lobby you can use theOnReceivedRoomListUpdate()
callback to get notified about a Room List Updates. In this callback you can use and iterate throughPhotonNetwork.GetRoomList()
to count the occurrence of each available scene / arena by accessing the room's properties (make sure to make the wanted properties available for the lobby).Also, if that's the way to go - one important question: do connected users but not in room (like in this case - people upgrading something or similar in main menu) count towards CCU limit?
They do, as far as I know.I'm a bit new to Photon all together so bear with me please, I hope I'm not asking too silly question
No, definitely not. And if you have further questions or something is not clear, please feel free to ask again.5 -
Hi,
thanks for pointing me to right direction.
I got this solved quite fast.
Cheers0