Leaderboard
 
Loading...
Searching...
No Matches
README

A highscores leaderboard plugin and self-hosted service for Unity.

Allows players and developers to easily store and retrieve highscore entries.

Supports unlimited entries per user, or optionally store a limited number of the best ranked entries to keep your leaderboard uncluttered. Each entry may contain up to 10KB of optional metadata. Entries may be retrieved one page at a time in ascending or descending order while taking ties into account. You can also show a player's latest score in context to other surrounding scores.

Supports Windows, Linux, OSX, Android, and iOS.

Note: Web builds are not supported.

How to Use

Before you can use the plugin you must set up the provided leaderboard_server executable on a publicly accessible server. See Assets/Leaderboard/Server/README.md for details. The plugin will not work until you have provided your server's ip and port in the setup window.

Set up

  1. Acquire a server (I recommend DigitalOcean).
  2. Read Assets/Leaderboard/Server/README.md and follow the instructions to set up the server.
  3. In Unity, run the Setup wizard: Window->Noble Leaderboard->Setup
  4. Enter your server's domain or ip and port and click Activate.
  5. Add the Leaderboard component to any GameObject in a scene.
  6. Call one of the public methods on the Leaderboard component in order to add, delete, or retrieve entries.

Example

An extensive example is provided at /Assets/Leaderboard/Example. Start from the Main Menu scene. High scores for individual levels are displayed at the end of each level. There is also a Highscores Menu with many options for viewing and manipulating the lists.

Metadata

Up to 10KB of metadata may be stored per entry. Any metadata stored must be stored as bytes, this means any information you would like to store as metadata must first be converted to a byte array. Metadata will also be retrieved as a byte array so must be converted back on retrieval.

Sorting

Entries may be retrieved in ascending or descending order (default) by rank. The rank is determined by score and sorting order taking into account ties. For entries with the same rank the order in the list is determined by seniority.

Player Entry Limit

By default there is no limit on the number of entries a player can have for each level. You may optionally set a maximum number of entries per player per level. If the player has already reached the entry limit and attains a new high score, that high score will be stored and the lowest stored score will be dropped. If a player fails to beat their lowest stored score the entry will be dropped.

Retrieve Multiple Entries per User

By default only the best ranked entry per user will be retrieved. You may use the allowDuplicateEntries option to retrieve all entries by all users.