Leaderboards  [Legacy]

This is an old version of the Leaderboards addon, click here for the new one. Use the new one for new projects.

 

The PlayFab Leaderboards Module is specifically designed to implement Leaderboard Statistics to games built using Construct.

Interconnected with major platforms including Facebook, Google Plus, Google Play, Game Center, FB Instant Games, Steam, Instant Games, Xbox Live, Nintendo Switch, PS4 and of course PlayFab's server.
The Leaderbords are henceforth capable of syncing throughout, making your player's game or studio data available on every platform.

It has console support in cases you want to port. And it has complete set of tools, able to adapt to your game design's needs.

 

Actions, Conditions & Expressions

Actions

Action.png

Friend Leaderboards:

  • Get Friend Leaderboard - Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard.

    • Statistic Name - ​Statistic used to rank friends for this leaderboard.

    • Start Position - Position in the leaderboard to start this listing.

    • Max Results Count - Maximum number of entries to retrieve. Default 10, maximum 100.

    • Include Facebook - Indicates whether Facebook friends should be included in the response.

    • Include Steam - Indicates whether Steam service friends should be included in the response.

    • Specify Version - If set to "False", the latest version is selected. If "True", uses the specified Version below.

    • Version - If "Get Version" is equal to "True". Set here the version of the leaderboard to get.

    • Include Xbox - Indicates whether XBox friends should be included in the response.

    • XBox Token - Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab.

    • Tag - The tag to differentiate the requests.

​​

  • Get Friend Leaderboard Around Player - Retrieves a list of ranked friends of the current player for the given statistic, starting from the indicated point in the leaderboard.

    • Statistic Name - ​Statistic used to rank friends for this leaderboard.

    • Target Player - Choose the Player to target. "Player User" will target the current user while "PlayFab ID" will target the PlayFab ID indicated below.

    • PlayFab ID - If "Target Player" is "PlayFab ID". PlayFab unique identifier of the user to center the leaderboard around.

    • Max Results Count - Maximum number of entries to retrieve. Default 10, maximum 100.

    • Include Facebook - Indicates whether Facebook friends should be included in the response.

    • Include Steam - Indicates whether Steam service friends should be included in the response.

    • Specify Version - If set to "False", the latest version is selected. If "True", uses the specified Version below.

    • Version - If "Get Version" is equal to "True". Set here the version of the leaderboard to get.

    • Include Xbox - Indicates whether XBox friends should be included in the response.

    • XBox Token - Xbox token if Xbox friends should be included. Requires Xbox be configured on PlayFab.

    • Tag - The tag to differentiate the requests.

Player Leaderboards:

  • Get Leaderboard - Retrieves a list of ranked users for the given statistic, starting from the indicated point in the leaderboard.

    • Statistic Name - ​Statistic used to rank players for this leaderboard.

    • Start Position - Position in the leaderboard to start this listing.

    • Max Results Count - Maximum number of entries to retrieve. Default 10, maximum 100.

    • Specify Version - If set to "False", the latest version is selected. If "True", uses the specified Version below.

    • Version - If "Get Version" is equal to "True". Set here the version of the leaderboard to get.

    • Tag - The tag to differentiate the requests.

  • Get Leaderboard Around Player - Retrieves a list of ranked users for the given statistic, centered on the requested player. If PlayFabId is empty or null will return currently logged in user.

    • Statistic Name - ​Statistic used to rank players for this leaderboard.

    • Target Player - Choose the Player to target. "Player User" will target the current user while "PlayFab ID" will target the PlayFab ID indicated below.

    • PlayFab ID - If "Target Player" is "PlayFab ID". PlayFab unique identifier of the user to center the leaderboard around.

    • Max Results Count - Maximum number of entries to retrieve. Default 10, maximum 100.

    • Specify Version - If set to "False", the latest version is selected. If "True", uses the specified Version below.

    • Version - If "Get Version" is equal to "True". Set here the version of the leaderboard to get.

    • Tag - The tag to differentiate the requests.

Get Player Statistics :: Statistic names:

  • Get Statistics (C2) - Retrieves Player Statistics to return (current version will be returned).

    • Statistic {n} - ​Add a parameter to input the "Statistic Name" for each "Player Statistic" to retrieve.

    • Tag - The tag to differentiate the requests.

  • Get Statistics (C3) - Retrieves Player Statistics to return (current version will be returned).

    • Statistic - Get Player Statistics: Separate each Statistic Name by "|". Example: "Statistic1|Statistic2|Statistic3". ​

    • Tag - The tag to differentiate the requests.

  • Get All Statistics - Retrieves "All" Player Statistics to return (current version will be returned).

    • Tag - The tag to differentiate the requests.

 

Get Player Statistics :: From Stack:

  • Add Statistic Name - Add Statistic Name to Stack for the retrieval request of "Get Statistics From Stack".

    • Statistic Name​ - Unique name of the statistic.

  • Add Statistic Name Version - Add Statistic Name and Version to Stack for the retrieval request of "Get Statistics From Stack".

    • Statistic Name​Unique name of the statistic.​

    • Version​ - The version of the statistic to be requested.

  • Get Statistics From Stack - Retrieves Player Statistics from added Statistic Name and Version Stacks.

    • Tag - The tag to differentiate the requests.​

Get Player Statistics :: Versions:

  • Get Statistic Versions - Retrieves Player's Statistic Versions from Statistic Name.

    • Statistic Name​Unique name of the statistic.​​

Update Player Statistics:

  • Add Statistic Update Stack - Add Update Statistic Stack. Statistic Stack for the "Update Player Statistics" action.

    • Statistic Name​Unique name of the statistic.​​

    • Value​ - Statistic Value for the Player.

  • Add Statistic Update Stack with Version - Add Update Statistic Stack with a version property. Statistic Stack for the "Update Player Statistics" action.

    • Statistic Name​Unique name of the statistic.​​

    • Value​ - Statistic Value for the Player.

    • Version​ - The version of the statistic to be updated.

  • Update Statistics - Updates the values of the specified title-specific statistics for the user. By default, clients are not permitted to update statistics. Developers may override this setting in the Game Manager > Settings > API Features.

    • Tag - The tag to differentiate the requests.​

Load Statistic:

  • Load Statistic - Filters the Statistics locally from the latest of any "Get Statistics actions" to return the "Statistic Name", "Statistic Version" and "Statistic Value" by the input "Statistic Name".

    • Statistic Name​Unique name of the statistic.​​

  • Load Statistic with Version - Filters the Statistics locally from the latest of any "Get Statistics actions" to return the "Statistic Name", "Statistic Version" and "Statistic Value" by the input "Statistic Name" and "Statistic Version".

    • Statistic Name​Unique name of the statistic.​​​

    • Version​ - The version of the statistic to be loaded.

Conditions

Friend Leaderboards:

  • On Get Friend Leaderboard - Triggers when the Get Friend Leaderboard Succeeded.

  • On Get Error - Triggers when the Get Friend Leaderboard failed with an error.

  • For Each Friend Score - Loops through all the Friend Leaderboard Scores.

Friend Leaderboards Around Player:

  • On Get Friend Leaderboard A-Player - Triggers when the Get Friend Leaderboard Around Player Succeeded.

  • On Get Error - Triggers when the Get Friend Leaderboard Around Player failed with an error.

  • For Each Friend Score A-Player - Loops through all the Friend Leaderboard Player Scores Around the Player Score.

Leaderboards:

  • On Get Leaderboard - Triggers when the Get Leaderboard Succeeded.

  • On Get Error - Triggers when the Get Leaderboard failed with an error.

  • For Each Score - Loops through all the Leaderboard Scores.

Leaderboards Around Player:

  • On Get Leaderboard A-Player - Triggers when the Get Leaderboard Around Player Succeeded.

  • On Get Error - Triggers when the Get Leaderboard Around Player failed with an error.

  • For Each Score A-Player - Loops through all the Leaderboard Scores Around the Player Scores.

Get Statistics:

  • On Get Statistics - Triggers when the Get Player Statistics Succeeded.

  • On Get Error - Triggers when the Get Player Statistics failed with an error.

  • For Each Statistic - Loops through all the Player Statistics.

Get Statistic Versions:

  • On Get Statistic Versions - Triggers when the Get Player Statistic Versions Succeeded.

  • On Get Error - Triggers when the Get Player Statistic Versions failed with an error.

  • For Each Version - Loops through all the Player Statistic Versions.

Update Statistics:

  • On Update Statistics - Triggers when the Update Player Statistics Succeeded.

  • On Update Error - Triggers when the Update Player Statistics failed with an error.
     

Load Statistic:

  • On Loaded - Triggers when the Statistic has been loaded successfully. The values can be retrieved using the expressions under "Load Statistic".

    • Statistic Name​ - Unique name of the Statistic.

  • On Load Failed - Triggers when the Statistic has failed to load. Probably either the "Name" can't be found or the "Version" is not available.

    • Statistic Name​ Unique name of the Statistic.​

  • On Any Loaded - Triggers when any Statistic has been loaded successfully. The values can be retrieved using the expressions under "Load Statistic".

  • On Any Load Failed - Triggers when any Statistic has failed to load. Probably either the "Name" can't be found or the "Version" is not available.

Expressions

Friend Leaderboards:

  • getFriendDisplayName - Return the Get Friend Leaderboards : Display Name, if available.

    • Index - ​The item index to get from the list.

  • getFriendPlayFabID - Return the Get Friend Leaderboards : PlayFab ID, if available.

    • Index - The item index to get from the list.​

  • getFriendPosition - Return the Get Friend Leaderboards : Player Position, if available.

    • Index - The item index to get from the list.​

  • getFriendValue - Return the Get Friend Leaderboards : Status Value, if available.

    • Index - The item index to get from the list.​

  • getFriendAvatarURL - Return the Get Friend Leaderboards : Avatar URL, if available.

    • Index - The item index to get from the list.​

  • loopFriendLeaderboards - Return the Loop Index for the list on "For Each Friend Leaderboards".

  • countFriendLeaderboards - Return the Length of the list on "For Each Friend Leaderboards".

  • getFriendNextReset - Return the time the next scheduled reset will occur. "<empty>" if the leaderboard does not reset on a schedule.

  • getFriendVersion - Return the version of the leaderboard returned.

Friend Leaderboards Around Player:

  • getFriendAPDisplayName - Return the Get Friend Leaderboards : Display Name, if available.

    • Index - ​The item index to get from the list.

  • getFriendAPPlayFabID - Return the Get Friend Leaderboards : PlayFab ID, if available.

    • Index - The item index to get from the list.​

  • getFriendAPPosition - Return the Get Friend Leaderboards : Player Position, if available.

    • Index - The item index to get from the list.​

  • getFriendAPValue - Return the Get Friend Leaderboards : Status Value, if available.

    • Index - The item index to get from the list.​

  • getFriendAAvatarURL - Return the Get Friend Leaderboards : Avatar URL, if available.

    • Index - The item index to get from the list.​

  • loopFriendAPLeaderboards - Return the Loop Index for the list on "For Each Friend Leaderboards Around Player".

  • countFriendAPLeaderboards - Return the Length of the list on "For Each Friend Leaderboards Around Player".

  • getFriendAPNextReset - Return the time the next scheduled reset will occur. "<empty>" if the leaderboard does not reset on a schedule.

  • getFriendAPVersion - Return the version of the leaderboard returned.

Leaderboards:

  • getDisplayName - Return the Get Leaderboards : Display Name, if available.

    • Index - ​The item index to get from the list.

  • getPlayFabID - Return the Get Leaderboards : PlayFab ID, if available.

    • Index - The item index to get from the list.​

  • getPosition -Return the Get Leaderboards : Player Position, if available.

    • Index - The item index to get from the list.​

  • getValue - Return the Get Leaderboards : Status Value, if available.

    • Index - The item index to get from the list.​

  • getAvatarURL - Return the Get Leaderboards : Avatar URL, if available.

    • Index - The item index to get from the list.​

  • loopLeaderboards - Return the Loop Index for the list on "For Each Leaderboards".

  • countLeaderboards - Return the Length of the list on "For Each Leaderboards".

  • getNextReset - Return the time the next scheduled reset will occur. "<empty>" if the leaderboard does not reset on a schedule.

  • getVersion - Return the version of the leaderboard returned.

Leaderboards Around Player:

  • getAPDisplayName- Return the Get Leaderboards Around Player : Display Name, if available.

    • Index - The item index to get from the list.​

  • getAPPlayFabID- Return the Get Leaderboards Around Player : PlayFab ID, if available.

    • Index - The item index to get from the list.​

  • getAPPosition- Return the Get Leaderboards Around Player : Player Position, if available.

    • Index - The item index to get from the list.​

  • getAPValue- Return the Get Leaderboards Around Player : Status Value, if available.

    • Index - The item index to get from the list.​

  • getAAvatarURL- Return the Get Leaderboards Around Player : Avatar URL, if available.

    • Index - The item index to get from the list.​

  • loopAPLeaderboards- Return the Loop Index for the list on "For Each Leaderboards Around Player".

  • countAPLeaderboards- Return the Length of the list on "For Each Leaderboards Around Player".

  • getAPNextReset- Return the time the next scheduled reset will occur. "<empty>" if the leaderboard does not reset on a schedule.

  • getAPVersion- Return the version of the leaderboard returned.

Get Statistics:

  • getStatName - Return the Statistic Name.

    • Index - The item index to get from the list.​

  • getStatValue- Return the Statistic Value.

    • Index - The item index to get from the list.​

  • getStatVersion- Return the Statistic Version.

    • Index - The item index to get from the list.​

  • loopStatistics - Return the Loop Index for the list on "For Each Statistics".

  • countStatistics- Return the Length of the list on "For Each Statistics".

Get Statistic Versions:

  • verStatName - Return the Statistic Name. The Name of the Statistic when the version became active.

    • Index - The item index to get from the list.​

  • verStatVersion - Return the Statistic Version. The Version of the Statistic.

    • Index - The item index to get from the list.​

  • verActivation - Return the Activation Time. The time when the statistic version became active.

    • Index - The item index to get from the list.​

  • verDeactivation - Return the Deactivation Time. The time when the statistic version became inactive due to statistic version incrementing.

    • Index - The item index to get from the list.​

  • verSchedActivation - Return the Scheduled Activation Time. The time at which the statistic version was scheduled to become active, based on the configured ResetInterval.

    • Index - The item index to get from the list.​

  • verSchedDeactivation - Return the Scheduled Deactivation Time. The time at which the statistic version was scheduled to become inactive, based on the configured ResetInterval.

    • Index - The item index to get from the list.​

  • loopStatisticVersions - Return the Loop Index for the list on "For Each Statistic Versions".

  • countStatisticVersions - Return the Length of the list on "For Each Statistic Versions".

Load Statistic:

  • retStatName - Return the Loaded Statistic Name.

  • retStatValue - Return the Loaded Statistic Value.

  • retStatVersion - Return the Loaded Statistic Version.

Server Response:

  • ServerResponse - Return the "Server Response" from every request from the PlayFab Server. The server response can also be shown in the "Chrome Developer Tools : Console", if in "debug mode".

Load:

  • Load - Return the statistic value from a specified statistic name, retrieved from the latest leaderboard request.

Request:

  • Tag - Return the "Tag" of the latest request.

 

Intstructions

1. The first step is to add the PlayFab API addon into the project.

2. Then, add the Authentication addon into the project.

3. Finally, add the Leaderboards addon into the project.

Features :

  • Complete PlayFab Leaderboard Features.

  • Leaderboards Versioning.

  • Organized Request and Update.

  • Friend Leaderboards.

  • Per Account Profiling.

  • Social Synchronicity.

Network Services :

  • Facebook

  • Google Plus

  • Game Center

  • Google Play

  • Facebook Instant Games

  • Steam

  • Xbox Live

  • Nintendo Switch

  • PS4

  • PlayFab

 

Server Setup

The Leaderboards with PlayFab is implemented through syncing with the server, from then it should automatically be interconnected with all registered or synced platforms / network server both pre- and post-setup. Although, it requires a few steps to allow it from the server-side.

Front.png
Dashboard - Settings.png

Step 1 : Create an account in PlayFab, login if you already have one.

Step 2 : Click the application used in your project.

Step 3 : The Title's, a.k.a. the Game's Dashboard should appear, then select the sidebar option, Settings.

Settings - API - Allow Leaderboards.png

Step 4 : Select the API Features tab, then check the Allow client to post player statistics.

Leaderboards Page - Highlighted.png

Step 5 : Now select the sidebar option, Leaderboards. Then, the leaderboards of the game, player ranking, including all the statistics of each user are now accessible.

You can control everything here as the administrator.

Leaderboards Page - Highlighted.png

Step 6 : Finally, proceed with your learning and experimentation using the PlayFab Leaderboards - Game Project sample.

 

Platform Leaderboards Auto-Sync

The Leaderboards has its own statistics record, which is your company's player statistics record although you can choose to also mix-in from the leaderboards from other platform services like Google Play, Game Center and Facebook. If applicable, even from Steam, Xbox, Nintendo Switch and PS4.

Company

Google Play

Game Center

Facebook

Google Plus

 
Leaderboards Showcase

Due to the high-demand of Leaderboards and is frequently asked, I made an easy sample project. This teaches the basics of the concept of both the plugin and features. Although, piece-by-piece, I recommend you understand how it works, and apply it to the other features not covered in the easy project sample
For the full testing of features, try the second project, the full test project sample.

Learning this project will help you understand the workflow of the plugin, then you can then add the advanced features yourselves, like syncing alongside with 3rd party leaderboard services like Google Play, Game Center, Facebook and Xbox. Getting Leaderboards around players and friends, etc.

Remember to setup your PlayFab Console to allow Leaderboards, and setup the Game Client Profile Data for both the console and the PlayFab API to allow specific the data you need.

 

Game Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Full Test Project

Sample Setup Project

Specifications

  • Instructions - The sample project has comments and instructions on how to use the addon and its features.

  • A.C.E. Coverage - It covers the implementation of each action, condition and expression.

  • Tips and Tricks - It provides some tips and tricks to a better use of the addon and of the event-sheet system alongside it.

Supporters

Only

Get the tools

for your pro games!

Constuct Master Collection - Itch.io
Constuct Master Collection - Discord
Constuct Master Collection - Construct 3

© Construct Master Collection 2020 • All rights reserved

Contact Information:

Expressions - 1