How to define Diarkis MatchMaker Profiles

Diarkis MatchMaker allows you to define your own matchmaking profiles to create complex custom matchmakings.

Where To Place MatchMaker Profiles

Diarkis MatchMaker profiles MUST be defined on the Diarkis HTTP server.

Calling Diarkis MatchMaker can be from the TCP, UDP, and HTTP servers.

MatchMaker Profile

Diarkis MatchMaker Profiles are defined as a map of string as a key and int as a value.

Matchmaking is a range search of each defined key. Matches must satisfy all keys.

Here are some examples:

levelMatchProfile := make(map[string]int)

// This means the leave must match the range of 10
levelMatchProfile["level"] = 10

// This means the league must match the range of 1,
// which means league must have the exact same value.
levelMatchProfile["league"] = 1

The above example will match players with the following values:

  • A player with level 5 and league 2 will potentially match players with levels between 0 to 10 and league of 2.
  • A player with level 25 and league 1 will potentially match players with levels between 21 to 30 and league of 1.

Range of 10

Range from 0 to 10 Range from 11 to 20 Range from 21 to 30  
0, 1, 2, 3, 4, 5, 6, ,7 ,8, 9, 10 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 21, 22, 23, 24, 25, 26, 27, 28, 29, 30 ...

Range of 1

Range of 1 means the value has to match exactly. For example if the value is 5, then the search has to match exactly the same, which is 5.

How To Define MatchMaker Profile

Below is an example of Diarkis MatchMaker profile:

// Required package
// import github.com/Diarkis/diarkis/matching

rankMatchProfile := make(map[string]int)

rankMatchProfile["rank"] = 100

// The unique matchmaking profile ID to identify the profile
rankMatchMakingProfileID := "rankMatchMakingProfile"

// This is how you register the defined matching profile
matching.Define(rankMatchMakingProfileID, rankMatchProfile)