"squad" joining a random room


Imagine there're 3-4 friends wanting to play a PUN game together - can they "group" together to join a room all at once?

Do you plan some built in functionality like that? That's a pretty popular concept (playing with friends) afaik.

Can this be solved right now by some custom coding? (but still hosting on photon cloud)



  • The cloud can't host custom code. It runs the same logic for all virtual applications.

    You could make them join the same room simply by room name.
    As we don't have a friend concept, there must be some way for them to communicate. Use that to agree on a name for the room. If you got unique usernames, you can use one user's name and add some time code to it or use a guid if you can get this into your client to auto-join the game.

    If your game has some kind of public lobby (a room with more players but less action (only chat) in it), you could get players there to meet and agree on one name. Send this name via RPC to the target players. One player creates the room as invisible (but not closed). It doesn't matter if more than one player tries to create the room: This will fail and they can join the room after someone created it.
  • Thanks!
    So is it currently possible to implement automatic matchmaking so several such player-squads could get into one room? (or will I need a separate service for this?)
  • As said: You could have one "waiting room" where everyone (friends and unknown players) gather until they group and leave for another room where they play a match.
    This means you need to implement some RPCs to message and to manually group players who then agree on some room-name to go to.

    Or you need a separate service which knows who is friend with who else and to setup games. The actual way to get into a room as group would be very similar: Create a unique room-name, distribute to all players and make each individually get into it.

    Once the squad members know their appointed room-name, this would be the best workflow:
    Each player individually tries to CreateRoom(name) and if that fails, JoinRoom(name). One of the players will succeed in creating the room, the others will join, no matter who did create the room actually.
  • Thanks again for explanation,
    I'm a happy man now :).

    Maybe this is worth adding to the docs?