Search Unity

Question Matchmaking puts all players in one server, what are we doing wrong?

Discussion in 'Matchmaker' started by CAwesome, Jan 23, 2024.

  1. CAwesome

    CAwesome

    Joined:
    Nov 28, 2014
    Posts:
    10
    Hello,


    Problem:
    We have a Photon Fusion multiplayer game. It is set up with Unity Auth, Matchmaker and Multiplay. Everything seems to work except that MatchMaker does not understand a room is full. It never allocates new servers, but keeps putting all players into one room.

    What we tried:
    In our queue settings we set max amount of players on a ticket, in the pool rules we set one team with an upper team limit. We add the same max amount to our SQP handler when initializing it. We update player amount with SQP and it reports the right amount of players in the Multiplay Overview dashboard. We use different devices for each player when testing.

    We have tried with and without backfill in pool rules, and with our server doing our own backfill tickets (and deleting them when server is full). But nothing seems to work: Matchmaking wants to put all players in one server.

    Question:
    We realise we do not understand exactly what we have to do to limit the number of players in each room, and let Matchmaking now that it should allocate a new server. What are the crucial steps that we need to take? We feel like we've done everything the docs say, multiple times, but Matchmaking just does not behave like we expect.

    Thanks in advance,
    CA
     
  2. lucy-unity

    lucy-unity

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    18
    The number of players on a match/server should never exceed what the match rules dictate (max teams and max players on each team). If you have a ticketId where this is happening, I could help trace it to see what is happening.
     
  3. CAwesome

    CAwesome

    Joined:
    Nov 28, 2014
    Posts:
    10
    Thanks for the answer! Looking at the ticket Ids we found out that it was a mistake on our side. We (I) had not handled the case where it got an error in matchmaking, went ahead and started a photon session with empty session name, and wound up in any that was online.

    That being said, we are getting closer to getting it working! We are now trying to figure out how to connect to backfill ticket matches using Photon and are running into a problem: When a multiplay assignment is matched to a backfill ticket, what data can we use from the MultiplayAssignment on the client side to connect the new client to our existing running photon server?

    What we need is a way to communicate which session name the server has, through the ticket. We initially create the server with sessionName = matchId from the allocation payload. This enables the first person to get into the server. As all matchIds are unique, we can't use the matchId from the backfill ticket. How can we communicate the sessionName (which is the initial matchId) on the backfill ticket? Looking through the docs, we see no parameter or data that is suitable.

    Looking forward to your reply, or if you can point me in some direction. Thanks!
     
  4. lucy-unity

    lucy-unity

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    18
    Please check out the BR200 sample for backfill integration: https://assetstore.unity.com/packag...-royale-multiplayer-with-photon-fusion-226753
    Docs for this sample: https://doc.photonengine.com/docs/c...tiplay-integration-documentation-by-unity.pdf

    In short, the session name should be the initial matchId. If backfill is enabled in the rules, the backfill ticket created by the matchmaker will include the matchId. If the game server is creating the backfill ticket, this matchId needs to be added to the create backfill ticket request.
     
    CAwesome likes this.
  5. CAwesome

    CAwesome

    Joined:
    Nov 28, 2014
    Posts:
    10
    Thanks! It pointed me in the right direction and I found the matchId argument in CreateBackFillTicketOptions, duh.
    Much appreciated with the help :)