I mistakenly posted this to stackoverflow and now posting here based on a suggestion in on that site ...
This is a very high level conceptual question. Say in a software application I have 4 different actions, for example: Upload, Share, Comment, and like
And I want to give achievement badges to users like:
- Rookie - Upload your first 5 files
- Upload Junkie - Upload 20 files in 1 day
- Night Crawler - Upload a file after midnight
- Share-a-holic - Share 10 different files
- Likes-everything - Like 20 different files
you get the idea. What is he best way to check and see if a user has achieved a particular achievement without having to compile the logic for achievement into my code? And .. - Retain the ability to Add new achievements post compile (xml or db) - Achievements must track specific actions, number of times, and additional criteria (like time of day) - Detection should be near real-time so the user notified almost instantly when an achievement is completed
My biggest questions is, how do I detect these achievements being achieved? Do I:
1) Check after every action to see if ... (Most real time) 2) Have another program check the DB at all times against a set of rules? (Easiest)
Is there another paradigm that I'm missing? I feel there definitely is because in many games (like jetpack for iOS for example), I'm notified of the achievement I have unlocked in the instant in which I unlock it which I found pretty impressive.
Thank you