Version: en

Asymmetrical Teams Sample

This config file configures the matchmaking logic for an asymmetrical team game with team and role preferences:

  • All players will be matched in either a Player Team or a Monster Team.
  • The matchmaking logic will create a match only if there are exactly 4 players on the Player Team and exactly 1 player on the Monster Team.
  • Players will only match with other players in a match if their Skill is within 200 points of each other.
  • Players will only be assigned in a Human Team if their SelectedTeam data property is equal to Human.
  • A Player Team will only be considered valid if there is a maximum of two players that have the data property PreferMedic set to True.
  • A Player Team will only be considered valid if there is a maximum of two players that have the data property PreferTank set to True.
  • Players will only be assigned in a Monster Team if their SelectedTeam data property is equal to Monster.

Config File#

{
"Matchmaking": {
"Name": "humans-vs-monsters",
"TargetFunction": {
"Name": "rule-based"
},
"Config": {
"Name": "humans-vs-monsters",
"DefaultQoSRegion": "0000-0000-0000-0000",
"MatchDefinition": {
"MatchRules": [
{ "Type": "Difference", "Source": "Ticket.Data.Skill", "Reference": 200 }
],
"Teams": [
{
"Name": "Human Team",
"TeamCount": { "Min": 1, "Max": 1 },
"PlayerCount": { "Min": 4, "Max": 4 },
"TeamRules": [
{ "Type": "Equality", "Source": "Ticket.Data.SelectedTeam", "Reference": "Human" },
{ "Type": "LessThanEqual", "Source": "Team.Players.Data.PreferMedic.Count", "Reference": 2 },
{ "Type": "LessThanEqual", "Source": "Team.Players.Data.PreferTank.Count", "Reference": 2 }
]
},
{
"Name": "Monster Team",
"TeamCount": { "Min": 1, "Max": 1 },
"PlayerCount": { "Min": 1, "Max": 1 },
"TeamRules": [
{ "Type": "Equality", "Source": "Ticket.Data.SelectedTeam", "Reference": "Monster" }
]
}
]
},
"TicketTimeoutMs": 1000.0
}
}
}

Ticket Sample#

Base-64 encoded field values#

{
"Properties": {
"Players": "W3siSWQiOiJQbGF5ZXIxIiwiRGF0YSI6eyJQcmVmZXJNZWRpYyI6IlRydWUifX1d",
"Data":"eyJQcmVmZXJUZWFtIjogIk1vbnN0ZXIifQ=="
}
}

The decoded contents of the above fields are:#

"Players": [{"Id":"Player1","Data":{"PreferMedic":"True"}}]
"Data": {"PreferTeam": "Monster"}