question

MoonHeonYoung avatar image
MoonHeonYoung asked

leaderboard question

1.I have a question about the leaderboard.

What I want.

There are multiple segments (Bronze, silver, gold) each

point(statistic)

100~200 (filter) -bronze segment

200~300-silver segment

300~400-gold segment

Every Sunday grant rewards for each tier and go down to the lower tier.

(I.e. 250 point(silver)> 100 points(bronze) downgrade)

How do I achieve the above scenario?

my think:

-1 When using the PlayFab's leaderboard reset function, all related statistics are removed, so users in each tier segment disappear.

So it doesn't seem like a reset should be done to compensate for each segment.

-2 Run the cloud code on each segment using a scheduled task.

At this point, CloudCode should give rewards and lower the point (statistic) one level down.

However, since the point statistic leaderboard has aggreationMethod in "sum",

how to decrease or set that statistic?

Is it possible to change aggregation method in cloud code?

2.Well... for my scenario, I shouldn't use leaderboard reset. If so, the statistic version (history) will not be created. Need to cache past scores?

There will be times when i want to check the score of the last season.

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

·
Citrus Yan avatar image
Citrus Yan answered

“Run the cloud code on each segment using a scheduled task.” Is the preferrable approach for your scenario. And, it’s pretty easy to decrease the statistic without changing the aggregation method, just use negative values in the request, for instance:

{
  "Statistics": [
    {
        "StatisticName": "bar",
        "Value": -50
    }
  ]
}

Hope this is helpful.

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.

MoonHeonYoung avatar image MoonHeonYoung commented ·

Thank you so much! In question 2, when using the non-reset (subtracting the value) method, Do I need to write to player data to record previous scores? If so, I think there will be very many key/value pairs in player data (as the game lasts for a long time). If there are many key/value pairs, are there any restrictions?

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan MoonHeonYoung commented ·

OK, in this case, you'd need to use k/v pairs to record previous scores, we don't limit the number of k/v pairs though, however, it's suggested that you use lesser, larger k/v pairs by encompassing all the data in one JSON object.

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.