Hello,
**I'm Using **
- Unity 6 LTS
- Unity Apple GameKit + Core plugins
- Turn-based matchmaking interface w/ 2 players max
- App Store Connect API for rule-based matchmaking
I have already
- enabled game center in app store connect (I think)
- authenticated players and matched via friend request
I am stuck
- Using queues to match players automatically
I'm working on a rule-based matchmaking system which aims to place two players against each other into a GKTurnBasedMatch. I have a simple Unity Project that correctly authenticates a user and proceeds to send a matchmaking request. The matchmaking script utilizes the Unity plugins' GKTurnBasedMatchmakerViewController.Request(...)
request function with a GKMatchRequest.Init() request configured with a QueueName
equal to the App Store Connect API Queue I created.
The queue I created is also linked to a ruleset with a very basic rule that checks if the properties contains a key called 'preference' that contains a string value for what side the player wants to play for this match. If during the matchmaking, the preferences between players are different, then the match is made and both players should join the match; each player gets to play the side they have chosen. I have my rule expression designed to just check if the preferences are not equal:
requests[0].properties.faction_preference != requests[1].properties.faction_preference
When I launch the game with two physical iPads and begin the matchmaking request, each player is immediately presented with two options:
- Invite a friend, or
- Start game
The Problem: Inviting a friend works to get two players into a game, but queue seems to not matter, and clicking start game will just put the current player into its own match (no one joins).
The Question: How do I get queue based matchmaking to work in Unity for a Turn-based match with only two players who are able to select the enemy side they want to play dictated by a rule that compares enemy play-side preferences?
Resources I've used:
-
Apple Unity GameKit Plugin: https://github.com/apple/unityplugins
-
Matchmaking: https://developer.apple.com/documentation/gamekit/matchmaking-rules
-
Multiplayer rulesets: https://developer.apple.com/documentation/gamekit/finding-players-using-matchmaking-rules