Answer the question
In order to leave comments, you need to log in
How would you organize player achievements, in terms of the server?
Hello.
Let's take a game, for example Hurston and his achievements.
What would the system of achievements and rewards look like in Python, for example?
The first approach, to have a large number of fields for each user and increase them if the conditions are passed, upon reaching the limit (for example, the 3rd stage of victories of one faction has been reached), stop increasing this field, led to 30+ fields for each user, is there an optimal approach?
As an example, I will give such achievements as "create N cards", "Streak of victories of one race", "first spray", "collect all murlocs"
Answer the question
In order to leave comments, you need to log in
I would store it in a separate "achievement" database with a link to the user.
Once I implemented it like this:
- base of achievement models. The achievement model contains a name, and information on how to check the achievement. Either data from the entity (take some counts), or pull the callback, for more complex calculations.
- the achievements themselves, the link to the achievement, the link to the user, the date of receipt, etc.
For your purposes, you can also store the achievement achievement percentage there, the same achievement, but with the "not yet received" flag
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question