Ali Şahan Yalçın
DocsAchievements and stats

Progression

Achievements and stats

Unlocking achievements, reading progress, and all three kinds of stat.

Achievements and stats are static nodes. You do not need a subsystem, just drop the node.

WARNING: Achievements and stats must exist on the Steamworks partner site before they work. The plugin cannot create them. The name you pass here is the API Name from the partner site, not the display name, and getting that wrong fails silently.

Unlocking

Unlock Achievement takes the API Name and uploads immediately by default.

It is idempotent. Unlocking an already unlocked achievement succeeds and does nothing, so calling it every frame from a condition check costs nothing and will not re trigger the Steam toast. You do not need to track whether you already unlocked something.

NodeWhat it does
Unlock AchievementUnlock one
Is Achievement UnlockedCheck one
Clear AchievementLock it again. Development only.
Indicate Achievement ProgressShow a progress toast, for example 50 of 100
Get Achievement Unlock TimeWhen it was unlocked

Listing them

NodeWhat it does
Get Achievement CountHow many this app defines
Get Achievement Id AtThe API Name at an index
Get Achievement Display NameThe player facing name
Get Achievement DescriptionThe player facing description
Is Achievement HiddenWhether it is a secret achievement
Get Achievement Global PercentWhat share of all players have it

That is everything an achievements screen needs. Loop from 0 to Get Achievement Count.

For icons, use Get Achievement Icon (Async), which returns a texture. It is a latent node because Steam downloads the art on demand, so the synchronous version works only when the icon happens to be cached already.

Stats

Three kinds, and they are not interchangeable. The type is set on the partner site and Steam rejects writes of the wrong kind.

TypeNodeUse for
IntegerSet Stat (Integer)Counts: kills, matches played
FloatSet Stat (Float)Measurements: distance, time
Average rateUpdate Average Rate StatRates: points per hour

Average rate stats

These are the ones people get wrong. You do not compute the average. You pass what happened this session and how long it lasted, and Steam maintains the running rate.

InputMeaning
Count This SessionWhat accumulated, for example points scored
Session Length SecondsHow long it took. Must be above zero.

Computing an average yourself and writing it to a float stat gives you a mean of session means, which is a different and wrong number as soon as sessions differ in length.

Read the current average back with Get Stat (Float).

Storing

Writes are local until uploaded.

  • Store Stats uploads and forgets.
  • Store Stats (Async) uploads and tells you whether it worked.
  • Unlock Achievement stores immediately unless you uncheck Store Immediately, which is what you want when unlocking several at once: uncheck it on each, then call Store Stats once.

    INFO: If Store Stats fails with an invalid parameter error, one of your stats broke a constraint set on the partner site, for example a maximum value. Steam rejects the whole batch and sends corrected values back, so re read your stats before writing again.

    Testing without the partner site

    Set Mock Mode to Always. The mock implements achievements and stats fully, persists them to disk, and needs no App ID. See First steps.