Language:
Page Info
Tags:

Using Mobile Service Leaderboards

Choose your OS:

Leaderboards enable you to track and display high scores for players on a per-platform basis. This lets players compete for bragging rights and helps to build community.

iOS Game Center

Google Play

Configuration

See the appropriate platform-specific page below for details on configuring leaderboards for each platform:

Reading from a Leaderboard

The Read Leaderboard Integer node will request from the platform's game service (currently iOS Game Center, or Google Play Services), the value stored on the given Stat Name for the provided Player Controller.

Note that it is a latent node, and thusly has a number of execution output pins. The top most is a "pass through," that works like any other execution output pin. The other two pins (On Success, and On Failure) will execute when the online service returns (or fails to return) a value. The value of Leaderboard Value before a successful return (or if the service fails to get a response) will be 0.

In Blueprints:

The example below is from the Global Game Instance Blueprint in the Unreal Match 3 sample game. In these few nodes we're calling the Read Leaderboard Integer node for the Player Controller at Player Index 0 on the Stat Name (Leaderboard) "Match3HighScore":

readLeaderboard.png

Writing to a Leaderboard

The Write Leaderboard Integer node will send the given integer Stat Value to the leaderboard specified in Stat Name for the provided Player Controller.

In Blueprints:

The example below is from the VictoryScreen Blueprint in the Unreal Match 3 sample game. When the victory (or defeat) screen is shown, it will check to see if on load Unreal Match 3 was able to retrieve a high score, then if it was able to it will submit the latest high score to the leaderboard. There is some additional checking before this to see if the new highscore is more than the one that was pulled during the app startup, but even if that wasn't there, the iOS and Android leaderboard systems will only accept values greater than what they currently store.

writeLeaderboard.PNG

Showing the Platform Specific Leadboard

The Show Platform Specific Leaderboard Screen will show the leaderboard specified by Category Name on the device.

In Blueprints:

The example below is from the GameOverButtons Blueprint Widget in the Unreal Match 3 sample game. When the ShowScores button is pressed, the game will attempt to show the leaderboard.

showLeaderboard.png

Tags