question

deceleris avatar image
deceleris asked

How to make a leaderboard based on rank of other leaderboard

Hello ! Here what I want : (if you know the game, I want to reproduce the ldb of track mania)

- I have a racing game with a ldb on every races

- I want to give a score to a player based on his rank on a race's ldb

- Then make a ldb of the cumulated score of every player

My problem is :

- When a player steal a rank and get for exemple rank 1 on a race

- I need to recalculate the cumulated score for every player, then actualise this score in the statistics

- But is it possible to change a stats for every player in the game ?

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.

Seth Du avatar image
Seth Du answered

Yes, as your game seems to be a multiplayer game, and if it is the case, there will be a hosted multiplayer server for each game. You can re-calculate the score and update statistics for each player via server API. Just remember to use the default “Last” aggregation method for the leaderboard.

10 |1200

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

deceleris avatar image
deceleris answered

Hello and thanks for the answer.

Let me specify, this is a multiplayer game, but I know how to do that. What I want is different :

As a racing game with classic time attack leaderboard (a leaderboard with all-time highscores)

I want to give a pondered score foreach player based on their rank on each time attack leaderboards

Example :

score = 0

race 1 : rank 5 => score += 1000;

race 2 : rank 1 => score += 8000;

race 5 : rank 58 => score += 50;

race 11 : rank 3 => score += 3000;

etc..

then with this score (wich is different for every player, depending on their skill, relatively to the other player) , I want to make a final global leaderboard.

But imagine, if you are #3 on race 2, if you steal the place of the #1 then your score increase and the score of the old #1 decrease. I have to recalculate my score and at least, his score. So finally I have to actualise the global leaderboard

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.

Seth Du avatar image Seth Du ♦ commented ·

As this process should be handled on server side or Cloud Script/Azure Function. You can get the leaderboard first and use Server API to change the statistics for 2 selected players. But it is unable to directly change the statistics of a player at a specific rank because you still need to get the full leaderboard. It will become more difficult when the base number of players in a leaderboard increase (Consider if there are 1,000,000 players while GetLeaderboard can only retrieve 100 entries per call).

The basic idea is only changing the statistic of caller and do not affect other players unless there is a specific PlayFab ID. Rank changes and it is not supported by PlayFab to locate a player by a rank.

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.