question

adnannazir2012 avatar image
adnannazir2012 asked

Is there a way to sort 2 users with the same score value on leaderboard ?

Hi,

In my leaderboard, When there are 2 users with the same score, I want to sort them with a third value. Like if player on position 3 and 4 has same score then I'll check their time and will give position to the one who completed level in less time.

Is this possible ?


p1 score: 3000, time = 13sec

p2 score: 3000, time = 12sec

then p2 should be on first

Is it possible ???

I saw this link https://community.playfab.com/questions/958/211254247-users-with-same-stat-value-have-same-pos-in-leaderboard.html

but doesn't seem to apply for my issue.

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

No, there isn't a secondary index on the leaderboards (as that would increase the cost of operation for leaderboards significantly). But one way you can do this is by using the upper bits of the statistic as the score, and the lower bits for the time. That limits your score and time, of course, since the statistics are all 32 bit integers (for compatibility across all platforms), but it would at least let you do this.

10 |1200

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

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.