B
B
BonBon Slick2017-05-19 23:32:54
Algorithms
BonBon Slick, 2017-05-19 23:32:54

How would you make an achievement system on the site?

I think everyone knows the site evrl.to, well, or Steam) They have a very interesting system of achievements for the user, I think they are implemented programmatically in different ways, I would like to know how and how they do this in general. Because the way I imagine it, I think it will heavily load the system.
In my understanding, this will need something in the conditions under which the user will receive an achievement, each user action, we go in to check all achievements, or specific for a specific action, and update it (example: 10 comments out of 100) status for the user. Or put a fad "received".
Is it so? Will it load the site too much? How is it implemented in Steam / evrl.to? How would you implement such functionality?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Q
Q2W, 2017-05-20
@BonBonSlick

When writing a comment, you can increase the user's comment counter. It's not usually expensive.
When the user's comments counter increases, if as a result it exceeds the threshold value, run an event handler that issues an achievement. Comparing "before" and "after" values ​​is also inexpensive.
When a user is viewing his progress on achievements, displaying the value of the counter of his comments is cheap, and generally consider a constant with a threshold value for free.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question