Achievements and Leaderboards
Define achievements and leaderboards for your game in Glint Studio, set score bounds and anti-spam limits, and see how Glint records unlocks and keeps each player's best scores.
Glint Studio · 4 min read
Define achievements and leaderboards in Glint Studio, then unlock achievements and submit scores from your game through the Glint SDK.
Before You Start#
Your game needs the Glint SDK. Start with the SDK quickstart. The calls your game makes are in the SDK API reference. Both sections described below are in the Features & Manuals tab of your game's page in Glint Studio.
Achievements#
Add an Achievement#
In Achievements, fill in the form and choose Save achievement.
| Field | Rules |
|---|---|
| Key | 2 to 48 letters, numbers, hyphens or underscores, starting with a letter or number, such as first_win. It's saved in lowercase, and your game uses it to unlock the achievement. |
| Title | 2 to 80 characters, such as First Victory. Players see it when they unlock the achievement. |
| Description | Optional, up to 240 characters. Players see it with the title. |
| Hidden until unlocked | Tick it to mark a secret achievement. |
A game can have up to 100 achievements. Saving with a key that already exists updates that achievement instead of adding a new one.
How Players Unlock Them#
Your game unlocks an achievement with sdk.achievements.unlock("key"). Glint then shows an Achievement unlocked notice over the game, with its title and description.
- Only keys you've defined in Glint Studio can be unlocked.
- Each player unlocks each achievement once. Unlocking it again does nothing.
- A signed-out player's unlocks are kept for their browser, and move to their account when they sign in and play the game again.
- Your game's page lists its achievements, with which ones the player has unlocked and the share of players who have each one. A hidden achievement shows as "Hidden achievement" until the player unlocks it.
Delete removes an achievement. Your game can't unlock it after that.
Leaderboards#
Add a Leaderboard#
In Leaderboards, fill in the form and choose Save leaderboard.
| Field | Rules |
|---|---|
| Key | 2 to 48 letters, numbers, hyphens or underscores, starting with a letter or number, such as high_score. Saved in lowercase. |
| Name | 2 to 80 characters, such as High Score. |
| Sort | Highest score first, or Lowest score / fastest time first. |
| Min score and Max score | Scores outside this range are rejected. Defaults are 0 and 1,000,000. |
| Max / min | Submissions allowed per player per minute, from 1 to 60. Default 10. |
| Min play (sec) | Scores count only once the player has played your game for this many seconds in all, up to 86,400. Default 0, which turns it off. |
A game can have up to 20 leaderboards. Saving with a key that already exists updates that leaderboard.
How Scores Are Kept#
Your game submits a score with sdk.leaderboards.submit("key", score).
- Each leaderboard keeps three lists: all time, this week (weeks start on Monday, UTC) and today (UTC).
- Each player has one entry per list. A new score replaces it only when it's better, by the leaderboard's sort.
- Only signed-in players with a verified email can post scores.
- A score is rejected when it's outside your range, or when the player hasn't reached the minimum play time yet. Play time is counted like free hours, so only active play with recent input counts.
- Submissions over the per-minute limit are refused for the rest of that minute.
- Entries show the player's Glint display name.
Your game's page shows each leaderboard's top scores for all time, this week and today. Your game can also read the top scores, up to 100 at a time, and the player's own rank through the SDK, and draw them however you like.
Warning
Deleting a leaderboard also deletes all of its scores, and it can't be undone.
Test Before You Publish#
Use Private preview on your game's page in Glint Studio to play the game before it's published. Unlocks and scores from a preview are recorded like anyone else's.
Tip
To remove a test score, choose Inspect scores on the leaderboard, then Remove next to the score. To clear them all before launch, delete the leaderboard and add it again with the same key. Your game keeps working because the key hasn't changed.
To test without uploading, the SDK's local emulator can stand in for Glint. See CLI.
For how achievements and scores fit with publishing, see Rate and Publish Your Game.
Still stuck? Contact Support.