question

karthi123434 avatar image
karthi123434 asked

Where to maintain game state?,where to maintain game state ?

I did multiplayer using photon, created a room and called webhook to playfab

I wrote a shuffling algorithm for the cards and function for dealing the cards in cloudscript

I am having trouble in where to store the cards and how to maintain the game state

Consider there are rounds going on the game

Where do I store the data of the rounds and the players playing in it

,

I did multiplayer using photon and called webhook to playfab

I wrote a shuffle algorithm for the cards and function for dealing the cards

What I am struggling in where to store the cards and how to maintain the game state

Consider there are rounds going on the game

Where do I store the data’s of the rounds and the players playing in it

Player Dataphotongame manager
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

What you're looking for is a way to manage data in a realtime game where things are changing frequently. For that, I would recommend using a custom game server and having it be the host for the session, including the data. Alternately, the Photon service also provides a model in which you can upload custom logic (Photon Enterprise) that would control the updates of data which would be stored in the Room created in their service.

I would not recommend using User Data or Entity Objects/Files, as that high of a frequency of updates would result in higher costs. While those systems can technically support that frequency of updates, they are not in-memory data stores, so they're more expensive than what you need for this.

Another alternative would be to use Redis to store the memory state of the game, and to update it via Azure Functions Cloud Scripts. Since you would need to read and write the session state on every script execution though, I do believe the hosted game server solution would be a more economical choice.

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.