question

brandon@uprootstudios.com avatar image
brandon@uprootstudios.com asked

Best way to aggregate statistical percentages for custom data?

Hi, sorry if the title seems ambiguous, here's a better explanation:

In our title, there is a section where players can choose 3 out of 12 items in a grid. If a large enough amount of players make a choice, we want to be able to have the statistical/heuristic data for the entire grid so we can generate some sort of graphic/heatmap to show the most-commonly-chosen grid items (maybe by downloading the data once a month and putting the values in excel or similar?).

Is there a "best way" to implement this? Perhaps a custom playstream event when a player finished choosing grid locations and the body of the event is just: "TilesChosen": "0,4,5" or similar?

Thanks!

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

To be honest, the best solution can be maintaining an external database, for example, using SnowFlake.

Since the data may not grow too large, if this ‘Selection’ action won’t be performed frequently, I believe you can maintain it in Title data with 12 KVP like:

Key:

most_chosen_item

Data:

{
  “item1”: n,
  “item2”: n,
  “item3”: n,
  …
  “item12”: n
}

Call the Cloud Script to get current value and add player’s choice at once and be aware that normally speaking, title data will be up-to-date on all shards within a few seconds. But if the data is particularly large, it could take a bit longer.

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.

brandon@uprootstudios.com avatar image brandon@uprootstudios.com commented ·

What would be considered frequent? I'd assume most players would update their grid choices 3-10 times per-day (more-or-less). If our game was to scale to hundreds/thousands of players, would that be too many API calls?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ brandon@uprootstudios.com commented ·

It should be fine as long as it is not like player statistics which needs to be refreshed per match.

0 Likes 0 ·
brandon@uprootstudios.com avatar image
brandon@uprootstudios.com answered

If using custom data, can custom event data be downloaded?

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.

Seth Du avatar image Seth Du ♦ commented ·

SnowFlake is capable of handling all events

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.