question

Mervin D Guy Jr avatar image
Mervin D Guy Jr asked

Severless Multiplayer in Turn based games

I heard there was a way to perform Multiplayer for turn-based games without using servers, may I get the relevant-API and a brief overview of the dataflow? A code example would also be extremely helpful, if possible.

apisdatamultiplayersupport
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

·
Gosen Gao avatar image
Gosen Gao answered

If it is a simple turn-based game like chess, it can be implemented with Shared Group Data and Cloud Script/Azure Function.

  • 1.First of all, you can match enough players to start the game through Matchmaking or Lobby.
  • 2.Then you can create a Shared Group and add players to this Shared Group.
  • 3.Please keep track of the turn in the Shared Group Data and let the user with the correct turn modify Shared Group Data, you can validate the modification via Cloud Script or Azure Function.
  • 4.After the game is over, delete the Shared Group.

Please note that the client API has a limit of 100 calls per 2 minutes, since your client may need to poll Shared Group Data for the current turn.

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.