Sign In Register

How can we help you today?

Start a new topic

Create Leaderboard with primary & secondary attributes

Hi!


TLDR at the bottom.


I'm trying to set up a leaderboard that sorts players based on a primary attribute, and for players with identical values it uses the secondary attribute. In my specific case the primary is the difficulty(descending) the level is being played at and the secondary value is the time(ascending) it took the player to complete it.


Like this:

Name     Difficulty     Time

Test              10          2:24

Test2             9           2:10

Test3             9           2:24

Test4             9           2:30


I got really close by creating a "Score" LogEvent with 2 attributes, one for difficulty with a default aggregation type of 'Maximum' and another one for Time with a default aggregation type of Last. The leaderboard is then setup to use these fields in the order of Difficulty(desc), Time(asc). The leaderboard sorts as I want but the problem comes when a player posts a Score with the same or lower difficulty as their record, their time is still updated as it's aggregation type is Last. I tried setting it to minimum as well, but then when the player beats a higher difficulty their time won't be updated unless it was lower than their prior record of an easier difficulty.


TLDR: I'm wondering if it's possible to set up leaderboards to use primary & secondary criteria somehow? If not, I guess I could bitshift difficulty(high) and time(low) on the server and just post one attribute but i'd prefer not to.


Thanks in advance

Login to post a comment