question

Dom Khomsan Bangbor avatar image
Dom Khomsan Bangbor asked

Playfab cloudcripts Wondering

Hi guys. I am making a Game that have gems and hight score. And the Gems have to update every game and the games is like 2 sec to 5 min gameplay. Why i have to update every game? Is because if the player exit the app witch mean the gems will never be save in the statistic. And here is the questions.

(1) What would i store the gems data? In the statistic or in the player data in this case?

(2) Imagine if you guys suggest me to use cloudscript to update the gems to the stats. Will it be practical to call update with the cloud scripts so often? Will it break the game if i call it to much?

Player DataCloudScriptLeaderboards and Statistics
10 |1200

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

brendan avatar image
brendan answered

If you require a potential update rate of 2 seconds, you're going to have to use a "caching" server model. The PlayFab statistics and data systems aren't a Redis (in-memory) type system, so high frequency reads and writes aren't how you would use them. In this model (caching), you would run a custom game server. Clients would connect to that server, it would read their data from the service, and then you could update at any rate you desire. The server them updates the PlayFab hosted data periodically (every could of minutes, for example).

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.

Dom Khomsan Bangbor avatar image Dom Khomsan Bangbor commented ·

Its sound hard for one simple thing for one simple game :( But i will look it up thanks anyway sir. Some how you tell me the right way about this case.

0 Likes 0 ·
Citrus Yan avatar image
Citrus Yan answered

For question 1: What would i store the gems data? In the statistic or in the player data in this case?

What’s the structure of your gems data? Is it a <string, int> key-value pair? And, how do you want to utilize this data? For instance, do you need to create a leaderboard and other related features for it?

2 comments
10 |1200

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

Dom Khomsan Bangbor avatar image Dom Khomsan Bangbor commented ·

Its a int, and its a gems so i dont think that i gonna need a leaderboard for it, just for the score. But maybe is a good thing just to have the gems leaderboard just inside the playfab, so i can know who have the most gems i likely hacked the game.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan Dom Khomsan Bangbor commented ·

Sounds great to me:)

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.