question

Jean-Roch Roy avatar image
Jean-Roch Roy asked

Maintain the N latest player scores

Hi,

I need design advice on how to handle stats for my game. Each level of the game has a target score that a player must reach to complete the level. The target score is not a set value but is calculated from the last N scores achieved by all players. (The exact math is not important here.)

So I need to maintain, for each level, a title-wide list of recent scores achieved by players. Clearly PlayFab title data is not meant to be updated this often, so that's not an option. I thought of using player stats and leaderboards, but unless I'm mistaken leaderboards only consider one value (the latest) for each player, and the results are sorted by value, not by datetime.

Is there another API that could help me maintain these frequently changing lists? I've never used CloudScript but I'm willing to dive in if someone can confirm that I can access some sort of global storage from CloudScript.

Thank you!

data
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

·
brendan avatar image
brendan answered

We'll be updating the leaderboard system later this quarter to allow for extra data per entry, as we've had that request from plenty of developers. Using that model, you would be able to implement this by setting the "score" (the sort index) to a timestamp, and have the actual player score that you use to calculate the target score as the extra data. If you want to implement this concept ahead of our leaderboard update, you would need to use an external data table, though if you use one which is Web API enabled, you could access it via Cloud Script.

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.

Jean-Roch Roy avatar image Jean-Roch Roy commented ·

Thanks Brendan. Even with that new leaderboard feature (extra data), I don't think it would work as there may be multiple scores added by a single player (I need the last N scores, no matter who played them), and the leaderboard would return at most one score per player. Maybe I could create a separate character for each score a player provides but that's getting hairy.

I will look into using an external data table as you suggest. Thanks again.

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.