Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • General Discussion /
avatar image
Question by Vsevolod Metelskyi · May 10, 2019 at 06:51 AM · CloudScriptLeaderboards and Statistics

How can I get prize table for a leaderboard?

So I need to create a leaderboard that would work just as anyone would expect: gather players scores, reset at some point and give players rewards based on their positions. But so far I have not found an API that would let me get a list of prizes to show them in the game. So I am not sure it's possible at the moment.

Since showing the rewards and tiers to players is critically important, I started looking for another way of implementing prizes for a leaderboard. I have come up with a solution to write a Scheduled Task that would reset my leaderboard at some time and then run a cloudscript that would 1) reset the leaderboard and 2) iterate through all the players in the "All players" segment and give them currency and inventory items from some custom JSON file I will store in some key of the Content tab.

The downside of this approach is that I will have to write custom code to implement push notifications and other actions that are possible in case of using the Leaderboard prize tables. And that I will have to iterate over all the players and send a request for each of them to get their position on the leaderboard. And if there are a lot of players I fear it is possible that the execution of a function like this will take more time than allowed.

Despite this I wanted to try out this approach, but I couldn't, because the IncrementPlayerStatisticVersion method can not be called from the CloudScript and I simply can not reset the leaderboard.

Maybe I am missing something. Please give me an advice on how should I solve my issue.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image

Answer by SethDu · May 10, 2019 at 08:59 AM

I do not quite understand your requirement, why do you need to retrieve the Prize Table for granting? Is it because you are considering granting for players whose rank is over 1000?(the Prize table only supports 1-999 rank for now)

If you have configured the Prize Table for a Leaderboard, every time you reset this leaderboard, you may notice the events in the PlayStream Monitor that there are player events like “Player ranked on leaderboard version”, then if this player is qualified for some reward, the following events will be item granting. The whole process is automatic and you do not have to iteratively granting items for all players.

The Prize Table do have limitation right now and it is by design, and your solution is feasible but needs lots of coding work. If there are too many players, you can close the game server for some time for maintenance.

For now, there is no API for retrieving prize table information hence you may hard code this part. Sending a thread on Feature Requests Forum or voting an existing request will be appreciated.

In terms of IncrementPlayerStatisticVersion, the current work around solution is to implement a local tool or use an external secure server for game management. There will be huge updates on our Cloud Script feature though I cannot tell the specific time, you may keep track of the updates on Blog website.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Vsevolod Metelskyi · May 10, 2019 at 10:27 AM 0
Share

I need to download Prize Table to show rewards on the "Rewards" tab of my PvP section, so the players know what are they fighting for. I need only data for visual representation but since I can not get it, I am trying to find another way.

Could you give more info about the "implement a local tool or use an external secure server for game management" part? Is there any guidelines, examples etc?

avatar image SethDu ♦ Vsevolod Metelskyi · May 13, 2019 at 01:42 AM 0
Share

I believe you have to manually input and store Prize Table data somewhere else, for example in Title Data for later retrieval since there is no way to dump the Prize Table in the Game Manager.

In terms of IncrementPlayerStatisticVersion, since it is Admin API, you cannot use it in Cloud Script, and if you are looking for resetting leaderboard programmatically, you need to write a tool such as C# winform app, which is implemented with PlayFab SDK, to execute Admin APIs.

avatar image

Answer by Vsevolod Metelskyi · May 10, 2019 at 12:30 PM

@SethDu

I need to get prize tables not to grant rewards but to show them inside the game.

I have a "Rewards" tab where a player is supposed to see which rewards he will get for which range of leaderboard positions.

Like:

1-7 position: 10 gold,

8-12 position: 2 gold.

Could you be please give more info about the "implement a local tool or use an external secure server for game management" part? Where should I look to get more info regarding this matter? Is there any examples you could provide to help me get started.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Vsevolod Metelskyi · May 10, 2019 at 12:30 PM

Ok, since my message was deleted by someone I will write it again.

I need Prize Table in order to show rewards to players. I don't need it for rewarding.

I have a tab "Rewards" where a player can see, that if he will take position from x to y on the leaderboard, he will get a, b and c as a reward, if from x2 to y2, he will get d and f etc. And in order to show rewards I must be able to get the Prize Table data from PlayFab.

Could you give more info about the "implement a local tool or use an external secure server for game management." part? Is there any examples, guildelines?

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Yaser · Sep 17, 2019 at 02:01 PM 0
Share

I need this feature as well, reading the Prize Table info, just retrieving it to show the players what prizes they will get.

Currently, it looks like the only way to do this is to store the data locally (or somewhere external) and show it to the players.

But supporting it directly on PlayFab would be immensely helpful.

avatar image SethDu ♦ Yaser · Sep 18, 2019 at 03:04 AM 0
Share

I believe you are correct, there is no API to retrieve Prize Table information. A work around solution is to store it in the Title Data since it won't change frequently.

Please feel free to send a thread on the Feature Requests Forum and more votes can help the priority.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    Related Questions

    How long after calling cloudscript to update statistic does it take to reflect in players account, and leaderboard? 1 Answer

    Scheduled Tasks and DailyLeaderboard. 1 Answer

    Trigger Cloudscript/Azure function on statistic reset 1 Answer

    Azure Function Update Leaderboard Problem 2 Answers

    Sync PlayFab and Google Play Games / Game Center data 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges