Using FlexMatch for party/group matching, no docs?

Hi there,

I’ve been looking through what’s possible with FlexMatch, and one thing I’ve seen mentioned a few times around the place is support for parties or groups, eg. a player invites a few friends to their “party”, and then they enter the matchmaking queue together. This is common in games like Overwatch, where you want to queue with your friends, and be matched against individuals and/or other groups.

The docs for the rules reference mention “partyAggregation”, which apparently defines “How to sort multiple-player (party) requests”, but there isn’t much more info on how this should be set up.
http://docs.aws.amazon.com/gamelift/latest/developerguide/match-rules-reference.html

Should each party member start matchmaking individually, but supply some kind of “partyId” property so they can be grouped? Should just the party leader matchmake for the whole party, supplying the precalculated averages of the party members’ attributes as their own?

Based on the design of the rule system I would assume that you’d want each player to be considered separately so you can do all of the averaging etc. in FlexMatch itself, but just with an additional rule to “keep these people together”.

Any help or hidden docs would be appreciated!

Cheers,
Geordie

Hey @geordie!

Thanks for evaluating FlexMatch.

Have you checked out the “How Amazon GameLift FlexMatch Works” documentation in the Amazon GameLift Developer Guide?

http://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-match-howitworks.html

To keep players grouped together, you just need to include all the players you want grouped in a single StartMatchmaking request, including the player attributes for each player that you want your rules to consider. FlexMatch will then do all the math based on what you specify in your rules to come up with averages across the player attributes that you submitted in your StartMatchmaking request. It will then use these calculations to find other players that meet the requirements you specify in your rules.

To see some examples of how to create your rules, you can check out this document:

http://docs.aws.amazon.com/gamelift/latest/developerguide/match-examples.html

To see how to setup the StartMatchmaking request to include the player attributes, check out the documentation here:

http://docs.aws.amazon.com/gamelift/latest/developerguide/match-client.html

Check those out, and if you have additional questions, please let me know!

Hey Geordie, the teams information is required, even when you don’t really have “teams”:

http://docs.aws.amazon.com/gamelift/latest/developerguide/match-rulesets.html

It looks like we don’t have an explicit rule set example for a free for all game, but you would specify one team. The min and max players for that team would really represent the min and max players in the free for all mode.

Thanks @Matchmaker, yeah I had definitely read through all of the documentation, but guess I must not have been reading closely enough :slight_smile:

I haven’t been able to actually test this yet, but if you’re matchmaking a free-for-all game (so there aren’t any teams), do you still need to provide the teams property? Or would you just declare a single team?

Cheers,
Geordie

Just a quick update - I’ve been able to get flexmatch working with a simple ruleset and have all players join the server etc. once placed :slight_smile:

A few things I ran into -

  1. I was getting permission errors about the IAM user not being able to Start/Stop/DescribeMatchmaking, so I went to add those to the policy but they didn’t show up in the GUI. Adding them manually in the JSON (and putting up with it complaining they’re “unrecognised”) seemed to work though.

I know the docs say that you should call Flexmatch from a “trusted machine”, and not directly from the game client, but for now I’ve just been calling from the game client directly. This recommendation is mainly so that players can’t lie about the MMR etc. right?

  1. As mentioned we have a free-for-all game, and I was trying to think how I’d set up a rule so that players of similar XP level get matched together. Most of the examples were from teams, so they’d compare the average of one team’s skill to the average of both teams’ skill. I tried to cobble something together like
        {
"name": "SimilarExperience",
"description": "Prefer matches with players of a similar experience level",
"type": "distance",
"measurements": "avg(teams[allplayers].players.attributes[experience])",
"referenceValue": "avg(flatten(teams[allplayers].players.attributes[experience]))",
"maxDistance": 10
}

but it doesn’t seem to be working. I could probably puzzle something out, but a small hint might save me some time :slight_smile:

Would I want the reference value to be the anchor player’s experience? Or the other way around?

  1. Can the player id be based on the actual player’s identity? Eg. a steam id? Or should it be randomised each time they launch the game?

Hey @geordie! Thanks for the follow-up to let us know that you have basic things working. Glad to hear you were able to find the documentation you needed to make progress. Here are some specific answers to your questions:

  1. This is a known issue. We have an item in our backlog and will look to prioritize it against our other customer requests each sprints. Thanks for letting us know, and it looks like you were able to get yourself unblocked with the recommended course of action.

Its generally not a good idea to have untrusted clients call into services directly, and ensuring that you authenticate your customer requests before passing them onto GameLift is the recommended best practice.

  1. Please find a sample rule set below that we have created and tested for your scenario. We will also look to add this example to our documentation for future customers to benefit from.

  2. The player Id is up to you to determine and utilize as you see fit.

Please let me know if you have any additional questions!

    {
"name": "FreeForAll",
"ruleLanguageVersion": "1.0",
"playerAttributes": [{
"name": "experience",
"type": "number"
}],
"teams": [{
"name": "FreeForAll", "maxPlayers": 8,
"minPlayers": 4
}],
"rules": [
{
"name": "AverageExperienceToMaxExperience",
"description": "Prefer matches with players of a similar experience level",
"type": "distance",
// Get the most experienced player in the game "measurements": "max(teams[*].players.attributes[experience])",
// Get the average experience of players in the game
"referenceValue": "avg(flatten(teams[*].players.attributes[experience]))", // Make sure that the most experienced player is not rated much higher than the average
"maxDistance": 5
}, {
"name": "AverageExperienceToMinExperience",
"description": "Prefer matches with players of a similar experience level",
"type": "distance",
// Get the least experienced player in the game
"measurements": "min(teams[*].players.attributes[experience])",
// Get the average experience of players in the game
"referenceValue": "avg(flatten(teams[*].players.attributes[experience]))",
// Make sure that the least experienced player is not rated much lower than the average
"maxDistance": 5
}]
}