FlexMatch ruleset problems

Hello again!

Now I’m trying to express our requirements with FlexMatch ruleset (matchmaking timeout is 90 seconds so it should be enough for all my examples to work correctly):

  1. Match in our game has two teams from 0 to 5 players (we add bots to fill both teams if there are no enough players). We want to maximize the number of real players in each match in trade for possibly bigger matchmaking duration. I have two simple ways to express this rule:

a)

    {
"name": "simple-ruleset",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "rating",
"type": "number"
}],
"teams": [{
"name": "gang",
"maxPlayers": 5,
"minPlayers": 5
},{
"name": "swat",
"maxPlayers": 5,
"minPlayers": 5
}],
"rules": [],
"expansions": [{
"target": "teams[gang].minPlayers",
"steps": [{
"waitTimeSeconds": 5,
"value": 4
},{
"waitTimeSeconds": 9,
"value": 3
},{
"waitTimeSeconds": 12,
"value": 2
},{
"waitTimeSeconds": 15,
"value": 1
},{
"waitTimeSeconds": 20,
"value": 0
}]
},{
"target": "teams[swat].minPlayers",
"steps": [{
"waitTimeSeconds": 5,
"value": 4
},{
"waitTimeSeconds": 9,
"value": 3
},{
"waitTimeSeconds": 12,
"value": 2
},{
"waitTimeSeconds": 15,
"value": 1
},{
"waitTimeSeconds": 20,
"value": 0
}]
}]
}

http://docs.aws.amazon.com/gamelift/latest/developerguide/match-examples.html. To me it looks like expansions just don’t work on team sizes.

b)

    {
"name": "simple-ruleset",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "rating",
"type": "number"
}],
"teams": [{
"name": "gang",
"maxPlayers": 5,
"minPlayers": 0
},{
"name": "swat",
"maxPlayers": 5,
"minPlayers": 0
}],
"rules": [{
"name": "BigTeamSizes",
"description": "Try to make big teams first",
"type": "comparison",
"measurements": ["count(flatten(teams[*].players))"],
"operation": ">=",
"referenceValue": 10
}],
"expansions": [{
"target": "rules[BigTeamSizes].referenceValue",
"steps": [{
"waitTimeSeconds": 30,
"value": 8
},{
"waitTimeSeconds": 39,
"value": 6
},{
"waitTimeSeconds": 41,
"value": 4
},{
"waitTimeSeconds": 43,
"value": 2
},{
"waitTimeSeconds": 45,
"value": 1
}]
}]
}

This approach works better - matchmaker creates matches with teams smaller than 5 people. But with that rule for some reason it can’t create matches with only one ticket (whether it has only one player or many). By the way matchmaker creates matches with only one ticket if there is no expansions in ruleset above and “reverenceValue” in the rule is reduced to 4 for example.

  1. The rule to minimize the difference between numbers of players in each team also breaks matchmaking of a single ticket. But with two or more tickets works as expected.
    {
"name": "simple-ruleset",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "rating",
"type": "number"
}],
"teams": [{
"name": "gang",
"maxPlayers": 5,
"minPlayers": 0
},{
"name": "swat",
"maxPlayers": 5,
"minPlayers": 0
}],
"rules": [{
"name": "CloseTeamSizes",
"description": "Only launch a game when the team sizes are within 1 of each other. e.g. 3 v 4 is okay, but not 3 v 5",
"type": "distance",
"measurements": ["count(teams[gang].players)"],
"referenceValue": "count(teams[swat].players)",
"maxDistance": 0
}],
"expansions": [{
"target": "rules[CloseTeamSizes].maxDistance",
"steps": [{
"waitTimeSeconds": 30,
"value": 1
},{
"waitTimeSeconds": 35,
"value": 2
},{
"waitTimeSeconds": 40,
"value": 3
},{
"waitTimeSeconds": 45,
"value": 4
},{
"waitTimeSeconds": 50,
"value": 5
}]
}]
}

Hey @Hinidu!

1a. and b. are a known issue with minPlayers that we are aware of and are intending to fix soon. I will respond here once that fix is available.

For 2., you are attempting to match with a single player and have set the maxDistance to be 0. This is equivalent to saying that the teams need to be equal size. With only a single ticket, it is not possible for teams to be a single size.

Let me know if you have any additional questions!

Hey @Matchmaker!

1a. and b. Good to know that you are already fixing it :slight_smile:

  1. Perhaps you didn’t notice that I have an expansion to increase maxDistance over time. More than that I’ve checked this ruleset with non-even ticket sizes (1 and 4 players) and match was successfully created. But as I said this ruleset can’t produce match with a single ticket (whether it has 1 or more players in it).

Thank you for help!

Hey @Matchmaker and thank you for your attention!
Sorry, but it seems like I still can’t explain you my problem clear enough :frowning:
Though I will try again :slight_smile:

  1. I understand that players in one ticket will always play in the same team. But I don’t require even teams with 0 size max distance because as I said before I have the expansion that reduces this requirement over time:
        "rules": [{
"name": "CloseTeamSizes",
"type": "distance",
"measurements": ["count(teams[gang].players)"],
"referenceValue": "count(teams[swat].players)",
"maxDistance": 0
}],
"expansions": [{
"target": "rules[CloseTeamSizes].maxDistance",
"steps": [{
"waitTimeSeconds": 30,
"value": 1
},{
"waitTimeSeconds": 35,
"value": 2
},{
"waitTimeSeconds": 40,
"value": 3
},{
"waitTimeSeconds": 45,
"value": 4
},{
"waitTimeSeconds": 50,
"value": 5
}]
}]

So after 50 seconds I allow the distance equal to 5. So it should be possible to match even one ticket with 5 players against nobody. Also I repeat that with this ruleset matchmaking works with two tickets of different sizes (1 vs 4 players for example) so it is not the “maxDistance = 0” problem at all.

Do you see the problem now?

Hey @Hinidu!

  1. Players passed in a single ticket can only be matched to the same team, not opposing teams. You need a minimum of two tickets with the rule you have since you are requiring even teams with 0 distance.

Let me know if you have any other questions!

Great! I’m looking forward to it :slight_smile:

Yes, thanks for the further clarification. This is the same issue affecting the case in your example 1., and we will respond back here when we have deployed a fix.

Hey @Hinidu,

The fixes for the issues you encountered with expansions above should now be fixed worldwide. Thanks for your patience.

Hey @Geoff, thanks! It looks like it’s working now.