-
Notifications
You must be signed in to change notification settings - Fork 86
Description
Summary
The idea is to support multiple achievement implementations, based on which platform the game is played on. Possible scenarios are:
- PC Steam
- Local (mod-based)
- Android Google Play
Achievement Dealer
An achievement dealer is someone that can deal an achievement and e.g. connect to a cloud service in order to register that achievement. It does not keep track of whether an achievement already has been achieved - that is responsibility of the cloud service.
We can determine by platform which dealer implementations to load, e.g. Steam and Local
Types of achievements
There are one-shots, e.g. we won the game or died the first time.
There are progression-based ones, i.e. we have to track progress of an achievement. Example: Instead of dealing one achievement when we drank the 10th potion, we constantly trigger a progress update when we drank a potion and the cloud service adds that up and decides when to deal the achievement. E.g. on Steam you can then actually track your progress (if that is not run-based).
Local configuration
Using an achievements.dat file we can store achievements and their trigger conditions. This way mods can add their own achievements.
{
"achievements": [
{
"class": "achievements.LocalAchievement",
"title": "",
"description": "",
"image": "",
"trigger": {}
}
]
}
A trigger is tied to e.g. PlayerHistory and a certain value, which gets compared to what the achievement is set to.
UI
In case of local achievements we can display them on some UI, adding info about which mod contributed them. Or also add the ones from Steam, etc.
For that we have to store the achievement state locally and have some means of retrieving achievement states from the cloud services.
See #215