question

Nithin avatar image
Nithin asked

How to create leader-boards according to the timestamp ?

I want to create a different leader-boards based on timestamp i.e one leader-board should display users who have entered a game-event (maybe from a button-click) in last 30 min(for example) and another leader-board should contain next 30 min users. How to achieve this ?

Player DataLeaderboards 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.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

To meet your requirements, you can consider resetting the leaderboard every 30 minutes. If so, the ranking of each period will be separately stored in the different leaderboard versions. PlayFab's Leaderboard supports scheduled resetting, and the fastest reset period supported natively is an hour. You can refer to this documentation -- https://docs.microsoft.com/en-us/gaming/playfab/features/social/tournaments-leaderboards/using-resettable-statistics-and-leaderboards for more details.

If you want to reset the leaderboard every 30 minutes, you can check this section -- https://docs.microsoft.com/en-us/gaming/playfab/features/social/tournaments-leaderboards/using-resettable-statistics-and-leaderboards#manually-resetting-a-statistic for more assistance. We would suggest you call the admin API sets only in the custom server and administration tools.

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

Nithin avatar image Nithin commented ·

Hi @Sarah Zhang, thanks for the reply...Actually, i'm making a tournament in game, that'll remain for 24 hrs, and I have to display leaderboard for all users who joined in first 30 min, when the event started, that will keep on updating until it ends(24 hrs). And after that, next 30 min. users should see different players in leaderboard(which will also continue updating till 24 hrs). So that 1st, 2nd, 3rd prizes can be awarded to maximum no. of people(that's what my requirement is)..Do i need to maintain different leaderboards, any API or other suggestions please..

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Nithin commented ·

Yes, you may need to maintain different leaderboards. You can create all empty leaderboards in the Game Manager in advance, then add players from different periods to their respective leaderboards. For the Free Plan title, up to 300 leaderboards can be created.

Are the “first 30 minutes players”(Player Group 1) and the “next 30 minutes players” (Player Group 2) in the one tournament? Does “Player Group 1” and “Player Group 2” need to be compared with each other? If they need to be compared with each other and at the same time they need to have their respective ranking, you can create 3 leaderboards for them, like “Group1 Ranking”, ”Group2 Ranking” and “1&2 Total Ranking”.

The players in group 1 can upload their scores to “Group1 Ranking” and “1&2 Total Ranking” using client API UpdatePlayerStatistics. The players in group 2 can upload their scores to “Group2 Ranking” and “1&2 Total Ranking” using client API UpdatePlayerStatistics.

Then you can refer to this documentation -- Using prize tables to reward the 1st, 2nd, 3rd players.

0 Likes 0 ·
Nithin avatar image Nithin Sarah Zhang commented ·

Thank you @Sarah Zhang for the information. One last thing, isn't there a way to do it without different leaderboards? Like..retrieving only a certain no. of players in leaderboard who joined in 30 min. timestamp ? Thanks in advance..

0 Likes 0 ·
Show more comments

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.