Skip to content
AI-powered appsNewChat, vision, voice, generationBookings & schedulingAppointments that book themselvesShops & sellingA storefront in every pocketClient & businessRun the operation from one placeCommunities & clubsA home that is not a group chat
Health & wellnessHabits, tracking and calmGames2D, 3D and multiplayerPersonal & toolsThe tool you wish existedInternal toolsThe tool ops never had time for
See all use cases
ArcadeNewPricingSecurity
EngineThe game engine and World EditorHow it worksFrom one sentence to a live productDocsGuides for building and publishingBlogStories, guides and newsChangelogWhat shipped latelyStatusUptime of every serviceSupportGet help from the team
AI-powered appsBookings & schedulingShops & sellingClient & businessCommunities & clubsHealth & wellnessGamesPersonal & toolsInternal tools
See all use cases
ArcadeNewPricingSecurity
EngineHow it worksDocsBlogChangelogStatusSupport
Language
Blog
Game mechanicsNovember 22, 20266 min read

How to Add Achievements

Achievements are a second set of goals laid over your game. Done well, they point players at things they would have missed; done badly, they are a checklist nobody reads.

Startbase Team
Editorial ink illustration of brass medals pinned to a felt board, some still wrapped in paper, one round medal in ember orange

Key takeaways

  • Define achievements as data (id, title, condition, hidden or not) and evaluate them from game events, never every frame.
  • A small game wants 15 to 40 achievements, with the first one earned in the first few minutes and a few that send players somewhere new.
  • Re-check conditions when a save loads so new achievements award retroactively, and guard against double awards across tabs and devices.

To add achievements to a game, write each one as data (an id, a title, a description and a condition over the player's stats), count the events that matter (enemies defeated, levels cleared, coins spent), check the conditions when those events happen, and show a short popup the first time a condition is met. Save which achievements are earned with the player's progress. The design work is choosing achievements that change how people play, not just counting what they already do.

What achievements are for

An achievement is a goal the game did not require. That is its value: it can ask players to try a weapon they ignored, find the secret room, finish a level without jumping, or play a mode they skipped. The best achievement lists read like a tour of the game's depth. The worst read like a receipt: "Defeat 100 enemies", "Defeat 500 enemies", "Defeat 1,000 enemies".

Six kinds cover almost every good list. Aim for a mix:

  • Progress: finish world 1, reach the final boss. Everyone gets these; they mark milestones and feel good.
  • Skill: beat a level without taking damage, clear the boss in under 60 seconds. These give experts a reason to replay.
  • Discovery: find the hidden room, talk to the frog three times. They reward curiosity and are the most memorable.
  • Style or challenge: finish a level using only the dash, win a match without buying anything. Self-imposed rules that make players see the game differently.
  • Collection: all stars in world 2, every weapon owned. Tie these to your existing collectibles rather than a separate count.
  • Funny: fall into the same pit ten times, pet the dog. A small dose of personality. Keep them few.

How many, and when players earn them

For a small web game of one to three hours, 15 to 40 achievements is plenty. More than that and players stop reading the list. A rough pacing that works:

  • The first one within 2 to 5 minutes, usually for finishing the first level. It teaches that achievements exist without any tutorial text.
  • About a third that most players will earn in a normal playthrough.
  • About a third that ask for a detour: a discovery, a different weapon, a side mode.
  • About a third for experts and completionists: skill runs, full collections, the hardest difficulty.
  • A handful hidden, shown as "Secret achievement" until earned. Hide story spoilers and discoveries, never skill goals (players cannot aim for what they cannot see).

Avoid grind achievements whose only requirement is time ("play 50 hours"). Avoid achievements that need other players online if your game might have quiet periods, or they become impossible. And avoid achievements that reward quitting or losing in ways that break the experience for others in multiplayer.

The data model: stats, definitions, events

Three pieces keep an achievement system small and reliable:

  1. 01Stats: a map of counters and flags the game updates, like `enemiesDefeated`, `levelsCleared`, `secretRoomFound`, `bestBossTimeSeconds`. Stats are useful on their own (a stats screen) and outlive any single achievement.
  2. 02Definitions: a list like `{ id: "speed-boss", title: "Quick study", description: "Defeat the forest boss in under 60 seconds", hidden: false, check: stats => stats.bestBossTimeSeconds <= 60 }`. Progress achievements can also declare a target (`progress: stats => stats.enemiesDefeated, goal: 100`) so the list can show 64 of 100.
  3. 03Earned: a map of achievement id to the date it was earned. Saved with the rest of the progress.

Gameplay code only emits events ("enemy defeated", "level cleared with 0 damage"). An achievement manager listens, updates stats, and re-checks only the definitions that read those stats. Checking every definition every frame works for 20 achievements and becomes a quiet performance drain at 200, and it scatters achievement logic through gameplay code where it is easy to break.

Tip

Run all checks once when a save loads. That way, achievements you add in an update are awarded to players who already met them, and nobody has to replay a level they finished to get credit.

The popup: timing and feel

  • Corner, not center. A small toast in a top corner, with the icon and title, on screen for about 3 seconds. Center-screen popups during play cover enemies and cost lives.
  • Queue them. Three achievements earned at once show one after another, about 3 seconds each, not stacked on top of each other.
  • Hold during critical moments. If a boss fight or a cutscene is running, delay the toast until it ends. The level complete screen is a great place to show anything earned during the level.
  • A distinct sound, short and bright, that is used for nothing else. Players learn it fast.
  • Never pause the game for an achievement.

In Startbase games, screens like the HUD and the level complete screen are files you can edit in the UI Editor, so you can restyle the toast and the achievements list by hand after the agent builds them. Our HUD design guide covers placement rules that keep the toast out of the way.

Bugs achievement systems usually cause

  • Awarded twice. Two events in one frame, or two open tabs, both see the condition as newly true. Fix: check the earned map before awarding, and when saving to a server, make "earn" an insert that ignores duplicates.
  • Lost after an update. An achievement id was renamed. Ids are permanent; change titles freely, never ids.
  • Counted in the wrong mode. Kills in a practice mode or a level editor test count toward the real stats. Decide which modes feed stats and gate the events.
  • Cheesed. "Defeat 1,000 enemies" with an enemy that respawns at a door. Either accept it (it is a single-player game) or count only distinct enemies.
  • Impossible after a balance change. You raised the boss health and the 60-second achievement is now out of reach. Test every skill achievement after balance passes.
  • Progress shown wrong. A stat that is a best value (fastest time) displayed as a counter. Keep the stat type explicit: count, best-lowest, best-highest or flag.

Where to store them on the web

Browser games have no console or store achievement service behind them, so you keep your own. For a casual game, saving the stats and earned map in the browser is fine, with the honest caveat that clearing site data clears achievements too. For a game where people chase completion, save them to a player account so they follow players across devices. On Startbase, attaching a backend gives the game accounts and a database to keep these in, and our save progress guide explains when to ask players to sign in.

If you show global rarity ("12 percent of players have this"), compute it from real records on the server, and only once you have enough players for the number to mean something. A rarity of 100 percent from your own test account is worse than no number.

A brief for an achievement system

Add achievements to my 2D action game. Keep stats as a saved map of counters and best values updated from game events (enemy defeated, level cleared, damage taken, secret found, boss time). Define 20 achievements as data with id, title, description, icon, hidden flag and a check over stats; progress ones also show current and goal. Mix progress, skill, discovery and style goals; hide only the discovery ones. Re-check every achievement when a save loads. Show a toast in the top right for 3 seconds with a short chime, queue several, and hold them until a boss fight or cutscene ends. Add an Achievements screen from the main menu with earned dates and progress bars. Never award one twice.

Write the 20 titles yourself before you paste the brief, or ask the agent in Plan mode to propose a list first so you can cut the dull ones. Then pair the skill achievements with your leaderboards if you have them: both reward the same players.

Frequently asked questions

How many achievements should a small game have?

Between 15 and 40 for a game of a few hours. Enough for a mix of progress, skill and discovery goals, few enough that players read the whole list.

Should achievements be hidden?

Hide only the ones that spoil a story beat or a secret. Keep skill and challenge achievements visible, because players need to know the goal to attempt it.

How do I add new achievements after launch without unfairness?

Track stats separately from achievements and re-check every achievement when a save loads. Players who already met a new condition get it automatically.

Do browser games have achievements like consoles?

There is no built-in achievement service in the browser, so the game keeps its own list, either on the device or in a player account so it survives a new phone.

On this page

  • What achievements are for
  • How many, and when players earn them
  • The data model: stats, definitions, events
  • The popup: timing and feel
  • Bugs achievement systems usually cause
  • Where to store them on the web
  • A brief for an achievement system

Keep reading

More in Game mechanics
Editorial ink illustration of a wooden toy figure in mid-air above a gap, the puff cloud under its feet in ember orange
Game mechanicsNovember 22, 2026

How to Add a Double Jump to Your Game

A double jump is one counter and one reset rule, but the details decide whether it feels like control or like cheating. Here are the values and the bugs to watch for.

8 min read
Editorial ink illustration of a small figure streaking along a stone floor with faded ghost copies behind it, the front figure's scarf in ember orange
Game mechanicsNovember 22, 2026

How to Add a Dash Move

A dash is a short burst of fixed speed that overrides normal movement. Get its distance, its ending and its refill rule right and it becomes the move players use most.

7 min read

Read less. Ship more.

Everything in this post is one prompt away. Describe your app and watch it build.

Start building

Apps, games, backends and publishing from one conversation.

Product

  • Features
  • Use cases
  • Pricing
  • Changelog

Resources

  • Blog
  • Docs
  • Support
  • Status
  • Security

Contact

  • w@startbase.ai
  • X / Twitter
  • LinkedIn
  • Instagram

Legal

  • Terms
  • Privacy

© 2026 Startbase. All rights reserved.