Hi, i have some questions regarding matchmaker and criterias,
i have a game where players have to connect to other players in the same skill level.
what i did before was like this, each player has a number which defines their performance,
then this number will be calculated into skills.
0 to 1200 = Beginner
1200 to 2000 = Intermediate
2000 to infinite = Advanced
and then these skills was given to the matchmaking query to find a user with the same range, for example if i’m beginner find me another user that is also a beginner, it doesn’t matter if i’m 500 or they’re 1000 we are in the same range and we should connect.
like this
var query = "+properties.skill:beginner"
Now i want to make this more specific, and connect the player to the closest performance, for example:
player A,B and C are in the pool, they are all in the same range,
Player A = 500
Player B = 600
Player C = 1000
if you look at it player A and B are closer in range so they should connect to each other, so what i want is no matter how many player are in the pool that have the same criteria, i want to connect the player to the closest to them in range
i can use this but will it guarantee to connect to the closest ???
var query = "properties.skill:>=0 +properties.skill:<=1000";
thanks so much for your help.
can this be achieved with matchmaker overrides ???
Hello @meet2play,
Registering an override function will only allow you to filter the results that are returned by the query so I don’t think it’ll help here.
The query syntax supports adding weights to its terms, one thing you could try is to split the ranges and attribute different weights to the different ranges, something like:
"+properties.skill:>=0^3 properties.skill:<=300^3 properties.skill:>300^2 properties.skill:<=600^2 properties.skill:>600 +properties.skill:<1000"
However I’m not sure this works, you’ll have to try.
Another option is to narrow down the range in the ticket, and if it doesn’t yield any results after a few seconds, cancel the ticket and submit one with a wider range, and so on and so forth.
Best.
hmmm, i did but i don’t think it works,
var first_attempt_min = PassData.ChessELO - 50;
var first_attempt_max = PassData.ChessELO + 50;
var second_attempt_min = PassData.ChessELO - 100;
var second_attempt_max = PassData.ChessELO + 100;
var third_attempt_min = PassData.ChessELO - 250;
var third_attempt_max = PassData.ChessELO + 250;
var first_query = "properties.skill:>="+ first_attempt_min + "^3 properties.skill:<=" + first_attempt_max + "^3 properties.skill:>=" + second_attempt_min + "^2 properties.skill:<=" + second_attempt_max + "^2 +properties.skill:>=" + third_attempt_min + " +properties.skill:<=" + third_attempt_max;
explanation:
here is what i did, i make three attempts to connect the users, first i want to connect with someone who is either 50 bigger or 50 smaller than me which is the closest range for example if i’m 1000 connect me with someone around 950 to 1050,
if this is not possible then expand the criteria 100 bigger or 100 smaller, last attempt 250 bigger or smaller
the first two have the highest priority ^3 then ^2
i also added + at the last attempt to stop searching after that.
but it still randomly connect the users without giving attention to these priorities
player A = 1000
player B = 995
player C = 1100
it supposed to connect A and B all the time if the three of them are in the pool, but it randomly connects them together.
i think i found the solution, the problem is with the placement of the must operators, what i did was making the higher priority should so it can also search for the other options, and the lower priority must so it will stop searching after that, but the correct way is to make the first and the last property must to prevent connecting to lower that the lowest range and higher than the highest range