Skip to main content
All CollectionsPortal-X Pages
Design | Gamification | Achievements
Design | Gamification | Achievements

Reward your players with Achievements.

Jason Liang avatar
Written by Jason Liang
Updated over a week ago

Design

Achievements are an effective way for your designer to directly compliment a user for mastering the app. A portion of your users will pursue Achievements with extra determination.

  • The minimum recommended number of achievements for an app is 12

  • A common count of achievements for an app is 50

  • If your game has a demo, it is recommended to rig one achievement to be completed just before the end of the demo

  • If your game has both multiplayer and single-player modes, limit the amount of time investment the player must spend in the multiplayer environment to earn the multiplayer-only achievements.

  • Avoid creating achievements that require external luck to achieve. Favor designs that a determined player can achieve with skill or dedication.

  • Grant an achievement for completing the central experience.

  • Grant achievements for completing side activities that might otherwise be skipped or missed.

  • If you have achievements that require a count (eg. "Vanquish 100 orcs"), it's highly effective to show the count increment towards the achievement goal with a transient indicator during gameplay.

Implementation

Achievements can be triggered directly from the client via API calls or can be awarded automatically by the server by configuring Milestones and Level Up rewards.

To create an achievement, go to the Achievements page on the dashboard.

  • Click the [Create...] button with the plus icon.

  • Enter an achievement ID, title, and description.

  • Upload a picture of your achievement.

  • Choose if the achievement is invisible until earned.

  • Add extra data that is needed by your app.

  • Select which platforms the achievement is enabled for. For each platform you are supporting, you need to add the matching achievement ID you will find on the dashboard of those platforms.

  • [Save] your new achievement!

Writing the code

Now that you created achievements, you will want to reward to your players.

In your client code

  • Add the brainCloud client to your app.

  • Pair the client with the dashboard.

  • Authenticate your user into brainCloud.

  • Request a list of achievements with the ReadAchievements call.

  • Award the not awarded achievements with the AwardAchievements call.

  • Review other achievement-related calls for your app in the API Reference.

    private BrainCloudWrapper _bc;
    private string _wrapperName = "default";

    void Start() {
    // Unity
    GameObject go = new GameObject();
    _bc = go.AddComponent<BrainCloudWrapper>();
    _bc.WrapperName = _wrapperName; // optionally set a wrapper-name
    _bc.Init(); // extra data, such as: _appId, _secret and _appVersion, is taken from the brainCloud Unity Plugin.
    DontDestroyOnLoad(go); // keep the brainCloud game object through scene changes

    _bc.ResetStoredAnonymousId();
    _bc.ResetStoredProfileId();
    _bc.AuthenticateAnonymous((response, cbObject) => { ReadAchievements(); });
    }

    List<string> unawardedAch = new List<string>();
    void ReadAchievements() {
    _bc.GamificationService.ReadAchievements(true,
    (response, cbObject) => {
    var jsonMessage =
    (Dictionary<string, object>) BrainCloud.JsonFx.Json.JsonReader.Deserialize(response);
    var jsonData = (Dictionary<string, object>) jsonMessage["data"];
    var achievementsData = (Dictionary<string, object>[]) jsonData["achievements"];

    foreach (var achievement in achievementsData)
    {
    if (achievement["status"].Equals("NOT_AWARDED"))
    {
    unawardedAch.Add((string) achievement["id"]);
    }
    }

    AwardAchievements();
    });
    }

    void AwardAchievements() {
    _bc.GamificationService.AwardAchievements(unawardedAch,
    (response, cbObject) => {
    Debug.Log(response);
    });
    }
Did this answer your question?