Answer the question
In order to leave comments, you need to log in
How to organize the system of achievements in games?
Hello.
The game needs to implement an achievement system.
- Was online N hours
- Earned N money
- Spent N money
- Reached level N
...
My thoughts:
1. Implement a class for each group of events and call it in a certain part. For example, those achievements that need to be checked after each page update are installed in some kind of AppController and the rest after a certain action.
2. Embed conditions in the table something like
check: Fetch | users | online | >= | 60
execute: users | id | points | +10000
check: Fetch | users | online | >= | 120
execute : users | id | points | +20000
But it all seems to be kind of clumsy. How to solve such problems, please share your experience and ideas. Thanks
Answer the question
In order to leave comments, you need to log in
Each event corrects the value of a certain achievement in a separate cell/column of the achievement table.
The history of changes in achievements for a specific user - runs in parallel and is used to verify or update the final rating when changing the formula for calculating it based on achievements.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question