Achievements Backlog
Design Challenge
This devlog contributes to the design challenge: "Improve the sustainability and expandability of an existing game so future developers can add and edit the game more easily in the future."
Context
Now SugarVita has a proper challenge system, there is one more problem to tackle. Many indie games I've played myself has the same (minor but serious) problem. Whenever the player has no internet connection but finishes a challenge at the same time, it is marked as finished in the game but isn't synched with the external achievement service. This leads to the player never being able to get this achievement again. I want to fix this for SugarVita to make sure players don't miss out on any achievements.
How to make sure achievements and in-game challenges are always synchronised?
Methods
Workshop - Brainstorming
The most obvious solution would be to check all challenges and try to unlock all of the corresponding achievements. If the achievement is already unlocked, it wouldn't do anything. Otherwise, it would unlock that achievement. The main problem in this solution is the fact you're still relying on an internet connection to even check the status which can lead to errors with the service I use.
Instead, I keep a local log of completed challenges and a seperate list of completed achievements tied to these challenges. Whenever the service confirms an achievement is unlocked, I save the id. At the start of the game and when a challenge gets finished, it automatically checks the backlog and unlocks the achievements not yet unlocked tied to the completed challenges.

Result & Validation
To test this solution, I tried to disable my internet connection temporarily and complete a challenge. The challenge got saved but the achievement wasn't awarded. Later, I re-enabled my internet connection and upon starting the game, the achievement was awarded. I tested both a mobile device and a windows device. To completely test this feature, the challenge system would need to be implemented into a new build of the game and be uploaded to the play stores. This is not currently possible because a lot of things in this game are due to change and achievements would be final. For more information, read this devlog about challenges & achievements.
Next step
The next step would be to get the game in a more finished state so proper achievements can be worked out and deployed to the new versions of SugarVita.
* Due to confidentiality, I can't disclose code for this particular system.