question

doronhn avatar image
doronhn asked

Get player progress in relation to other player at the same statistic

Hey,

i want to show the user text like - "Your progress is higher than 60% of the players".

how can i get the 60% data?

1. how can i get the number of players that their statistic value greater then X?

2. how can i get the number of player that their statistic value lower then X?

3. how to get number of players in my title \ game?

i have created a leaderboard, but cant find how can i do that with it.

thanks

apisLeaderboards 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

·
Seth Du avatar image
Seth Du answered

Segment will do the job. You may add filter according to the statistics value.

>> how can i get the number of players that their statistic value greater then X?

Set a filter with statistics value > x

>>how can i get the number of player that their statistic value lower then X?

Set a filter with statistics value < x

>> how to get number of players in my title \ game?

By default, there is an "All Players", which will calculating total player counts. Surely you can define it on your own.

After the segmentations are defined, you may use GetPlayersInSegment API via Cloud Script/Azure function, a property named "ProfilesInSegment" will indicate the total number of players in the segment. You won't need to display all players' profiles in the request as it can be large, the count is what we require.

>>how can i get the 60% data?

Simply [1 - rank/total player]. Remember, it is possible that not all players have a specific statistic (you may make your own changes on the formula). In addition, as it is mentioned many times in the forum, we are using estimated rank when there are numerous players in leaderboard to optimize the server, the rank can slightly vary between a number, however, it won't affect your calculation if only fuzzy number is required.

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.

Daniel de Castro Ribeiro avatar image Daniel de Castro Ribeiro commented ·

The total number of players wouldn't be useful in this scenario. And I'm also looking everywhere for this. All I need is the total number of players under specific stats, as this is the only way I can calculate how well each player is in comparison to everyone else. Like "top 10%", or "Position 732 out of 2356". Is there any way we can already get this (very simple and very useful) info? Thanks anyone!

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.

Error rendering WebPanel (widgets/consolidation-widget.ftl): org.hibernate.hql.internal.ast.QuerySyntaxException: AvailableConsolidation is not mapped [from AvailableConsolidation up where up.node = :node]