Matchmaker Roles Query

Hello, Andreas here.
I am a bit unsure how to work with matchmaking query strings and could use some help. In my scenario I want to be able to find a match that would require three roles with a set amount for each role, 1 tank, 1 healer and 3 dps in order to find a match of five people. Is this possible with Nakama matchmaker? If so, how would I write the query string? Thanks! :slight_smile:

Hello @Mawiel! It’s definitely possible to do this with Nakama matchmaker.

It’ll be better for us to walk through it instead of jumping right to the answer.

First take a look at the documentation on how to do this:

You’ll see this example query from the documentation:

"+properties.region:europe +properties.rank:>=5 +properties.rank:<=10";

So those properties.region, properties.rank fields are arbitrary and made up by you. So you can replace those with a role propery. For example, roleTank and roleDps could be integers with the number of those roles in each match. You can create them when calling addMatchmaker. Once a user has entered a pool with those properties, you’ll use a string like the one I like above to query each of those roles against a number.

Thanks for the reply. I already have a working matchmaker using Unreal Engine 4 and C++ with this code:

int32_t minCount = 5;
int32_t maxCount = 5;

NStringMap stringProperties;
NStringDoubleMap numericProperties;

stringProperties.emplace("match_type", "forestdungeon");
stringProperties.emplace("user_role", "healer"); //Could also be tank or dps
numericProperties.emplace("rank", 8.0);
std::string query = "+properties.match_type:forestdungeon"; //How do I define the numbers of each role here?

	stringProperties, //stringProperties
	{}, //numericProperties

What I am wondering is how I would write the query string in order to let the matchmaker know I want a specific number of each role, what symbols should I use? I tested the rank example you posted (that is also in the documentation), which worked well, but not what I want in this scenario. (Quick edit)

@Mawiel I see. This is not possible at the moment, but be aware that you may want more lenient matchmaking depending on your number of concurrent users.

We’re working on giving users a better way to express these types of queries in the future.

Okay, great, thanks for the heads up!