question

MoonHeonYoung avatar image
MoonHeonYoung asked

​default statistic??

My game is using statistic based matching.

So, when I reset a specific leaderboard, I need to reset the statistic to 1000(not delete) to get the user when i call getAroundLeaderBoard.

When I reset the leaderboard,

1. is there a way to make the statistic of all players in the leaderboard to 1000 (not delete)?

It doesn't seem like a good way to set it like the rank of the prize table from 1 to 99999.

that is, a method of initializing the statistic of all players to a specific non-null number by catching the leaderboard reset timing of a specific "statistic".

2.In the leaderboard that resets every week, players within a certain range must be rewarded

(not rank 1~xx)

That is, 1000~1250 (bronze) 1250~1500(silver) etc.. A certain reward must be granted for each segment.

but prize table seems to give a reward as a rank number.

How do I put players in a certain section, and how do I bring in all the players in that section and grant them a reward?

scenario:

When the leaderboard is reset, rewards are granted to players in each section, rewarded once when entering each section, and then set back to the default stat value (1000)

thanks!

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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> Is there a way to make the statistic of all players in the leaderboard to 1000 (not delete)?

Yes, you can use CloudScript and Scheduled Tasks to achieve it. Scheduled tasks are a way to automate common game operation routines. Automated tasks can take predefined actions or execute CloudScript, which enables any custom server-side functionality you want to implement. To implement your requirement, you can create a CloudScript function that calls server API UpdatePlayerStatistics, then execute it for the “All Player” segment in the Scheduled Tasks. You can use this scheduled task as your custom “reset” plan. Please check this documentation for the details about how to create the Scheduled Tasks.

handlers.updateStatistics = function (args, context) {

    var request = {
        PlayFabId: currentPlayerId,
        Statistics: [{
            StatisticName: "Your statistic name",
            Value: 1000
        }]
    };

    var result = server.UpdatePlayerStatistics(request);
    return result;
};

>> How do I put players in a certain section?

As this section said, segment filtering allows you to define what players are included in the segment. You can define the “Statistic Value” filter to put player in the specific segment.

>> How do I bring in all the players in that section and grant them a reward?

As the first answer said, you can achieve it using Scheduled Task. You can add the reward methods in the CloudScript function and execute it for the corresponding segments in the Scheduled Task.

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 for a detailed description.!

If so, should the leaderboard reset period and the scheduled task reccurring value be synchronized?

Is it not connected but, should I set each value separately and set it as occurring at the same time?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang MoonHeonYoung commented ·

Yes, they should be synchronized. You can execute the scheduled task after you reset the leaderboard. Since the execution of the scheduled task would take some time, we would suggest you design the settlement time for your leaderboard. For example, you can close the current leaderboard at 2:00 a.m., then start the next leaderboard at 4:00 a.m. In the settlement time, you can disable updates of statistics.

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.