The way Matchmaker works

I want to explain the working principle of Matchmaker as far as I understand it, and also clarify any doubts I have.

Let’s assume that the values for min=2, max=30, interval_sec=10, and max_interval=3.

Matchmaker will try to find players within the specified range for 3 attempts, and each attempt will last for 10 seconds.

If Matchmaker found 21 players within the first 10 seconds (while there were already 21 active players in the game), then the first attempt was successful.

Question 1) If Matchmaker couldn’t find players within the first 10 seconds and had to make a second attempt, how would the range change?

Question 2) If Matchmaker made all 3 attempts but couldn’t find any players, would it enter an infinite loop? Because I don’t have any information about cancellations. Or do I need to cancel the Matchmaker on my client side after 30 seconds since it works for a maximum of 30 seconds.

Question 3) If one more player had joined the game at the 7th second during the first attempt, would the matched player count have been 22?

Hello @emredarak,

Just to clarify, for min=2, max=30, interval_sec=10, and max_interval=3, the matchmaker will attempt to fulfil max=30 for 3 intervals, awaiting 10 seconds between each attempt.

So if there are 21 players that match in the first attempt, it won’t return a match yet because max_interval=3 has not been reached.

Answers to your questions:
Q1 - The matchmaker will attempt to fulfil the max value for max_interval, after that it’ll return as long as the minimum condition is fulfilled, so with your example, after 3 intervals the 21 players would return a match.

Q2 - The matchmaker will attempt to match an existing ticket for as long as it is submitted in the pool, this means that after max_intervals is reached, as soon as the min is fulfilled within a subsequent interval, a match will be returned. The server won’t cancel a ticket unless the socked is disconnected or the server is shutting down, it is up to the client to withdraw a ticket if it wishes to bail out from matchmaking.

Q3 - With the criteria above, this would not match yet as max_interval would not have been reached by the next attempt.

Hope this answers your questions.

1 Like