September 2022
Posted 2 years ago
We've had basic leaderboard support for a while, as an extension of the PvP ranking system. This lead to it being pretty minimal and unreliable, so now we've got a new system built on top of Steamworks leaderboards.

Steam lets you store a couple hundred bytes of extra data along with scores, so we can use that to hold any extra info an addon creator wants to show in their leaderboards. For example, if I want to show how many levels each player completed on their best run, and how long it took them to do that, I can write a struct like this:
[Leaderboard.Type( "depth" )] public struct DepthScore { [Leaderboard.Field( Title = "Completed Levels", Format = "{0} Levels" )] public int Depth { get; set; } [Leaderboard.Field( Format = @"{0:mm\:ss\.ff}" )] public TimeSpan Time { get; set; } }
Then I can change my addon settings to choose which leaderboards should show up in the main menu, and it'll know which leaderboard types I've created by looking at my code:

You can see there's also support for leaderboards that get periodically re-created, perfect for Daily (or Weekly or Monthly) Challenge modes.

Here's how my custom leaderboard type looks in the main menu:
The basic Steamworks leaderboard system is already live, and custom leaderboard types as shown above should be coming in the next Pain Day.