Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Leaderboards

LCE has a leaderboard system that tracks persistent player statistics across play sessions. Each platform has its own leaderboard manager implementation that plugs into the platform’s native stats service (Xbox Live, PSN, etc.). This page covers the shared architecture and what stats are tracked.

File: Common/Leaderboards/LeaderboardManager.h

The LeaderboardManager is the shared base class. Each platform provides a concrete implementation:

PlatformClassFile
Xbox 360XboxLeaderboardManagerXbox/Leaderboards/XboxLeaderboardManager.h
Xbox OneDurangoLeaderboardManagerDurango/Leaderboards/DurangoLeaderboardManager.h
PS3PS3LeaderboardManagerPS3/Leaderboards/PS3LeaderboardManager.h
PS4OrbisLeaderboardManagerOrbis/Leaderboards/OrbisLeaderboardManager.h
PS VitaPSVitaLeaderboardManagerPSVita/Leaderboards/PSVitaLeaderboardManager.h
Windows 64WindowsLeaderboardManagerWindows64/Leaderboards/WindowsLeaderboardManager.h

The manager follows a singleton pattern and is accessed through the ProfileManager.

The leaderboard system tracks four categories of statistics, each with individual stat types and a composite rating:

Tracks how many of each mob type the player has killed:

StatWhat it counts
Zombies killedZombie kills
Skeletons killedSkeleton kills
Spiders killedSpider kills
Creepers killedCreeper kills
Endermen killedEnderman kills
Slimes killedSlime kills
Ghasts killedGhast kills
Kills RatingComposite score from all kill stats

Tracks blocks mined by type:

StatWhat it counts
Stone minedStone blocks broken
Dirt minedDirt blocks broken
Wood minedLog blocks broken
Coal minedCoal ore mined
Iron minedIron ore mined
Gold minedGold ore mined
Diamond minedDiamond ore mined
Mining RatingComposite score from all mining stats

Tracks farming and animal-related activities:

StatWhat it counts
Wheat grownWheat crops harvested
Bread madeBread items crafted
Pigs bredPig breeding events
Cows bredCow breeding events
Chickens bredChicken breeding events
Fish caughtFish caught while fishing
Farming RatingComposite score from all farming stats

Tracks distance moved by method:

StatWhat it counts
Distance walkedBlocks walked on foot
Distance swumBlocks traveled while swimming
Distance by minecartBlocks traveled in a minecart
Distance by boatBlocks traveled in a boat
Travelling RatingComposite score from all distance stats

When viewing leaderboards, the player can filter the results:

ModeWhat it shows
FriendsOnly scores from friends
MyScoreThe player’s own score with nearby rankings
TopRankGlobal top rankings

The leaderboard system uses sessions to batch stat updates:

MethodWhat it does
OpenSession()Starts a new stat recording session
CloseSession()Ends the current session and submits stats
DeleteSession()Discards the current session without submitting

Stats are accumulated during gameplay and only written to the platform’s leaderboard service when the session closes. This avoids constant network traffic during play.

The ReadScore struct holds a single leaderboard entry when reading scores back from the platform:

FieldTypeWhat it holds
rankintPlayer’s position on the leaderboard
namewstringPlayer’s display name
totalScoreintThe composite score for this category
statsDataarrayIndividual stat values within the category

Xbox uses XSESSION_VIEW_PROPERTIES for the native view/write types. The leaderboard data maps directly to Xbox Live’s stat service. Xbox One’s DurangoLeaderboardManager also includes a DurangoStatsDebugger for testing stat submissions.

Xbox One additionally has a GameProgress system in the leaderboards directory that tracks overall game completion.

Sony platforms use custom ViewIn/ViewOut structs instead of Xbox’s session properties. The leaderboard data is submitted through PSN’s ranking service. All three Sony platforms share a similar structure but have their own manager implementations to handle SDK differences.

WindowsLeaderboardManager provides a local-only implementation. Since there’s no online service for the PC build, stats are tracked locally but not submitted anywhere.

The leaderboard display is handled by UIScene_LeaderboardsMenu (in Common/UI/) and UIControl_LeaderboardList. The menu lets the player:

  • Switch between the four stat categories (Kills, Mining, Farming, Travelling)
  • Toggle filter modes (Friends, MyScore, TopRank)
  • Scroll through entries
  • See their own ranking highlighted
FileWhat it does
Common/Leaderboards/LeaderboardManager.hBase class with stat categories and session API
Common/Leaderboards/LeaderboardManager.cppShared implementation
Xbox/Leaderboards/XboxLeaderboardManager.hXbox 360 Xbox Live integration
Durango/Leaderboards/DurangoLeaderboardManager.hXbox One Xbox Live integration
PS3/Leaderboards/PS3LeaderboardManager.hPS3 PSN integration
Orbis/Leaderboards/OrbisLeaderboardManager.hPS4 PSN integration
PSVita/Leaderboards/PSVitaLeaderboardManager.hPS Vita PSN integration
Windows64/Leaderboards/WindowsLeaderboardManager.hLocal-only stats tracking
Common/UI/UIScene_LeaderboardsMenu.hLeaderboard display UI
Common/UI/UIControl_LeaderboardList.hScrollable leaderboard list control