question

Niclas Åberg avatar image
Niclas Åberg asked

Incremental number accessible by all players

Is there a way to use CloudScript to increment a publicly readable value for all users?

The use case is that in my space exploration game I have around 1,000,000 planets and want to show what percentage of those planets have been discovered by the gaming community.

CloudScript
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.

Niclas Åberg avatar image Niclas Åberg commented ·

A hackish way of achieving this would be to use a leaderboard, where whenever a new score is submitted it uses the top score + 1. Is this sort of workaround discouraged?

0 Likes 0 ·

1 Answer

·
Seth Du avatar image
Seth Du answered

Currently PlayFab doesn’t natively support a global value that is updated by all players in real-time. You may try your work around solution, but there is no guarantee from PlayFab.

Though the best solution is implementing an external database, which is capable of queue or cache, my work around suggestion is sending PlayStream Event whenever a new planet is discovered, then use PlayFab Explorer weekly or monthly to query the number of custom events so that you can manually update the progress number in Tile Data. This solution may not reflect the data immediately, but is accurate.

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.

Niclas Åberg avatar image Niclas Åberg commented ·

That's a creative solution! Is there a way to automate data extraction from PlayStream, so it can be loaded by CloudScript? Or some other way under the PlayFab umbrella.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Niclas Åberg commented ·

PlayStream events in PlayFab are actually stored on Azure. However, currently PlayFab doesn't support review it directly on Azure. In terms of the new Event Archiving, it does support, please see the Event Archiving (preview), but there is no ETA for the official release. For now, it still needs you to implement an external server to handle the Webhooks so that Cloud Script can request data from your server. Please feel free to tell us if you have any concerns or questions.

1 Like 1 ·

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.