Sign In Register

How can we help you today?

Start a new topic
Answered

Leaderboard entry with extra data

I need to store some extra data along with player's leaderboard entry. In this case the character player used to get the score.


I have set up an event (postScore) with field for the character id (extraData, Number) and set Default Calc = Last. Then I have setup two leaderboards: All-Time and Periodic that resets in every few days (partitioned like periodicLeaderboard.period.123). Both leaderboards have a reference to the field "extraData" with Sort = None, Group = MIN. I am not entirely sure what some of these attributes do because some (Group?) seem irrelevant in my particular case.

With this setup it seems to work some of the time but now I run into an issue where it registered wrong value in All-Time leaderboard even though the score is the same in both leaderboards.


This question is similar to "How to submit and retrieve extra info to a leaderboard" but the answer there didn't help me here and the example is missing the Group-attribute in the leaderboard.

I would like to know exactly how to do this right. Thanks.


Best Answer

Hi Paavo,


We haven't forgotten about you. We made some changes to the Leaderboards recently and have added something that you will find extremely useful. You can now configure your event to have a Default Calc attribute called "Supplemental", you can see it below. This field will not contribute in any way to the score or ranking of a Leaderboard. It will work perfectly for storing your character data. I can also confirm you post a lower score as a different character, the Highscore character string won't be affected, it will only changed when a new High Score is set, I think this is exactly what you needed. Let me know if this works for you.



Thanks,

Liam



Answer

Hi Paavo,


We haven't forgotten about you. We made some changes to the Leaderboards recently and have added something that you will find extremely useful. You can now configure your event to have a Default Calc attribute called "Supplemental", you can see it below. This field will not contribute in any way to the score or ranking of a Leaderboard. It will work perfectly for storing your character data. I can also confirm you post a lower score as a different character, the Highscore character string won't be affected, it will only changed when a new High Score is set, I think this is exactly what you needed. Let me know if this works for you.



Thanks,

Liam


Thanks for the response,
however I think this still doesn't work. Here is example:

(There are two leaderboards: allTimeLeaderboard, periodicLeaderboard.period.{period})

postScore { score: 1000, charId: 10, period: 5 }
// Both leaderboards score = 1000, charId = 10 OK!
postScore { score: 800, charId: 9, period: 6 }
// PROBLEM: now allTimeLeaderboard has charId = 9 which should not have changed since the highest score there is still 1000
postScore { score: 900, charId: 11, period: 6 }
// Interestingly now allTimeLeaderboard has reverted to charId = 10 (maybe it takes the Min(charId)?)

I don't know if it works any differently if I convert charId into string?

 A quick test showed that converting these numeric values into strings in postScore-event did not fix the issue. Interestingly, it works exactly described as above.

Does it work if I use separate LogRequestEvent for both leaderboards? Quick test showed that this might be the case.
Below is how I had LogRequestEvent-chain setup before and what I changed it to:
(Client) -> submitScore (injects time based on server time) -> postScore (used by both allTimeLeaderboard and periodicLeaderboard)

(Client) -> submitScore -> postScore (periodicLeaderboard)
                        -> postScoreAllTime (allTimeLeaderboard)

(submitScore, postScore, postScoreAllTime are all LogEventRequests)


This tinkering does make me feel little nervous since I clearly don't know all what is going on under the hood.

Hi Paavo, 


Sorry to hear you're still having trouble here, if its working with two separate events (it would be using two different running totals here), that would lead me to believe that using one event (and therefore one running total) to populate both leaderboards could be causing the issue here. I'm going to recreate both of your events and leaderboards and see if I can replicate your issue and find a solution for you. I'll update you with my findings.


Thanks,

Liam

Login to post a comment