Skip to content

Achievements

Jakub Hubacek edited this page Oct 1, 2025 · 4 revisions

Achievements Subsystem

Location: godot_epic_extension/src/Achievements

Overview

The Achievements subsystem handles achievement definitions, player achievements, achievement unlocking, and stats ingestion/querying. This subsystem provides comprehensive support for Epic Online Services achievement and statistics functionality.


Supported Functions

Achievement Functions

Function Description
QueryAchievementDefinitions() Queries EOS achievement definitions; requires logged-in user
QueryPlayerAchievements() Queries player achievements; requires logged-in user
UnlockAchievement(achievement_id) Convenience wrapper that calls UnlockAchievements([id])
UnlockAchievements(achievement_ids) Supports unlocking multiple achievements; persists IDs in context to avoid dangling pointers
GetAchievementDefinitions() Returns cached definitions array
GetPlayerAchievements() Returns cached player achievements array
GetAchievementDefinition(achievement_id) Copies the definition from EOS and returns a dictionary
GetPlayerAchievement(achievement_id) Implementation present in header but heavy lookup relies on cached state; verify behavior when not cached

Stats Functions

Function Description
IngestStat(stat_name, amount) Submits stat ingest using a context that keeps string storage alive
QueryStats() Queries stats for the current player
GetStats() Returns cached stats
GetStat(stat_name) Returns stat dictionary if available

Notes

  • Authentication Required: All operations require a valid, logged-in user; guards are in place to return early and warn if not authenticated

EOS SDK Coverage

Achievement Functions

Mapping of EOS_Achievements_ SDK functions* to implementation status:

EOS Function Status Notes
EOS_Achievements_QueryDefinitions βœ… Yes Called in QueryAchievementDefinitions()
EOS_Achievements_GetAchievementDefinitionCount πŸ”„ Indirect Extension uses copy-by-index APIs after QueryDefinitions; count API not directly wrapped
EOS_Achievements_CopyAchievementDefinitionV2ByIndex ❌ No Not directly used; extension copies by AchievementId instead
EOS_Achievements_CopyAchievementDefinitionV2ByAchievementId βœ… Yes Used in GetAchievementDefinition()
EOS_Achievements_QueryPlayerAchievements βœ… Yes Called in QueryPlayerAchievements()
EOS_Achievements_GetPlayerAchievementCount πŸ”„ Indirect Extension iterates using copy-by-id rather than relying on count in public API
EOS_Achievements_CopyPlayerAchievementByIndex ❌ No Not used; extension copies by AchievementId
EOS_Achievements_CopyPlayerAchievementByAchievementId βœ… Yes Used in GetPlayerAchievement()
EOS_Achievements_UnlockAchievements βœ… Yes Called in UnlockAchievements(). Uses context to keep strings alive
EOS_Achievements_AddNotifyAchievementsUnlockedV2 βœ… Yes Registered in setup_notifications() to receive unlock events
EOS_Achievements_RemoveNotifyAchievementsUnlocked βœ… Yes Called in cleanup_notifications()

Stats Functions

Mapping of EOS_Stats_ SDK functions* to implementation status:

EOS Function Status Notes
EOS_Stats_IngestStat βœ… Yes Called in IngestStat(). Uses context to keep strings alive
EOS_Stats_QueryStats βœ… Yes Called in QueryStats()
EOS_Stats_GetStatCount βœ… Yes Used to iterate through stats in GetStats()
EOS_Stats_CopyStatByIndex βœ… Yes Used in GetStats() to copy individual stat entries
EOS_Stats_CopyStatByName βœ… Yes Used in GetStat() to retrieve specific stat by name

Clone this wiki locally