Hi! Sounds like a simple question but i dont find any api call for it.
I got the Player entry as type LeaderboardEntry. It has a rank field but it returns me the overall rank. I need to get the rank within the tier.
Pump! How you get it @unity ?
There are ways to go about this but this would be an implementation detail for developers.
So lets say a player is in silver tier and are going to try and hit gold tier but the rank returned is 340 which is their global rank. Gold tier starts at rank 200 so instead of 340 global tier, you want to display rank 140 in silver tier.
In this case we have defined Gold Tier on a Leaderboard as starting at 200 and the Players Rank is 340 so you can just subtract 200 from the Players Rank to get 140 .
In more complex cases where you are using percentages like the top 10% instead of a hard value then using bucket sizes can be you biggest friend here, for a bucket size of 1000 it would be 100 players in Gold Tier if it was defined as top 10%
You can use this to get a list of scores and ranks for the specified leaderboard, within the specified tier which should help to calculate this
Thanks! But obviously, I thought about that, mate (as a developer).
But that doesn’t work for score-based tiers.
For example, let’s say the score threshold for Silver Tier is 200, and there is 1 player in Silver and 1 player in Gold. If my overall global rank is 2, subtracting 200 from my rank (200 - 2 = 198) doesn’t make sense because tiers are based on scores, not ranks.
So, I am still kind of stuck on this one. Also, I would like to avoid multiple API calls and just call something like GetRankWithinTier();.
I’m having the same issue, it looks like it should be possible.
Well it’s actually possible but it’s a bit of a mesh.
1)You have to get your absolute position and your tier.
2)You get the top player of that tier.
3)You get the top player’s absolute position.
4)You do the math.
So many calls… to get the current position within a tier. I think about just skipping to whole idea of using unitys tiers. I can implement my client version of tiers bymself.