Define a FlexMatch rule set in JSON specifying teams (name, minPlayers, maxPlayers) and a list of rules; store it in the GameLift console or via the AWS CLI CreateMatchmakingRuleSet command.
Add a latency rule using the latency rule type to ensure all matched players have acceptable latency to the selected region; specify a maxLatency value and reference the latencyMap in player attributes.
Add a distance rule on skill rating to keep player MMR values within a defined distance of each other; use the distance rule type with an expression referencing a player attribute key.
Add an absolute sort rule or batch distance rule on team composition if balance between teams is required (e.g., average team skill within a threshold of the opposing team's average).
Use the ValidateMatchmakingRuleSet API to check the rule set JSON for syntax errors before deploying, then associate the rule set with a matchmaking configuration.
Use the StartMatchBackfill API in your game server to fill open slots mid-match; include the existing players' attributes and the current match ID so FlexMatch avoids placing duplicate players.
Known gotchas
Rule sets are immutable after creation; to modify rules you must create a new rule set with a new name and update the matchmaking configuration to reference it.
FlexMatch uses expansion rules to relax constraints over time if a match is not found quickly; always define expansion intervals and limits, or players with niche attributes may wait indefinitely.
Player attributes passed to StartMatchmaking must use the exact attribute keys referenced in the rule set; mismatched keys cause rules to evaluate against null, producing unexpected match quality.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp