Version: en

Rules

warning

This documentation is now deprecated. If you are using Matchmaker Self Serve though UDash, please use the documentation here.

Rules#

A rule is a generic way of describing a logical goal-seeking behavior. Rules apply to different levels of the matchmaking logic: Match-level and Team-level. Match level rules ensure the validity of the match they are defined in, while Team level rules ensure the validity of the team they are defined in.

All rules must pass in order for a match/team to be considered valid. However, you can define an inverse rule (one that should NOT pass) by setting the Not field to true.

Base Rule Contract#

{
"Type": "RuleType",
"Source": "SourcePath",
"Not": true/false,
"EnableRule": true/false,
"Relaxations": [
{
Relaxation1,
Relaxation2
}
]
}
FieldTypeDescription
TypestringRule to apply. See Supported Rules
SourcestringData source path. See Supported Data Sources
Reference* (Optional)Reference to compare to. Not used by all rules.
Notbool (Optional)Inverse the rule if true. false if not provided.
EnableRulebool (Optional)Disable the rule if false. true if not provided. This is usually used to disable or enable a rule later by a relaxation.
RelaxationsList<Relaxation>List of relaxations to apply. See Rule Relaxations

Supported Rules#

RuleInputDescription
DifferenceSource: List<number>
Reference: number
Ensures that the difference between all values in a list is within a certain distance.
EqualitySource: List<*>
Reference: * (Optional)
Ensures that all values in the list are equal.
LessThanSource: number
Reference: number
Ensures that the source value is less than the reference value.
LessThanEqualSource: number
Reference: number
Ensures that the source value is less than or equal to the reference value.
GreaterThanSource: number
Reference: number
Ensures that the source value is greater than the reference value.
GreaterThanEqualSource: number
Reference: number
Ensures that the source value is greater than or equal to the reference value.
InListSource: *
Reference: List<*>
Ensures that the source value is in the reference list.
IntersectionSource: List<List<*>>
Overlap: number
Ensures that the list of given lists has a minimum intersection of the overlap number provided.

Examples#

Difference#

Ensure that all tickets in a match are within 200 skill points of each other#

{ "Type": "Difference", "Source": "Match.Tickets.Data.Skill", "Reference": 200 }

Ensure that all tickets in a team are within 200 skill points of each other#

{ "Type": "Difference", "Source": "Team.Tickets.Data.Skill", "Reference": 200 }

Equality#

Ensure that all tickets in the monster team selected this team#

{ "Type": "Equality", "Source": "Team.Tickets.Data.SelectedTeam", "Reference": "Monster" }

Ensure that all tickets in the match have the same password#

{ "Type": "Equality", "Source": "Match.Tickets.Data.Password" }

Ensure that all tickets in the match are in the same skill bracket#

{ "Type": "Equality", "Source": "Match.Tickets.Data.SkillBracket" }

LessThanEqual#

Ensure that all tickets in a match have a maximum of 200 latency#

{ "Type": "LessThanEqual", "Source": "Match.Tickets.QosResults.Latency", "Reference": 200 }

Ensure that a team has a maximum of two Medics#

{ "Type": "LessThanEqual", "Source": "Team.Players.Data.PreferMedic.Count", "Reference": 2 }

GreaterThanEqual#

Ensure that a ticket has a skill of at least 500#

{ "Type": "GreaterThanEqual", "Source": "Ticket.Data.Skill", "Reference": 500 }

InList#

Ensure that a ticket is placed in the monster team if a monster character is chosen#

{ "Type": "InList", "Source": "Ticket.Data.ChosenCharacter", "Reference": [ "Monster1", "Monster2", "Monster3" ] }

Intersection#

Ensure that all the tickets in the match have at least three preferred maps in common#

{ "Type": "Intersection", "Source": "Match.Tickets.Data.PreferredMaps", "Overlap": 3 }