question

stefan avatar image
stefan asked

Challanges / Contest best practices

Hi,

since our players always want to have challanges and it should also help with retention, we looked at a few games that already use this (for example Hogwarts Mystery, Family Island...).

Here mostly a currency is converted into points when you spend them. The player starts in a group with 30 other players and has 3 days to get the most points. The better your place in the leaderboard, the more rewards you get in the end. As we have seen, this is not unusual in mobile games and is used in many games.

I imagined it to be very simple: - One leaderboard for all players - If the player receives points, the value is updated. - When starting the contest 29 players are selected and we save the 29 PlayfabIds in the Read only player title (not all players really have to be in the same group)

My problem is, I can't define via GetLeaderboard which players I would like to get from the the leaderboard. Here I would have to call GetLeaderboard in an Azure Function for each player, which of course would be way too expensive and take too long.

What is the recommendation here? I've already searched the forum, but haven't really found anything on this. I'm also not quite sure if the other games really use real data, or just faking it! But I could imagine that it feels better with real data.

Maybe there is another approach with Playfab that I have overlooked.

Thank you!

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

·
Simon Cui avatar image
Simon Cui answered

From my understanding of your question, you want to retrieve a group with 30 players’ statistics and PlayFabId based on a leaderboard of all players.

In this case, since the API Get Leaderboard doesn’t have a feature to filter players with player title data or other fields. You may create each leaderboard for each group of 30 players, rather than one leaderboard for all players. Please also note that the maximum number of player statistics (leaderboards) that may be defined is 300, where you can find this limit through [Game Manager] -> [Your Title] -> [Title settings] -> [Limit] -> [Player statistics].

Besides, PlayFab is having Leaderboards v2 on-deck, which allows you to have child leaderboard that ranks among a list of players. You can have a look at PlayFab Roadmap - PlayFab | Microsoft Learn, Introduction to Leaderboards v2 - PlayFab | Microsoft Learn and Leaderboards v2 child leaderboards - PlayFab | Microsoft Learn.

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.

stefan avatar image stefan commented ·

Thank you very much for your answer.

Yes, exactly - we always want to have 30 players in a group (but doesn't have to be the same 30 players for each player). The limit would not work for us, we have too many players.

I've seen the v2 leaderboards before, but they've been unavailable for a few years now. We don't really want to wait any more years for the feature. What other alternatives would there be? Maybe with Azure directly?

Thank you

0 Likes 0 ·
Simon Cui avatar image Simon Cui stefan commented ·

One compromise solution is to set a certain number of groups for each leaderboard. By tagging the player's group in their user tags, you can cache the leaderboard results and filter each group's statistics based on tags. Please refer to Play Stream - Add Player Tag - REST API (PlayFab Server) | Microsoft Learn. For example, assigning 30 groups of players to each leaderboard, so each leaderboard has 900 players. Given the limit of 300 leaderboards count, it could cover a total of 270k players. Compared to your solution, this solution could avoid loading too many statistics when you retrieve an entire leaderboard. You can adjust the number of groups for each leaderboard according to your needs. Alternatively, you can use a custom database and implement a custom leaderboard. So that you can filter the corresponding groups of players to meet your requirements.

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.