Glenn's Development Blog

Achievement Unlocked

Leave a comment

Only 2  weeks left and while most of the features present in my proposal are implemented, it seems like I will not be able to finish all the small details . The main reason for this, is the unforeseen work on the GUI Engine. Even last week I encountered yet again a rather painful bug there, that resulted in certain requests being performed twice. As this caused no problems before, I assumed the error originated from my own code but after careful debugging, I noticed that it resulted from a hover event being propagated when it shouldn’t. Besides the many bugs I’ve also did multiple additions to the engine that weren’t planned and that certainly has cost me a rather large amount of time too.

So what new stuff did I achieve.. achievements! Though without much GUI support at the moment and thus no screenshots in this post. This feature required quite some considerations as you can imagine. The first one was cheating, with as end conclusion that it is impossible to make achievements cheat-proof for an open-source game; at least with our current code-base. (There was a separate GSoC project on the list which aimed at preventing such behavior but apparently nobody came up with solid ideas. So any suggestions on that subject are definitely welcome too!)

A solid framework for achievements isn’t straight-forward and every new achievement will still need some “hacking”  to gather the needed information. At this moment there are two different types supported called “single” and “map”. The first one is used for achievements that only need to store one value. A simple example of this is “Hit 10 karts with a bowling ball.”; only the current number of karts, that you’ve hit by a bowling ball, needs to be stored. The moment you reach 10, the achievement is accomplished. The other type uses a map to store its progress. As example here we have “Win a race on every track.”. As you can guess, the id’s of the tracks are used as keys and the mapped values contain the progress. As an extra, every achievement also has a flag whether or not it should be reset after a race. This way challenges like “Collect 10 nitro bottles in one race.” are also easily supported.

I believe that with these categories a lot of achievements can be added rather easily, as the users (i.e. other developers/me) don’t need to worry about loading, saving, succeeding, and notification as my framework takes care of that. Ok. Moving on. Another hard task was (and actually still is) to take care of to which user the achievements belong. The issue here is the presence of offline and online accounts. Currently when you are offline, your progress is attached to you offline account (the ones STK uses for Story Mode at the moment). When you sign in, the progress is of course bound to your online id. I know this doesn’t make that much sense, but it’s the perfect way to let new players try out the achievements, without them having to register for an online account. In the future we’ll probably provide a way to bind those offline achievements to a new account, so that you don’t lose your progress when registering.

No real new features will be added anymore (as part of GSoC). I still need to add possibilities to change profile information, an achievements page and enhance the lobby room. So I’ve still got plenty to do!

-Glenn

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s