Sign In Register

How can we help you today?

Start a new topic

average score of players at the end of a level

At the end of each level in my game, I have the following info:

 

            { "board_id"         , boardCompleteEvent.BoardId },
            { "completed"        , boardCompleteEvent.Completed },
            { "score"            , boardCompleteEvent.Score },
            { "stars"            , boardCompleteEvent.Stars},
            { "longest_word"     , boardCompleteEvent.Stats.LongestWord},
            { "longest_wordscore", boardCompleteEvent.Stats.LongestWordScore},
            { "best_word"        , boardCompleteEvent.Stats.BestWord },
            { "best_wordscore"   , boardCompleteEvent.Stats.BestWordScore },

 

I'd like to submit this info to GS, and get answers to some of the questions:

- For a board identified by boardId, what is the average score across all players ?

- Longest/Best word of the day: On a given day, what is the longest word/ highest scoring word of the day ? Eventually Id like to send a push notification to players about it

- In the future, I intend to have a leaderboard with

 - max score per board

 - max score across all levels


Keeping this in mind, how should I submit this data to GameSparks to get answers to some of these questions ?

1 Comment

Hi Priyank,


Most of what you require could be accomplished using a few leaderboards. The exception being the average across all players; which wouldn't be doable out-of-the-box with our leaderboards, but should be easy enough to track using cloud code. Going through the points you mentioned:


average score across all players: You could track the average using a runtime collection. Each time a word/score is submitted for a board, add the score to a total for the board which would be maintained in a runtime collection document. This document should also maintain a counter which is incremented on each word/score submission. You can then use these value to calculate the board average when required.

Longest/Best word of the day: You can use a leaderboard(s) for this. We have a tutorial on setting up time-based leaderboards.

max score per board: You'd need a leaderboard partitioned by boardId for this. You can find details on partitioning a leaderboard in our documentation.

max score across all levels: A basic leaderboard will work for this.


I hope this helps. If you run into any issues implementing any of this please let us know.


Regards,

Vinnie

Login to post a comment