question

Anh Le avatar image
Anh Le asked

Reset leaderboard rank point based on current rank?

Hi,

We are working on seasonal rewards for our game. End of the season, players will receive the rewards and their rank points will be reset.

However I don't want to reset all the rank points. I just reset their rank points to a certain number based on their current rank. Ex: If they are in rank A, they will be reset to 2000. If thy are in rank B, they will be reset to 1000. Another option is: They will be reset based on the current rank points. Ex: Reduce half of their rank point which is over 1000 (Clash Royale and Brawl Stars ways).

Both solution coun't be done by Game Manger as I know. Prize Table could handle the seasonal rewards but it can only reduce a certain number of rank points using "increment players statistic" as I know. Using cloud script could be a performance risk since we could have millions of player.

Could you please advise a good solution?

Thanks,
Anh

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

I am not sure of your description but for clarification, PlayFab doesn’t support changing the rank position in a leaderboard directly, and the only thing can be changed is the player statistic value. Hence, if you are talking about a scenario like:

  • Player Statistic name: Rank Points
  • Reset every season:
  • Position in the Leaderboard Rank Points between 1-99: change its value to 2000
  • Position in the Leaderboard Rank Points between 100-999: change its value to 1000
  • Others: change its value to 0

You can create a Rule at [Game Manager]->[Automation]->[Scheduled Tasks] that will run Cloud Script function once for each member in a segment. Add functions in Cloud Script that will first use server API get its current position and then update the statistics value according to the position:

Besides, to reduce the processing time, you need to maintain the segment carefully so that those inactive players will be skipped during the reset. Segment is capable of adding multiple filters which may help.


4 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.

Anh Le avatar image Anh Le commented ·

Yes, the Player Statistic is what we used.

We also think about your approach. However, did you have the idea how long does it take to run this rule with 1M users?

We have another rule applied for few thousand users but it already costs us 20 minutes.

1 Like 1 ·
v-humcin avatar image v-humcin ♦ Anh Le commented ·

Another option, if you are concerned with the amount of time scheduled tasks will take, is to make an "on login rule" that will only perform the reset as needed. This can ensure that every player that logs in will have the reset performed on them, which has an advantage over the scheduled task since you cannot tell which players have been processed until the task is complete, which as you noted can take some time.

Depending on your needs, you could use the prize table reset that utilizes the "Increment Statistic Version" using this method. Then you can use the "GetPlayerStatistics" and specify the "StatisticNameVersion" to get last season's score in the Cloud Script to determine the new score. This will ensure that only active players will be shown in the season leaderboard if that is desired.

0 Likes 0 ·
loginrule.png (29.2 KiB)
Seth Du avatar image Seth Du ♦ Anh Le commented ·

I think the reward distribution/update leaderboard process really depends on the quantity of players. The processing time is necessary unless you move the reward system from PlayFab side to Client side, which means players have to manually collect the last season's rewards and it is when the Cloud Script can grant this player rewards and reset the statistics.

0 Likes 0 ·
Anh Le avatar image Anh Le commented ·

Also if you have any solution to make the rule run faster, please let me know (including paid options)

0 Likes 0 ·
Anh Le avatar image
Anh Le answered

@Brendan could you please help?

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.