Leaderboards #

Global and regional leaderboards are used in Blocks and Cities by Kyoso Interactive.
Global and regional leaderboards are used in Blocks and Cities by Kyoso Interactive.

Leaderboards are a common feature in games to provide engagement and competitiveness among your player base, and Nakama provides a feature-rich implementation of leaderboards. The Hiro wraps the features and functionality of the Nakama leaderboards system, and adds: built-in support for regional leaderboards, identified by their ISO Code, convenient display for friends leaderboards (using Nakama’s Friends feature), and a convenient way to fan-out score updates to multiple leaderboards.

Customization parameters #

The following JSON represents the customization parameters you can use to configure the default user experience for the leaderboard system.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
{
  "leaderboards": [{
      "id": "chef-tournament",
      "sort_order": "desc",
      "operator": "set",
      "reset_schedule": "0 0 */3 * *", // At 12:00 AM, every 3 days.
      "authoritative": true,
      "regions": [
        "EU",
        "US"
      ]
  }]
}

The JSON schema defines a leaderboards array which must contain individual objects for each leaderboard you wish to define in the system. You can configure as few or as many leaderboards as needed for your desired gameplay.

PropertyTypeDescription
leaderboards[]LeaderboardAn array of all leaderboards.

Each individual leaderboard may define the following:

Leaderboard #

PropertyTypeDescription
idstringThe id of this leaderboard.
sort_orderstringThe leaderboard sort type (e.g. asc or desc).
operatorstringThe leaderboard operation (e.g. set, best, incr, or decr).
reset_schedulestringThe reset schedule in CRON format.
authoritativeboolWhether scores must be submit to this leaderboard authoritatively.
regions[]stringThe available regions for the leaderboard.