I want to implement gamification in my education mobile application. I have a database with user activity and I want to analyze it and give badges to a user. There will be many badges with totally different conditions. Some badges will be given once, others repeatedly.
My current approach:
- badges_awarded table that contains a badge, timestamp and string argument holding id of data that were used for this award
- badges_evaluation table holding last invocation of each badge algorithm and date when it shall be executed again
- when user finishes some game I run a script in background that will perform awarding rules. Evaluation table is used to skip some algorithms that have next run time in future.
- if game produced some conditions that invalidates rules of some badges I will updated their next run time in badges_evaluation table (e.g. a badge that user makes no mistake 5 times in a row can start counting again when a user did mistake in the game).
This tactics reduces some evaluations and database queries. The game runs on a mobile device so I must reduce complexity as much as possible. I would like to read some tips and strategies. It is critical to design this feature efficiently.
Another approach represents Fitbit: upload data to server and receive badges back. But I prefer to award kid even when offline.
Badges example:
- user played 3 consequitive days for silver and 7 days for gold badge
- user made no error 10x, 25x or 100 times in a row (bronze, silver, gold)
- user finished a game under X, Y or Z seconds (bronze, silver, gold)