Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Creating Multiplayer Rooms That Only Let Certain Players Join

Discussion in 'Matchmaker' started by unkno0wn_gd, Aug 9, 2023.

  1. unkno0wn_gd

    unkno0wn_gd

    Joined:
    Mar 26, 2021
    Posts:
    2
    So, the explanation is simple but the implementation, not so much. I want players to choose between being either a type A player or a type B player. I then have different rooms that players can join multiplayer online. But, each of these rooms can only let in specific types of players. For example, one room might only allow 1 player of type A and a maximum of 8 or minimum of 3 of type B. This would result in 1 type A and a group of type B. My question is how would I do this?

    I've worked in online multiplayer before, especially photon, but looking around i'm not sure which 'framework' would be best for doing this. Obviously, I wouldn't mind staying with photon but if switching is necessary then I will do it.

    If you have any ideas on how to do this in any way your help will be greatly appreciated.
    Thanks:)
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,056
    If you always just allow one type-A player in a room, then you could make those clients create rooms (and never join any). The type-A players could define how many players are allowed to join and then close the room, once they decide there are enough players.

    Type-B players would never create rooms and instead always join.
    If the type-A player leaves a room, then I would just close the room and have everyone else leave and join another room.

    This would be a simple approach and if this makes sense for players depends a lot on them picking A or B in a ratio which fits your matchmaking (filling rooms).

    This can be done with Photon's matchmaking.