As the developer of Django, who wrote a plug-in for screwing up for a client, I used Qaru and BigDoor as my inspiration. It turns out that gamification is very easy, and at the same time getting harder.
Assuming that you already have a User table in your database, the guessing kernel of your application occupies exactly two tables: "Currency" and "User Currency". There is one required field in the "Currency" table, "name", but I also recommend a "description". If you write an administrative interface for your level of play, the description helps a lot.
There are three things in the CurrencyUser table: user ID, currency identifier, and the amount of the currency that the user earned.
"Currency" is a buzzword for the game; it does not apply to money, but to what you are tracking. For example, SO keeps track of how many omissions you have chosen, how many votes, how many times you have a different answer than yours, and how many times one of your upvotes answers goes through 10 (note that the latter: other people do it, not you!). For each of these events, SO scans a list of criteria, gets the associated currency, and increases or creates a new UserCurrency for those that have been executed.
When an increment occurs, this is also an event, and the second level of functions is launched, and if the threshold is skipped, an icon is displayed.
SO also has "secret" badges. Did you know that You donโt get an icon for them, but the flag is shown in another table - permission to edit, permission to comment, permission to control the wiki, etc.
I mention secret icons so that it is clear: the code for tracking user events that award currency is one independent plug-in loosely connected to your application, the code for tracking currency events that lead to icons is the second, independent, freely connected part The code and code for tracking currency events that lead to permissions is the third independent, loosely coupled piece of code. The interiors of each of them can change to some extent without unnecessary effort if the APIs between them are clear.
Thus, legalizing is easy.
This is also difficult. SO is an inspiration because they really thought a lot about what their users wanted to do. The progressive permission system prevents glaring trolling, the icon system informs users about the get-go icon system ("First post badge!"), But also informs the user about what else the user can do. The names and descriptions of the icons are delightful, insightful, and let the user know more. "Gamification" is not just interaction, but a kind of documentation that tells the user: "Now that you understand that X, you can go for the Y reward!" If you cannot strike at this mark, do not interfere with gamphlation.