Sign In Register

How can we help you today?

Start a new topic

Create statistics the player could see

Hi, I want to implement some in game statistics for players. Players would see statistics about how many attempts other players did before solving each puzzles (see mock-up image). Context: there are something like 200 puzzles in the game and I'd like to display how many players solved each in 1 attempt, 2,...,9, 10 to 15, 15 to 20 etc, so about 15 bars in each chart, 1 chart per puzzle.

My question is about how to achieve that. I see two options: using leaderboard+reddis or using only reddis.
-Using Reddis: Puzzle success Event script code would increment a key named "LevelID+NbOfAttempt". This would generate something like 200 (levels) * 15 (bars=attempt range) = 3000 keys in reddis. Then, a scheduled script would read those 3000 values and aggregate them in 200 key named "LevelID" containing a JSON containing values for each bars. Client code would retrieve 1 of those aggregated reddis key when starting each new puzzle.
-Using reddis + leaderboards: Puzzle success Event script would LogEvent() in a per puzzle partitioned leaderboard. It would multiply by 2 (even numbers) the number of attempt before login it in the leaderboard. A scheduled script would getRankForScore() the leaderboard with scores multiplied by 2 + 1 (odd numbers) so it could compute how many players have score 1, 2... 15 to 20 etc.... and create some reddis key for each puzzle containing JSON containing the aggregated data.
What approach would be more efficient ? (e.g. are 3000 reddis keys a lot ? Is a leaderboard with 200 partitions a lot? are scheduled scripts iterating over 3000 values+API call a lot ?) Is there another way to implement those statistics ?


Login to post a comment