Get Playtests

How to Add Steam Achievements to Your Game: Unity and Godot

How to add Steam achievements: set them up in the Steamworks editor, unlock them in Unity or Godot, test and reset, icon sizes and design tips.

Updated · 9 min read · For developers

This is how to add achievements to a Steam game from start to finish: define them in the Steamworks achievements editor, unlock them from code in Unity, Godot or C++, test them before release, and pass the release checklist. The code part really is small. Valve's own step-by-step calls it about ten minutes and under ten lines. The parts that trip people up are publishing, testing, icons and design, so most of this guide is about those.

Before you start

You need three things in place:

  • A Steamworks app with an App ID, and permission to edit the app's info. Valve requires that permission to use the achievements editor.
  • The Steamworks SDK in your game, directly or through a wrapper like Steamworks.NET, Facepunch.Steamworks or GodotSteam.
  • Steam running with an account that owns the app (your developer account does), so SteamAPI_Init succeeds.

Your game doesn't need to be released, or even approved for release, to test achievements. It does need its achievement settings published. That one detail causes most "it returns false" posts on the forums.

Step 1: Create the achievements in Steamworks

Valve now has a dedicated achievements editor. From your app's landing page in Steamworks, go to Edit Steamworks Settings, then Stats & Achievements > Achievements, and open the new editor from the banner at the top.

For each achievement, fill in:

  • API Name: the string your code uses, like ACH_FIRST_BOSS. Pick a convention and stick to it. Changing it later means changing code.
  • Display Name and Description: what players see. Both are localizable.
  • Icons: an achieved icon and an unachieved icon (more on sizes below).
  • Set By: client, game server or official game server. Leave it on client unless you run servers that should be the only ones allowed to award it.
  • Progress Stat (optional): a stat that drives a progress bar, with the range that maps to 0% and 100%.
  • Visibility: Visible or Spoiler. Valve renamed the old "Hidden" option to Spoiler. A spoiler achievement's name and description stay hidden until the player unlocks it or chooses to reveal it.

If an achievement depends on a count ("win 50 matches"), create the stat first under Stats. Valve supports INT, FLOAT and AVGRATE stats, and a progress stat must already exist and use the same Set By permission as the achievement.

Bulk import if you have a long list

The editor's Bulk Import/Export tab exports definitions and localization as CSV files. Edit them in a spreadsheet and upload them back with your icons. Name icon files after the API name with _ACHIEVED or _UNACHIEVED on the end, like LEVEL_20_ACHIEVED.png, and they attach automatically. This is the fastest way to handle localization too, since every language gets its own column.

Limits to know

  • Apps that haven't been vetted are limited to 100 achievements. After that, the editor allows up to 5,000.
  • Archived achievements count toward the limit.
  • Up to 40 achievement sets per app, including the base game set.

Step 2: Make the icons

Valve's current guidance is 256x256 pixel PNG for best results. Icons can be as small as 64x64, must be square, and anything larger is scaled down to 256x256. JPG is also accepted.

You don't have to draw the locked version. Click Generate in the editor (or tick the automatic option when bulk uploading) and Steam makes a grayscale unachieved icon from the achieved one. Valve recommends colorful achieved icons and grayscale unachieved ones, which is exactly what that gives you.

Tips that save a redo:

  • Design at 256x256 but check how it reads at 64x64. Overlay pop-ups and profile lists show it small.
  • Keep a consistent frame or background color so your list looks like one set.
  • Names and icons must be all-ages appropriate, per Valve.

Step 3: Publish the settings

Changes in the editor are saved to a draft. To make them live, go to the Publish tab in Edit Steamworks Settings and publish, like any other Steamworks change.

Until you publish, SetAchievement and GetAchievement return false because Steam doesn't know the API name exists. Every time you add or rename an achievement, publish again before testing.

Step 4: Unlock achievements from code

The pattern is the same in every engine: set the achievement, then store stats. Setting only changes Steam's in-memory state and is cheap. Storing uploads it to the server and triggers the overlay pop-up.

One change from older tutorials: you no longer need to call RequestCurrentStats and wait for a callback at startup. Valve marks it deprecated because the Steam client loads stats and achievements before your game launches. GodotSteam notes the same change came in with SDK 1.61, so versions 3.28 and 4.14 or newer don't need the old request step.

Unity with Steamworks.NET

  1. Install Steamworks.NET. Either import the .unitypackage from the GitHub releases page or add it through the Package Manager with "Add package from git URL" and the URL from the Steamworks.NET installation page. Pin a version number at the end of the URL.
  2. Open steam_appid.txt in your project root and replace 480 (Valve's test app, Spacewar) with your App ID. Restart Unity so it loads. Don't ship this file to players.
  3. Add the SteamManager script to an empty GameObject in your first scene. It initializes Steam and runs callbacks every frame.
  4. Unlock from gameplay code, always checking that Steam initialized:
  • if (!SteamManager.Initialized) return;
  • SteamUserStats.SetAchievement("ACH_FIRST_BOSS");
  • SteamUserStats.StoreStats();

For a counter achievement, update the stat and store: SteamUserStats.SetStat("STAT_WINS", wins); then SteamUserStats.StoreStats();. The progress stat drives the bar on the player's achievements page. When the count reaches the target, call SetAchievement and StoreStats as usual.

Unity with Facepunch.Steamworks

Facepunch wraps achievements as objects. With using Steamworks.Data; the unlock is one line: new Achievement("ACH_FIRST_BOSS").Trigger();. Pick one wrapper per project and stick with it.

Godot with GodotSteam

  1. Install GodotSteam (the pre-compiled editor, the GDExtension plugin or a module build) and initialize with Steam.steamInitEx(). Check the returned status before calling anything else.
  2. Unlock and store:
  • Steam.setAchievement("ACH_FIRST_BOSS")
  • Steam.storeStats()

GodotSteam's tutorial points out that if you skip storeStats(), the achievement is recorded but the pop-up won't show, and it still needs storing at some point to upload. To read the current state, call Steam.getAchievement("ACH_FIRST_BOSS") and check both the ret value (does it exist and is it published) and achieved.

C++ and other engines

Call SteamUserStats()->SetAchievement("ACH_FIRST_BOSS") then SteamUserStats()->StoreStats(). Valve's Spacewar sample in the SDK has a full StatsAndAchievements class you can copy. Unreal projects usually go through the Online Subsystem Steam plugin or a Steam integration plugin, which call these same functions underneath.

Where to call StoreStats

Valve's advice: call SetStat whenever a stat changes, and call StoreStats at natural checkpoints like level transitions. When an achievement unlocks, call StoreStats right away so the player sees the pop-up at the moment they earned it.

For progress pop-ups, IndicateAchievementProgress shows a "10/20" style notification. It doesn't set anything by itself, so update the stat too. Valve's example is showing it at 10 wins on a 20-win achievement.

Don't keep your own local cache of achievements on disk. Steam already caches stats for offline play and merges them when the player reconnects. Valve warns that a second cache tends to conflict and makes progress look like it reverted.

Step 5: Test before release

Before release, earned achievements don't appear in the Steam Community or the library, so you need a way to see them.

  • Preview page: the editor links to a preview of your achievements on your own Steam achievements page.
  • Developer-only sets: create a set marked Developer-only. Only developers of the app can see and unlock achievements in it, before or after release. It's a clean way to test new ones without players noticing.
  • Debug readout: add a hidden debug screen that lists every API name with GetAchievement results. This catches typos instantly.
  • Reset from the console: launch Steam with steam.exe -console, then use achievement_clear followed by your App ID and the API name to clear one, or reset_all_stats with your App ID to wipe everything.
  • Reset from code: ResetAllStats(true) wipes stats and achievements for the current account. Keep it behind a debug flag.

A test pass checklist

  1. Every API name in code matches the editor exactly (case matters).
  2. Settings are published.
  3. Each achievement unlocks once, at the right moment, with the pop-up.
  4. Counter achievements unlock at the right number, with progress pop-ups where you want them.
  5. Unlocks work offline and sync after reconnecting.
  6. DLC achievements only fire for owners. Valve won't unlock DLC-set achievements for players who can't play that DLC, but your game should check ownership anyway.
  7. Nothing unlocks in your demo. Valve's demo guidance is to disable achievements there and let the full game grant them from a carried-over save.
  8. Localized names and descriptions show in every language you support.

Write each as a case in your game test plan so the pass gets repeated after every update.

Step 6: Turn them on for release

Two things on Valve's release checklist:

  • Tick Steam Achievements under Supported Features in your store page's Basic Info.
  • Every achievement needs a name in each language you've configured, and an icon.

After launch, players see your list on the store page and on the global achievements page at steamcommunity.com/achievements/ plus your App ID. Spoiler and archived achievements don't appear in the store page panel. Our Steam release checklist has the rest of the launch-week items.

Sets, archiving and post-launch changes

Achievement Sets are in beta, but they solve old headaches:

  • Base game set: where everything goes by default. It can't be renamed or deleted.
  • DLC sets: restricted to DLC owners, hidden until the DLC releases, and they don't count toward base game completion.
  • New content: Valve recommends a new set for an update or mode instead of adding to a completed one, because a completed set stays marked complete even with new locked achievements in it.
  • Archiving instead of deleting: deleting removes an achievement from everyone who earned it. Archiving keeps it for those players and stops it counting for everyone else. Your game must stop awarding it.

Sets need no extra code. You unlock with the same API names and calls.

Design achievements players actually want

The list is public on your store page, so it's also a pitch. A few principles:

  • Size the list to your content. Strike Two looked at 4,270 paid indie games from 2020 to 2022 that have achievements: the median has 20, half fall between 11 and 34, and only 2.9% have 100 or more. Mark real moments, not button presses.
  • Give one in the first session. It tells players the system exists.
  • Mix the types: progression (keep these coarse), exploration, skill, playful system combos, and at most a couple of grind ones.
  • Ask why it's hard. Game Developer's "Achievement Design 101" puts it well: players take the most efficient route, not the fun one, so design the efficient route to be fun. Avoid luck-only, missable, or "find a live multiplayer match" requirements.
  • Avoid permanent missables. If one can be missed, add a way back.

Use unlock rates as playtest data

Once players have your game, Steam shows the share of players who earned each achievement, and Valve points out it's a developer tool too: are your challenges hard enough, or too hard? Strike Two found the middle achievement in a typical indie game is earned by a median 19.8% of players.

You can get that signal before launch. Put your progression achievements in a developer-only set or log them yourself, then watch where playtesters stop. A drop from 80% to 20% between two chapter achievements points at a wall, and our guide to difficulty curve game design covers how to find and fix spikes like that. Pair it with what testers say in their notes, using the questions from how to know if your game is fun.

If you need fresh players for that pass, post your build on Get Playtests. It's free, no credit card, and the players who pick your game leave written, video or livestream reviews. If you're also preparing for handhelds, our guide to getting your game Steam Deck Verified covers the controller and text checks that tend to show up in the same polish sprint.

Sources

  1. Step by Step: Achievements (Steamworks Documentation)
  2. Stats and Achievements (Steamworks Documentation)
  3. ISteamUserStats Interface (Steamworks Documentation)
  4. Steamworks.NET Installation
  5. Steamworks.NET Getting Started
  6. Statistics and Achievements (GodotSteam)
  7. Achievement.Trigger (Facepunch.Steamworks wiki)
  8. How many achievements should a game have? (Strike Two)
  9. Achievement Design 101 (Game Developer)