Achievements

Like in most games, have achievements. Some examples:

-Reach level 1 / 2 /3 / 4 / 5 / 6 / 7 / 8 / 9 / 10
-Unlock floor 1 / 2
-Weight 50 / 100 / 200 / 300 / 400 / 500 / 600 / 700 / 800 pounds.
-Kill 10 / 50 / 100 / 500 / 1000 rats, goblins, whatever.
-Spend 10 / 100 / 500 / 1000 / 2000 coins.
-Defeat the Goblin chief.
-Defeat the succubus.

It’s a bit more complicated to implement achievements than it seems. You’d think it’d just be a simple line of code to increment a counter every time a specific event happens, but the problem is that “event” could be anything and it’s super open ended. What I would need to do is to turn all of these incremental metrics into a class such that they’re more than just a number. For example, Weight would become an object of class “Property”, when it was previously just a float variable. Then I would need an Achievement class that holds a bunch of these properties and an associated database table to hold every character’s achievements.

It’s certainly an interesting system that I’d like to try my hand at, but I feel like I’d need to have a finished game before achievements even become significant.

Indeed, in my mind it looked much easier with just a limit you had to cross, ie 100 rats killed. But thanks a lot for the explanatory paragraph, it’s always nice to see how it would be done and implemented.