Leaderboard subscore using a different sort than score?

Hello,

Is there a way for a leaderboard to be sorted Descending on the score value and Ascending on the subscore value? In this case, the score is a classic higher is better and the subscore is a completion time, which would be smaller is better.

Cheers.

At the moment, we don’t have. But maybe a good addition to the server. Please open a future request on Nakama repo. Thanks!

As a workaround for now; the subscore field is only used to compare submissions that have the same score field, so you can do the comparison on the client side once you receive the results.

Ok, I’ll post a feature request.

If I follow your suggestion of doing client-side ccomparison, wouldn’t the “rank” field of the leaderboard records potentially be incorrect if two scores are the same? I am working on a project where the score field is often the same, so subscore comparison is important.

Instead of using the time taken in the subscore field, I could “encode” it by storing int.MaxValue-time_taken (or the equivalent in ts) but that means a lot of extra checks all over the code base.

I am considering going straight to SQL an do a custom implementation of leaderboards. Any concern about going in that direction?