I've been continuing work on the Playjam GameStick replacement server and managed to implement two features: Achievements and leaderboards.
Achievements
Achievements are things you reached in a game, e.g. jumping onto 3 enemies without touching the ground in Bloo Kid 1, a "Triple hit".
Whenever a player unlocks an achievement, the game sends that information to the server - a simple set-complete API call with the ID of the achievement and the session ID of the user. The server then has to store it in a database, and return it when requested.
Achievements can be requested in several locations:
- The GameStick's main user interface lets you look at a list of all games you have achievements for.
- The achievement overview lets you inspect all achievements for each game in detail.
- Games fetch the list of achievements when they start, and want the information if the user has unlocked them already. This is helpful when you have multiple GameSticks and want to continue where you left off on the other stick.
Each of those locations had its own API call. Implementing the first and the last were easy, but the per-game achievement overview in the GameStick UI was pretty hard - the JSON structure was not parsed by the low-level GameStick database interface, but was handed off unparsed to the Marmalade-based UI, which parsed it and then crashed.
Guessing the property name for the achievement list yielded no results. Since the Marmalade SDk compiled code into C, it is pretty hard to decompile.
Fortunately, I found a Ghidra plugin for Marmalade, and after fixing a bug I could load the Console.s3e file into Ghidra. After some looking I found the property name for the achievement list: gameList.
All achievements were unfortunately registered at the server, and we have no backups of them. This means the games have to be decompiled and inspected to find out which achievements exists, what their title and description is. The achievements on the server also had images, which are lost forever.
Currently the game metadata repository has achievement information for Bloo Kid, Boulder Dash, Prince of Persia and ShaqDown.
Leaderboards
Unlike the OUYA, the GameStick had native support for high score lists (but only one per game).
After implementing achievements, leaderboards were quickly done - the only API calls required for all games I know are saving the current score, and fetching the top 50 scores.
A couple of games provide high score lists: FallingBird, FourColorTaxi, GridLock, Magnetoid and Prince of Persia.
Stop the birds unfortunately fails to show the leaderboard for yet unknown reasons.