Skip to content

Achievements

Franklin Chen edited this page Jan 4, 2018 · 1 revision

Achievement is a system-wide mechanism for directing and rewarding users' in-game actions in a consistent manner across all games. If you are not familiar with achievements, please see Achievements documents.

From now on, all new titles created on Windwos Dev Center are using Data Platform 2017. For achievements, it's Achievements 2017 which enables game developers to use a direct calling model to unlock achievements for new Xbox Live games on Xbox One, Windows 10, Windows 10 Phone, Android, and iOS.

For how to configure achievements on Dev Center, please see Configure Achievements 2017 on Dev Center.

Using the scripts

With Achievements 2017, it's very easy to unlock achievements or update completion progresses. The key API here is UpdateAchievementAsync method. For more information, see Update_Achievement API.

In unity, you can take advantage of AchievementBase class. You will need to derive from this class and override CalculateProgress method to implement your achievement’s unlock logic.

In the derived class, you may also need to make certain effort to keep track of the parameters that needed to unlock the achievement. Uisng Stats is a good option. You can store the parameters as stats and keep them in sync by retrieving the latest stats from Xbox Live when a player launches your title, or starts a new session. Then when any stat's value changed, you can perform UnlockAchievement method to update or unlock the corresponding achievement.

However, please note that achievements are not powered by stats, and your title decides when an achievement is unlocked. Stat is just one option and there are some other ways to trace these parameters such as Connected Storage or your own web service.

See also