question

caldas avatar image
caldas asked

Can PlayFab do Async Turn-based games?

Hi all,

I am wondering if PlayFab can manage an asynchronous turn-based game mecanic without too much hassle?

I am coming from GameSparks, extremely disappointed in how bad the platform deal with it. I am about to pull the plug there and now having a look at PlayFab. Hundreds of hours lost in development and learning their API.... sigh

Anyway, here's my use case:

Player one creates a random game. That random games starts instantly, and goes to RUNNING state. Player one takes his turn and now the game has one player, with one turn taken.

Later that day, completely asynchronously, player 2 searches for a game and gets joined with the one earlier created (if there was no game available the system would have created a brand new game for him).

So Player 2 joins Player 1 game and takes his turn on the first round of the game.

It's exactly like Trivia Crack, in terms of mechanic.

So, can I do this with Play Fab?


Thank you

apis
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

·
brendan avatar image
brendan answered

Sure thing - there are a couple of approaches to this, depending on the requirements. In this case, you want to create a game that another player can find and join, so you need to have a matchmaker of some kind. The easiest way to do this would be by using Photon Realtime via the Add-ons Marketplace. Basically, you would use the Photon Realtime "rooms" as the way to set up the game session, so that another player could find and "claim" it, while using PlayFab to store the data for the game state securely (depending on the complexity, you could very likely use Cloud Script to take the "move" input from the players and update the game state). There's a fairly complete write-up of this concept in this thread: https://community.playfab.com/questions/515/207129407-Persistent-turn-based-games-.html

10 |1200

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

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.