question

kfboelter avatar image
kfboelter asked

Create and keep up-to-date a leaderboard based on other leaderboards

Hi,

I'll turn to this section, which has always been very helpful, in search of guidance again.

I'll explain my situation:

I have a game which is composed by several different leaderboards. To simplify, let's say we have Daily Game Leaderboard01, Daily Game Leaderboard02, Daily Game Leaderboard03, Daily Game Leaderboard04 and Global Daily Leaderboard.

One important thing to mention, is how Leaderboards relate to the Daily Leaderboard and between themselves. We have this little structure, which we can call "coins" in order to make things simple. Coins are awarded to the player related to their rank on a given Game Leaderboard at the turn of the day. So if a player is ranked first on a Daily Game Leaderboard, doesn't matter which, he gets 100 coins. Second place gets 99, third 98 and so on. Those numbers are the same for all the Game Leaderboards. A player can be ranked in any different position in any Game Leaderboard.

The thing is that in order to populate my Global Daily Leaderboard, I need to run through all the Games Leaderboards, check each player rank in order to find out what is the amount of coins he is getting, and add this value to the Global Daily Leaderboard.

To make it clearer: Global Daily Leaderboard is populated with the amount of coins a user is to get at the turn of the day. This amount of coins relates to the player's rank in each of the Game Leaderboards. It's this sum of the amount of coins of each leaderboard (which relates to the player's rank on each Game Leaderboard) that I want to use to populate this Global Daily Leaderboard.

Problem is I am not being able to find a valid, real-time solution for that. Considering we have a few thousands players on the game, and they represent different entries on different Game Leaderboards, all my solutions will vastly exceed what seems to be a reasonable amount of API calls.


Could you please point me out to an elegant solution for this issue? I'm willing to explain it in another manner, if I was not clear enough.

Thanks in advance.

Leaderboards 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

·
brendan avatar image
brendan answered

If I'm understanding you correctly, you have N leaderboards, and you want to have each of those, once a day, report a value to a different leaderboard. Is that correct?

If so, you could use the Prize Table functionality, using the Increment Player Statistic action, to add the appropriate amount to the player's score on the main leaderboard.

But if your needs are more complex - being able to take the scores across disparate leaderboards an update VC balances on players, for example, you would be better served with a local tool that ran on a regular basis, and which queried the leaderboards, performed the calculations, and then made the reward calls on behalf of the players.

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.

kfboelter avatar image kfboelter commented ·

@Brendan, thank you so much for getting back.

Brendan, you were not correct on the assumption that we'd need to update the Global Daily Leaderboard once a day. My preference is that it would be updated everytime someone changed his rank on a game. That's where the difficulty comes from: one person plays an changes rank, say this person goes from 100th to 1st. We'd have several persons changing their rank, thus changing the amount of coins they'd get and their position on the Global Daily Leaderboard.

Is that clearer now? Do you think that your suggestion still applies, after knowing this?

0 Likes 0 ·
brendan avatar image brendan kfboelter commented ·

So between this, and re-reading your post above, it sounds like you're saying you have a leaderboard which should based upon the player's scores in other leaderboards. So, if I'm in position 1 on all leaderboards, and you score higher than me on 1 of them, in addition to changing your own meta-leaderboard data, you would be changing mine - as well as the scores of every other person whose score you beat on the other leaderboard.

If so, then no, that is not possible using the PlayFab leaderboard systems. This would require that you update N players every time any single player's score changes, where N is the number of players that player is now beating, who they weren't previously. Not to mention that you would need to account for the fact that all players currently in the game could be reporting scores (queueing these recalculations).

My recommendation would be that you use external data tables, so that you can have the degree of control you are looking for.

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.