Skip to main content
Version: 27.1.3

Implement Progression

Progression adds a critical component to help drive the success of your game. The Progression methods allow you to store, recall, and update player data at any time within the game, unlocking personalized player experiences. For a broader overview of Progression features, see Progression and Player Data

General Custom Progression Game Scene Flow

  1. Create keys in Developer Console for PlayerData namespace
  2. From client, retrieve player data using GetProgressionUserData at any time, prior, during, or at end of match play
  3. Call SubmitScore at the conclusion of the match
  4. Call UpdateProgressionUserData to update player data
  5. Present the player with the custom progression scene
  6. Call ReturnToSkillz to return to the Skillz UI

Progression API

Namespaces

  • PlayerData
    • For player data and is game specific. Store and retrieve custom player statistics and other custom progression-related data here.

Important Note:

In order to store data in the PlayerData namespace, you must first create your custom keys via the Skillz Developer Console. Remember to publish your keys to Production when you are ready to distribute your game builds that contain Progression.

Get Progression User Data

Retrieve data for the current user. The GetProgressionUserData method requires callback methods that allow you to handle success and fail scenarios.

public static void SkillzCrossPlatform.GetProgressionUserData(string progressionNamespace, List<string> userDataKeys, Action<Dictionary<string, ProgressionValue>> successCallback, Action<string> failureCallback)
Parameters

progressionNamespace One of the namespace string contstants

  • ProgressionNamespace.PLAYER_DATA

userDataKeys String key list of desired fields.

successCallback Action delegate to handle successful callback. The method must be defined in the implementation.

failureCallback Action delegate to handle failed callback. The method must be defined in the implementation.

Sample Implementation

MatchController.cs
using Skillz;
using UnityEngine;

public class Matchontroller : MonoBehaviour

// Define list of keys to look up within the target namespace
List<String> keys = new List<String>()
{
"games_played",
"games_won",
"average_score"
};

// Handle success response
void OnReceivedData(Dictionary<string, SkillzSDK.ProgressionValue> data)
{
Debug.LogWarning("Success");
// Do something with the data, such as populate a custom Progression scene

// Example manipulation of the returned data
// Printing each key/value to console
foreach(var kvp in data)
Debug.LogWarning("Progression default player data key: " + kvp.Key + ", value: " + kvp.Value.Value);
}

// Handle failure response
void OnReceivedDataFail(string reason)
{
Debug.LogWarning("Fail: " + reason);
// Continue without Progression data
}

public void GetData()
{
SkillzCrossPlatform.GetProgressionUserData(ProgressionNamespace.PLAYER_DATA, keys, OnReceivedData, OnReceivedDataFail);
}

Update Progression User Data

Write data for the current user. The UpdateProgressionUserData method requires callback methods that allow you to handle success and fail scenarios.

public void SkillzCrossPlatform.UpdateProgressionUserData(string progressionNamespace, Dictionary<string, object> userDataUpdates, Action successCallback, Action<string> failureCallback)
Parameters

progressionNamespace One of the namespace string contstants

  • ProgressionNamespace.PLAYER_DATA

userDataUpdates Dictionary of key/value pairs to be updated.

successCallback Action delegate to handle successful callback. The method must be defined in the implementation.

failureCallback Action delegate to handle failed callback. The method must be defined in the implementation.

Sample Implementation

MatchController.cs
using Skillz;
using UnityEngine;

public class MatchController : MonoBehaviour

// Define list of keys to update
// Must match keys created in the Developer Console!
Dictionary<String, object> updateDict = new Dictionary<String, object>()
{
{ "achievement_level", 5.5 },
{ "combos_attained", 10 },
{ "character_color", "orange" }
};
// Handle success response
void OnSentDataSuccess()
{
Debug.LogWarning("Successfully updated!");
}

// Handle failure response
void OnSentDataFail(string reason)
{
Debug.LogWarning("Fail: " + reason);
}

void UpdateData()
{
SkillzCrossPlatform.UpdateProgressionUserData(ProgressionNamespace.PLAYER_DATA,
updateDict, OnSentDataSuccess, OnSentDataFail);
}