Limit character matchmakerdata

Hi, on our ruleset we are using

{
“name”: “character”,
“type”: “string_list”,
“default”: [ “peasant” ,“medic”,“warrior”]
}

{
“name”: “MedicLimit”,
“description”: “Don’t allow more than 1 medic per team”,
“type”: “collection”,
“measurements”: [ “teams[].players.attributes[character]"],
“operation”: “contains”,
“referenceValue”: “medic”,
“maxCount”: 1
}, {
“name”: “PeasantLimit”,
“description”: “Don’t allow more than 3 peasants per team”,
“type”: “collection”,
“measurements”: [ "teams[
].players.attributes[character]”],
“operation”: “contains”,
“referenceValue”: “peasant”,
“maxCount”: 3
}, {
“name”: “Warrior”,
“description”: “Don’t allow more than 3 warriors per team”,
“type”: “collection”,
“measurements”: [ “teams[*].players.attributes[character]”],
“operation”: “contains”,
“referenceValue”: “warrior”,
“maxCount”: 3
}]

However we want to allow people to want to queue for multiple roles, and it kind of works but the matchmaker data shows:

“character”:{
“attributeType”:“STRING_LIST”,
“valueAttribute”:[
“warrior”,
“peasant”
]

What we want is for gamelift to decide which role the player will have, instead of just giving me the string list they chosed, and if people select all roles we can pass [ “peasant” ,“medic”,“warrior”]

Is there a possible way to make the ruleset to accomodate this?

Okay, this a tricky one.

Of the top of my head, I can think of doing 2 team and 6 rules, 1 rule for each role for each team. In each rule, we require the number of role per team :

{
        "name": "MedicLimit1",
        "type": "collection",
        "measurements": [ "teams[red].players.attributes[preferredRoles]"],
        "operation": "contains",
        "referenceValue": "medic",
        "maxCount": 1,
        "minCount": 7
},
{
        "name": "WarriorsLimit1",
        "type": "collection",
        "measurements": [ "teams[red].players.attributes[preferredRoles]"],
        "operation": "contains",
        "referenceValue": "warrior",
        "maxCount": 3,
        "minCount": 7
}
...

However, this would create an invalid match like [medic, medic, medic, medic, warrior+peasant, warrior+peasant, warrior+peasant]

There is not a good way to do this with the current FlexMatch rules. The best I can come up with with is, creating 6 teams (2 * number of roles), and make a rule saying whoever is on team medic1 has to be medic, whoever is on team warrior1 has to be warrior, etc. Then, create a rule to make sure that the size of corresponding role teams on each side are equal. There are a lot of limitation to this, for instance, this wouldn’t work if there are tickets containing multiple players with disjointed preferredRoles, i.e. everyone in the party has to play the same role, which is not ideal.

I created a feature request with the GameLift team to see if we can release a new rule to support this use case.

GLIFT-14763