Maximum number of private chat groups

edited October 2016 in Photon Voice
Since the data type of the audio group is `byte`, I expect the maximum number of private chat groups is 23. In our game, we have a lobby which will have more than 23 players, how can I add more groups without creating a new voice room ? What we want to do is allowing private chat while still listening to the global group.

EDIT: We've changed the design, now players can only be involved in one chat at any time, so the maximum number of private chat group does not matter any more.


  • Hi @ashen,

    I expect the maximum number of private chat groups is 23.

    How did you come up with this number?
    Yes audio group value is of type byte which means it can take up to 256 values but since 0 is reserved for global audio group then you can have up to 255 audio groups.
  • ashenashen
    edited October 2016
    Since a group number can only be used for one purpose at any time, either for private chat or global chat, if players can only private chat to each other, then the maximum will be 255. To support for both type of chats, I use
    n * (n-1) / 2 + n <= 255
    to calculate the maximum number `n`. With our old design, player can private chat and global chat at same time. Also I want to implement a simple area of interest mechanism to reduce data transfer, so I decided to assign each player a global group and for each pair of players a private group. Maybe there're better solutions. Anyway, the design has been changed, now I only need to allocate one group for ecah player.

    I have another question not related to group number: how can I know whether a player left the room due to connection problem ? I would like to reconnect in this case, thanks.
  • You should not cram a lot of people into one room and then use Groups to separate them again.
    Why not work with rooms to begin with?
    Changing the Interest Groups count is currently out of the question.

    The client which got disconnected will know that this was due to a timeout (in general, connection loss). There are callbacks for those cases and you can reconnect.
    The others won't know if the player left deliberately or got disconnected.
Sign In or Register to comment.