# Matchmaker Roles Query

**URL:** <https://forum.heroiclabs.com/t/matchmaker-roles-query/1332>\
**Category:** Local Setup\
**Tags:** sdk-unreal\
**Created:** [January 28, 2021, 11:21am UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332 "2021-01-28T11:21:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mawiel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mawiel/32/477_2.png) [@Mawiel](https://forum.heroiclabs.com/u/Mawiel)\
**Post date:** [January 28, 2021, 11:21am UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332/1 "2021-01-28T11:21:48Z")

</div>

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! 🙂

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [January 29, 2021, 1:57pm UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332/2 "2021-01-29T13:57:03Z")

</div>

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:  
[https://heroiclabs.com/docs/gameplay-matchmaker/#properties](https://heroiclabs.com/docs/gameplay-matchmaker/#properties)

You’ll see this example query from the documentation:

```auto
"+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.

---

<div class="post-metadata">

**Author:** ![Mawiel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mawiel/32/477_2.png) [@Mawiel](https://forum.heroiclabs.com/u/Mawiel)\
**Post date:** [January 29, 2021, 2:12pm UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332/3 "2021-01-29T14:12:05Z")

</div>

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;

```
//Properties
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?

rtClient->addMatchmaker(
	MinCount,
	MaxCount,
	query,
	stringProperties, //stringProperties
	{}, //numericProperties
	successCallback);

```

`  
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)

---

<div class="post-metadata">

**Author:** ![lugehorsam](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/lugehorsam/32/314_2.png) [@lugehorsam](https://forum.heroiclabs.com/u/lugehorsam)\
**Post date:** [January 29, 2021, 4:09pm UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332/4 "2021-01-29T16:09:17Z")

</div>

@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.

---

<div class="post-metadata">

**Author:** ![Mawiel](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.heroiclabs.com/mawiel/32/477_2.png) [@Mawiel](https://forum.heroiclabs.com/u/Mawiel)\
**Post date:** [January 29, 2021, 6:22pm UTC](https://forum.heroiclabs.com/t/matchmaker-roles-query/1332/5 "2021-01-29T18:22:10Z")

</div>

Okay, great, thanks for the heads up!
