#Leaderboards setup

1 messages · Page 1 of 1 (latest)

tiny tundra
#

Hi,
we're using leaderboards in a racing game for track times, currently we have one leaderboard per track.
I would like to group different car classes into their own leaderboard, is this somehow possible using buckets/tiers?
Or is the only way to create a leaderboard for each combination of track and car class?
Thanks

tight wasp
#

Hi @tiny tundra , unfortunately you won't be able to use buckets or tiers to segment your userbase. While you could create 1 leaderboard per track, per car class, I think you should be able to achieve the result you want with the metadata option when interacting with the leaderboard service.

You'd have to make sure to input this metadata when submitting scores

async Task SubmitScore(string leaderboardId, double score)
{
  var metadata = new { carClass = "<insert-car-class-here>" };
  await LeaderboardsService.Instance.AddPlayerScoreAsync(leaderboardId, score, new AddPlayerScoreOptions() { Metadata = metadata});
}

And you'd also have to include metadata when fetching the scores

async Task GetScores(string leaderboardId)
{
  await LeaderboardsService.Instance.GetScoresAsync(leaderboardId, new GetScoresOptions() { IncludeMetadata = true}))
}

Once you have the entries with the metadata, it will be up to you to filter the scores you have received by car class.

tiny tundra
tight wasp
#

I personally haven't used metadata so I'm not sure how it will work if a user has scores with and without metadata. I think it will also depend on the strategy for score submission; if it's set to Keep Best and they submit a lower score, I don't think the new score will be kept.

So while my suggestion may work in part, I'd recommend you try out the different scenarios you have planned and act accordingly. It's possible your original solution of 1 leaderboard per track per car class is actually the best solution.

#

I'll try and find a dev from the Leaderboards service to answer the first question, but that may take some time to get an answer for you.

tiny tundra
tight wasp
#

That approach will definitely work, it'll just be a bit more work on your end to create all the leaderboards and set them up as you want. I'll follow up when I have an aswer from the Leaderboards service devs.