Game Development Reference
In-Depth Information
Adding leaderboards
A leaderboard, as with any other online feature, is very simple and quick to integrate. After
adding your leaderboard IDs in iTunes Connect, you will be able to write new values and
update them for any of those IDs by calling the Write Leaderboard Integer node. Usu-
ally, passing the Player Controller option is essential for all the online nodes. For a leader-
board, you need to assign a value for Stat Name , which is the iTunes Connect ID and the
integer value you want to send in the Stat Value slot.
• If you want to display the whole leaderboard of the game to the player, or you want
to show the Game Center screen of your game to your player, then you need to use
Show Platform Specific Leaderboard Screen . This is called Specific because the
same node is used with Android devices to display the Google Play leaderboard
screen:
• Usually, you save the leaderboard values locally in the device as an integer.
However, the player will be the only person on earth who will be able to know
their score as no one else can see it or access it. Let's think about the highest score
of the player. What if the player used another device (device B) to play the game
with their account, and then they came back to the first device (device A)? Of
course, the local score will not match the final score on the Game Center. This is
the reason that Epic has implemented the Flush Leaderboards node to download
the leaderboard values and the Read Leaderboard Integer node to get the down-
loaded values. Firing these nodes during the start of the game gets you the latest
values of the player on the leaderboard, which you can compare with the local
ones. If it is higher than the local score, then you will need to update the local
score and then save it.
Search WWH ::




Custom Search