Version: en

Relaxation

Rule Relaxations#

Relaxation is essentially an alteration of rule behaviour. This can be useful for dynamic rule description.

Any rule can be relaxed by providing a list of relaxations in the rule. Refer to the Rule Contract.

Base Relaxation Contract#

{
...
Relaxations: [
{
"Type": "RelaxationType",
"Value": 70,
"AtSeconds": 5,
"AgeType": "Oldest/Average/Youngest",
"AgeScope": "Ticket/Team/Match"
}
]
}
FieldTypeDescription
TypestringType of relaxation to apply. See Relaxation Types
Value*Value used by the relaxation rule.
AtSecondsnumberNumber of seconds (inclusive) after which the relaxation is triggered.
AgeTypestring (Optional)Use the Oldest (default), Average or Youngest ticket time in the given scope. Not used if AgeScope is Ticket. See Relaxation Types
AgeScopestring (Optional)Can be Match (default), Ticket or Team. Scope from which the ticket time is chosen. See Relaxation Types

Relaxation Triggers#

Relaxations are triggered based on certain conditions. Unity Matchmaker currently only supports ticket age relaxation triggers.

Ticket Age Type#

Ticket age triggers are based on the ticket age in any match and are defined as follows:

  • Oldest: triggers the relaxation when the oldest ticket in the match reaches a certain age.
  • Youngest: triggers the relaxation when the youngest ticket in the match reaches a certain age.
  • Average: triggers the relaxation when the average age of tickets in a match reaches a certain age.

Ticket Age Scope#

Ticket age is computed within a certain scope and compared with AtSeconds. It can be:

  • Match: will relax using the whole match age. This is the default value.
  • Team: will relax using the current team age.
  • Ticket: will relax using the current ticket age. If used, AgeType is not necessary.

Relaxation Types#

Unity Matchmaker supports Rule Control and Reference Change relaxation types.

Rule Control#

This category of relaxation types controls the rule associated with it. The following types are supported:

RuleControl.Enable#

Once the relaxation is triggered, the associated rule will start being enforced.

{ "Type": "RuleControl.Enable", "AtSeconds": 5, "AgeType": "Youngest" }

RuleControl.Disable#

Once the relaxation is triggered, the associated rule will stop being enforced.

{ "Type": "RuleControl.Disable", "AtSeconds": 5, "AgeType": "Youngest" }

Reference Control#

This category of relaxation types controls the reference value in the rule associated with it. The following types are supported:

ReferenceControl.Replace#

Once the relaxation is triggered, the reference value will be replaced with another.

{ "Type": "ReferenceControl.Replace", "Value": 300, "AtSeconds": 10 }

Range Control#

Contrary to other types, Range control relaxation is a special type of relaxation that only applies to TeamCount and PlayerCount. This type of relaxation does not apply to rules.

RangeControl.ReplaceMin#

Once the relaxation is triggered, the minimum value of the TeamCount or PlayerCount will be replaced with the specified value.

{ "Type": "RangeControl.ReplaceMin", "Value": 70, "AtSeconds": 5, "AgeType": "Youngest" }