Issue
When you create a matchmaking ticket, the creation fails. The system returns the error: "The ticket is not compatible with the match definition." This error can occur when you use a rule to match players based on a shared identifier, such as a custom room ID.
Environment
- Unity Matchmaker
- A custom matchmaking pool
- A rule that uses the
Equalitytype to check a value inPlayers.CustomData
Cause
The error message indicates that a ticket cannot satisfy the rules of the match pool it enters. This issue has two primary causes:
- Incorrect Data Structure: The matchmaking ticket sends the custom data (e.g.,
roomId) as a top-level attribute. However, the rule's source path (Players.CustomData.roomId) expects this data to be inside aCustomDataobject for each player. The Matchmaker cannot find the data at the specified path and rejects the ticket. - Incorrect Rule Scope: The rule is defined as a
TeamRule. ATeamRuleonly enforces that all players within the same team have the same value. To ensure all players in the entire match share the same value, aMatchRuleis required.
Resolution
To resolve this issue, you must align the ticket's data structure with the rule's expectation and use the correct rule scope.
- Update the Pool Configuration
- Open your match definition configuration.
- Move the custom data rule from the
TeamRulesarray to theMatchRulesarray. This ensures the rule applies to all players in the match.
- Update the Ticket Data Structure
- When you create a matchmaking ticket, ensure the custom data is passed within the
customDataobject for each player. Do not pass it as a top-level attribute.
- When you create a matchmaking ticket, ensure the custom data is passed within the