question

Eduardo Lauer avatar image
Eduardo Lauer asked

Game wide statistics with PlayFab

Hello,

I wanted to know whether I could do these game wide statistics with PlayFab and display them in the game.

  • Game wide data e.g., "Players have collected 4320 coins today"
  • Achievements, "70% of players unlocked this achievement"

It seems like you can sort of implement achievements with Segments or Player Data, but then I'm not sure how I'd go about aggregating and updating these metrics.

Player DataLeaderboards 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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> Game wide data e.g., "Players have collected 4320 coins today"

PlayFab doesn’t provide the built-in feature to aggregate the points each player collected and obtain the sum value of them. A possible workaround for this requirement is setting up a daily reset Leaderboard and set the points as the player statistic values of this leaderboard. So that, you can obtain the archived leaderboard results once a day and sum all statistic values of this leaderboard manually. You can check this documentation - Tournaments & Leaderboards quickstart - PlayFab | Microsoft Docs, and the series of Tournaments & Leaderboards Tutorials to learn about the PlayFab statistics and the leaderboard.

>> Achievements, "70% of players unlocked this achievement"

You can use PlayFab Segment and thePlayer Tags to mark the players who have unlocked the achievements and obtain the list of these players. Please refer to the documentations - Player Segment configuration - PlayFab | Microsoft Docs to learn about t how to set up the segment configuration. And you can call the Server API AddPlayerTag to add tags for players. If you have no custom server, you can consider doing the game logic verification and the calling the server APIs on the PlayFab CloudScript using Azure Functions.

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.