Skip to main content

Leaderboards

Video Tutorial is available

A leaderboard ranks players by one Stat. Create it in the Developer Portal (Game Services > Leaderboards) and pick the stat and the sort order. You never write to a leaderboard directly: ingest the stat and the leaderboard updates.

Common Nodes​

NodeUse
EOS_Leaderboards_QueryLeaderboardDefinitionsDownloads the leaderboard definitions
EOS_Leaderboards_GetLeaderboardDefinitionCount + EOS_Leaderboards_CopyLeaderboardDefinitionByIndexReads the definitions
EOS_Leaderboards_QueryLeaderboardRanksDownloads the top ranks of a leaderboard
EOS_Leaderboards_GetLeaderboardRecordCount + EOS_Leaderboards_CopyLeaderboardRecordByIndexReads the ranks (rank, score, user id, display name)
EOS_Leaderboards_CopyLeaderboardRecordByUserIdFinds one player in the downloaded ranks
EOS_Leaderboards_QueryLeaderboardUserScoresDownloads the scores of specific players, for example friends
EOS_Leaderboards_GetLeaderboardUserScoreCount + EOS_Leaderboards_CopyLeaderboardUserScoreByIndexReads those scores

Typical Flow​

  1. Ingest the stat with EOS_Stats_IngestStat when the match ends.
  2. Call QueryLeaderboardRanks with the leaderboard id.
  3. Loop over GetLeaderboardRecordCount and CopyLeaderboardRecordByIndex to fill your UI.

Online Subsystem​

The EOSCore Online Subsystem also implements IOnlineLeaderboards, so the engine's Read Leaderboard Integer and Write Leaderboard Integer nodes work as well.