Achievements
Feature description
Section titled “Feature description”Achievement support has three categories: unlocking achievements, reporting achievement progress, and clearing all achievements for the current game. Achievement keys must match backend configuration. Keys in examples are only used to demonstrate the calling pattern.
Supported engines
Section titled “Supported engines”| Engine | Status | Notes |
|---|---|---|
| Unity | Preview | The main package provides public APIs. |
| GameMaker | Preview | The Windows runtime provides unlock, progress reporting, and clear-all support. |
| Godot | In development | The preview runtime already has achievement APIs. |
Prerequisites
Section titled “Prerequisites”- Startup and connection is complete.
- The corresponding achievements have been created in the backend.
- Achievement keys in game code match backend configuration.
- Unity / GameMaker / Godot currently perform achievement calls through the local IGP desktop client.
By engine
Section titled “By engine”using UnityEngine;using IGP.UnitySDK;
public sealed class IGPAchievementButtons : MonoBehaviour{ [SerializeField] private IGPRuntimeManager runtimeManager;
public async void UnlockFirstSession() { var result = await IGPSDK.UnlockAchievementAsync( runtimeManager, "first_session");
Debug.Log($"Unlock success={result.success}, duplicated={result.duplicated}"); }
public async void AddMatchProgress() { var result = await IGPSDK.ReportAchievementProgressAsync( runtimeManager, "matches_played", 1, "match_complete");
Debug.Log($"Progress success={result.success}, duplicated={result.duplicated}"); }
public async void ClearAllAchievements() { var result = await IGPSDK.ClearAchievementsAsync(runtimeManager); Debug.Log($"Clear success={result.success}, deleted={result.deletedCount}"); }}// Unlock achievementigp_unlock_achievement( "first_session", "", 0, global.igp_app_id);
// Report progressigp_report_achievement_progress( "matches_played", 1, "match_complete", "", 0, global.igp_app_id);
// Clear all achievements for the current gameigp_clear_achievements(global.igp_app_id);Read results from the event queue.
var evt = igp_poll_event();while (!is_undefined(evt)){ if (evt.type == "achievement_result") { show_debug_message("Achievement success: " + string(evt.success)); } else if (evt.type == "achievement_clear_result") { show_debug_message("Cleared achievements: " + string(evt.deleted_count)); }
evt = igp_poll_event();}Godot currently should call achievement APIs through autoload.
using Godot;using IGP.GodotSDK.Autoload;
public partial class AchievementPanel : Control{ private IGPGodotAutoload IGP => GetNode<IGPGodotAutoload>("/root/IGP");
public async void UnlockFirstSession() { await IGP.UnlockAchievementAsync("first_session"); }
public async void AddMatchProgress() { await IGP.ReportAchievementProgressAsync( "matches_played", 1, "match_complete"); }
public async void ClearAllAchievements() { await IGP.ClearAchievementsAsync(); }}Godot is still in development. Production projects should not treat the current API as a stable commitment.
Self-test
Section titled “Self-test”| Engine | Checkpoint |
|---|---|
| Unity | Logs include success, duplicated, and message after the call; clear-all returns deletedCount. |
| GameMaker | The event queue receives achievement_result or achievement_clear_result. |
| Godot | The call triggers the AchievementReported or AchievementsCleared signal. |
Troubleshooting
Section titled “Troubleshooting”success=false: check whether the achievement key exists.duplicated=true: the achievement was already unlocked before and is not necessarily an error.- Clear-all only affects the current signed-in user’s achievement records for the current game. It is usually intended for debugging, testing, or an explicitly allowed reset flow.
- No result: confirm the IGP desktop client is connected, then confirm game code is polling or listening for events.
- Progress achievement values are abnormal: confirm backend achievement type and progress report values match.