TLDR; I can't get QueueName to work with matchmaking a turn-based match in Unity using matchmaking rules.
Long version:
I'm using the apple unity plugin found here: https://github.com/apple/unityplugins/blob/main/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Documentation~/Apple.GameKit.md
I have created a Queue, RuleSet and a simple Rule to match players by following these docs tightly: https://developer.apple.com/documentation/gamekit/finding-players-using-matchmaking-rules.
Here is the single rule I have that drives matchmaking:
{
"data" : {
"type" : "gameCenterMatchmakingRules",
"id" : "[hiddden-rule-id]",
"attributes" : {
"referenceName" : "ComplimentaryFactionPreference",
"description" : "default desc",
"type" : "MATCH",
"expression" : "requests[0].properties.preference != requests[1].properties.preference",
"weight" : null
},
"links" : {
"self" : "https://api.appstoreconnect.apple.com/v1/gameCenterMatchmakingRules/[hidden-rule-id]"
}
},
"links" : {
"self" : "https://api.appstoreconnect.apple.com/v1/gameCenterMatchmakingRules"
}
}
which belongs to a rule set which belongs to a queue. I have verified these are setup and linked via the App Store Connect API. Additionally, when I tested queue-based matchmaking without a queue established, I got an error in Unity. Now, with this, I do not. However there is a problem when I attempt to use the queue for matchmaking.
I have the basic C# function here:
public override void StartSearch(NSMutableDictionary<NSString, NSObject> properties)
{
if (searching) return;
base.StartSearch(properties);
//Establish matchmaking requests
_matchRequest = GKMatchRequest.Init();
_matchRequest.QueueName = _PreferencesToQueue(GetSerializedPreferences());
_matchRequest.Properties = properties;
_matchRequest.MaxPlayers = PLAYERS_COUNT;
_matchRequest.MinPlayers = PLAYERS_COUNT;
_matchTask = GKTurnBasedMatch.Find(_matchRequest);
}
The
_PreferencesToQueue(GetSerializedPreferences());
returns the exact name of the queue I added my ruleset to.
After this function is called, I poll the task generated from the .Find(...) function. Every time I run this function, a new match is created almost instantly. No two players are ever added to the same match.
Further, I'm running two built game instances, one on a mac and another on an ipad and when I simultaneously test, I am unable to join games this way.
Can someone help me debug why I cannot seem to match make when using a queue based approach?