Daniel Hall avatar image
Daniel Hall asked

Question about Matchmaking and some bits about CloudScript

Hi, I've been playing around with PlayFab for the past couple days and am fairly confident that its is what I'm looking for. I'm looking to create a turn-based game where player actions are taken in their own time (asynchronous? think Words with Friends) and the results are calculated once both players have made their move. Players share the same turn like Pokemon.

I've been digging around the API and have managed to create a friction-less login system, the ability to get and set player statistics through CloudScript and have even gotten matchmaking to work for the most part, I think. Basically I have a 1v1 Queue, when start matchmaking on my phone and my computer, I will call GetMatchmakingTicket() once every 6 seconds with a repeating Invoke. After the two players are matched together I will terminate the invocation. I can get the players to match just fine and display the Match ID and such in the Log, but from there I am a little confused on what to do as I can't seem to find a reference to matches anywhere in the Game Manager and am not sure how to keep track of them or how to save game data using CloudScript.

If anybody could give me some insight into how this all works that would be great. Ideally I want to avoid using servers and would like to do it all in CloudScript, but I'm not sure what the limitations are or what to do past this point.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Sarah Zhang avatar image
Sarah Zhang answered

There is no matches’ references in the GameManager. API GetMatch can be called to get a match via MatchId and QueueName. The tracking of the matches needs to be implemented by the developers selves.

According to your descriptions, it seems you have matched the players successfully and you want to host the asynchronous turn-based game on CloudScript. If you don’t want to build a custom server, you can consider using Shared Group Data and CloudScript for it. There is an example in this section Turn-based multiplayer Async games which you can refer to.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Seth Du avatar image Seth Du ♦ commented ·

@Daniel Hall In addition, even though it is turn-based game, like Pokémon, it is still a session based multiplayer game, which means you can host a server session for the 2 players. Turn-based multiplayer Async games shall fit many simple scenarios. If you are interested in implementing more complicated rules for the game, hosted servers should be necessary.

The matchmaking system will work perfectly with the Multiplayer Server 2.0. If you have a server build, after the ticket is matched, a server instance will be allocated to for the match. The GSDK implemented in the server build will be able to get the match information, along with the matched Players’ IDs.

Normally, the Cloud Script functions should be implemented in the Server Build and all the game logic is maintained on the server build. The Matchmaking system is only for the matching process. You may refer to the documentation on:

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.