Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm undecided if I want to implement this feature in my game at the time or not. I don't want the project to get to far out of control so I'm focusing on core mechanics first.

Is this a feature that is easy to implement later assuming I data drive everything and store everything?

share|improve this question
3  
I ported a certain well-known DOS game to windows a couple years ago - one of the things I would have loved to add to it, if we were going to make any changes to the gameplay - would have been achievements. So if I could add achievements to a over 10 year old game clearly not designed for it, I'd pretty much say they can be added anywhere. Heck, this very site has achievements.. –  Jari Komppa Jan 5 '11 at 21:11

3 Answers 3

up vote 18 down vote accepted

Are you asking from the perspective of technicalities of implementing or the ramifications of the design? Either way, the answer to your question is "yes".

From the technical side of things, generally speaking you just find the hooks in your code that are responding to your achievement events and put in your stat tracking code there. You might have to add some new things if you're tracking things that aren't exactly discrete events that are already happening in the game (for example: X amount of hours played).

From the design side of things, well, achievements are extrinsic motivators and adding them doesn't really play too much into the core gameplay loop, except for people who want to seek them out. So they're pretty safe regardless.

share|improve this answer
2  
+1 for not writing irregardless :) –  Per Fagrell Jan 6 '11 at 7:39
    
Yes, I'm doing this now. It was fairly easy to link in shotsFired++ into the part where new bullets are instantiated, and shotsHit++ in the part where a bullet impacts another player. It helped that I tracked who shot what bullet (because I use the information to track who got what kill etc) –  bobobobo Oct 27 '13 at 19:12

Provided that your game engine is designed well and uses some kind of observable event system (where events are generated and listened for by interested parties), it should be quite easy to "plug-in" an achievement system at a later point (by adding appropriate listeners). This kind of design is very flexible.

share|improve this answer

As already the existing people have added good answers, let me answer uncovered situations.

If at all you are in a position where you have completed coding your game and now starting to code achievements and find it very complex to maintain too many variables and counts and clearing them off at certain events and things like that.

You can always create one class (preferably singleton) to receive all events. Now list all your achievements. Then list all game events needed to be tracked. For e.g. my current list looks like this

KILL ENEMY - walking, bullets PLAYER DEATH - falling_off, health ENTER_ROOM, EXIT_ROOM etc.

Those extra details like walking, bullets can be parameters. Now have one function called fireEvent in that Achievement tracking class. Search all places in code where you need to fireEvents and call that function. Now do the rest of dirty work in the Achievements class. this is the safest way to not disturb existing code and code Achievements. It worked out pretty fast for me.

share|improve this answer
    
Thats a really good solution for the post development implementation. I'll keep this in mind because I'm still not sure if I want to implement it. I might do it in a later phase because I don't want the scope of my project to get out of control. –  Bryan Harrington Jan 5 '11 at 22:19

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.