question

justin-1 avatar image
justin-1 asked

Matchmaking TeamDifferenceRule is not working properly

We have setup a Team difference rule for our matchmaking that doesn't seem to work properly. We have a maximum team difference for BattleRating set to 15. When starting a 3v3 matchmaking with 2 parties of 3, a match can't be found when the BattleRating of all the members in party 1 is 0 and all the party members in party 2 have a BattleRating of 13. The average BattleRatings of the parties should be 0 and 13, so that's within the 15 range we have set up. Matchmaking does working when the parties have an average BattleRating of 0 and 12.

Here's what the queue looks like:

{
  "Name": "MatchmakingRuleBug",
  "MinMatchSize": 2,
  "MaxMatchSize": 6,
  "MaxTicketSize": 3,
  "ServerAllocationEnabled": false,
  "TeamDifferenceRules": [{
      "Attribute": {
        "Path": "BattleRating",
        "Source": "User"
      },
      "Difference": 15.0,
      "DefaultAttributeValue": 0.0,
      "Name": "TeamBattleRatingRule"
    }
  ],
  "Teams": [{
      "Name": "Team1",
      "MinTeamSize": 1,
      "MaxTeamSize": 3
    }, {
      "Name": "Team2",
      "MinTeamSize": 1,
      "MaxTeamSize": 3
    }
  ],
  "StatisticsVisibilityToPlayers": {
    "ShowNumberOfPlayersMatching": false,
    "ShowTimeToMatch": false
  }
}

Here's the CreateServerMatchmakingTicket request of the first party:

{
  "Members": [{
      "Entity": {
        "Id": "Player1ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 0
        }
      }
    }, {
      "Entity": {
        "Id": "Player2ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 0
        }
      }
    }, {
      "Entity": {
        "Id": "Player3ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 0
        }
      }
    }
  ],
  "GiveUpAfterSeconds": 30,
  "QueueName": "MatchmakingRuleBug"
}

CreateServerMatchmakingTicket request for second party:

{
  "Members": [{
      "Entity": {
        "Id": "Player4ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 13
        }
      }
    }, {
      "Entity": {
        "Id": "Player5ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 13
        }
      }
    }, {
      "Entity": {
        "Id": "Player6ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 13
        }
      }
    }
  ],
  "GiveUpAfterSeconds": 30,
  "QueueName": "MatchmakingRuleBug"
}

This should create a match between the 2 parties, but it doesn't. If you replace the BattleRating of all players in the second party with 12, matchmaking will put both parties against eachother like intended. For some reason, the limit of 15 isn't working.

I've also tested this with 1v1, but the problem seems worse there. A BatteRating difference of 20 somehow still creates a match, even though it's above the 15 limit we've set. Here are the requests for that:

{
  "Members": [{
      "Entity": {
        "Id": "Player1ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 0
        }
      }
    }
  ],
  "GiveUpAfterSeconds": 30,
  "QueueName": "MatchmakingRuleBug"
}
{
  "Members": [{
      "Entity": {
        "Id": "Player2ID",
        "Type": "title_player_account"
      },
      "Attributes": {
        "DataObject": {
          "BattleRating": 20
        }
      }
    }
  ],
  "GiveUpAfterSeconds": 30,
  "QueueName": "MatchmakingRuleBug"
}

These two tickets have a difference of 20, which is above the 15 limit that we have, so they should not be in a 1v1 match with each other. But PlayFab somehow creates a match for them. What's going on?

Matchmaking
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Xiao Zha avatar image Xiao Zha commented ·

We have reported this issue to the team, and will notify you if there are any results.

0 Likes 0 ·

1 Answer

·
Xiao Zha avatar image
Xiao Zha answered

The attribute difference is the sum of the difference between the teams (39, in your first example) divide by sqrt (2 * players/teams) because as team sizes get larger, there's a greater tendency for the attribute difference gap to be larger. In this case, the 39 is divided by sqrt (2* 6 players/ 2 teams), getting it to ~15.921, which is larger than the 15 allowed.

So, the allowed value isn't exactly the team differences, but an approximation as explained above. You can modify your queue configuration based on the explanation above to see if it works the way you want.

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justin-1 avatar image justin-1 commented ·

This makes no sense to me and is definitely something that should be documented here: https://learn.microsoft.com/en-us/gaming/playfab/features/multiplayer/matchmaking/config-queues#team-rule-types

Thanks for sharing how it's calculated. Now I know that the value I need to use for the matchmaking queue is calculated by this: (desired value * players per team) / sqrt(total players). So if I want my 15 as max average difference between the teams, I actually use (15 * 3) / sqrt(6) = ~18.371 as a rule in the matchmaking queue. Still makes no sense to me, but at least I can work around it now.

0 Likes 0 ·
Xiao Zha avatar image Xiao Zha justin-1 commented ·

Sorry for the confusion. And the team difference is not calculated as (desired value * players per team) / sqrt (total players), but instead (sum of the difference between the teams)/sqrt (2*number of total players/number of teams).

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.