Achievements, How Renegades does it

Discuss all kinds of software here including apps, games and operating systems. You can also share software guides and receive help for your software in this section.
User avatar
Pri
Site Admin
Site Admin
Posts: 5433
Joined: Fri Dec 14, 2007 8:59 am

Achievements, How Renegades does it

Sat Mar 20, 2010 9:35 am

People who come to renegades often will be familiar with our Achievement system. As you do things in the room you receive points and an 'Achievement' just like on the XBOX360.

In version 11 of my software I will be upgrading the Achievement system so I thought it would be a good idea to explain exactly how the current version works and how you could make an achievement system for your own room.

So first of all the foundation of an achievement system is being able to record and store data and then tying that data to a user. You need to do this over a long period of time. To do this we use our proprietary account system which I won't be going in to detail on in this post but basically when you join renegades your username is tied to an account name (a small plain-text non-special character name). In tern your IP is also connected to your account so that if you change your username the system can automatically reassign your Account Name to your new name. This system is not fool proof but 98% of the time it is fool proof and requires very little interaction from Staff.

Now in Renegades achievements are given for saying specific words, sentences, using commands. Most of our achievements are unlockable at any time on any day. Some of our achievements are date or condition specific. For example you can only unlock Christmas related achievements on Christmas day and you can only unlock birthday achievements on the rooms birthday (19th April). Simiarly you can only unlock an achievement for welcoming people to the room if you actually welcome someone after they enter the room. Simply say 'Hi' randomly wont unlock it.

So lets say I just said 'Australia' which is one of our key words to unlock an Australia related achievement. This is how it plays out in the code.

Me: Australia is awesome!
Code Sequence:
  • Special Word Detected by "Pri" the word is "Australia"
  • This Achievement is not tied to an Event, allowed to continue..
  • Loaded in Pri's Account from the Database
  • Check that Pri's account has not been locked by an Administrator (If Locked, stop)
  • Checking to see if Pri has already unlocked all the Australia related Achievements (If yes, Cancel)
  • Checking how many times the word Australia has been said by Pri
  • Checking the amount required to have said Australia before it unlocks (5 Required)
  • Add 1 to this users amount of times that they have said Australia and save it to the database
  • If the amount of times Australia has been said by this user is 5 or higher unlock this achievement and give visual notification to the room
  • If user has unlocked it, credit them 15 Points to there account and give them a private visual confirmation
  • Close access to the database
Now some achievements have multiple stages. For example you could get an achievement for saying Australia 5 times, then again at 15 times and then 25 times etc. To do that you just add in some more if statements for 5 or higher, 15 or higher etc and then set a variable in the users account for the highest amount of achievements within this achievement block they have earned.

So to explain that, if a user has not unlocked any achievements within the Australia achievement block their account will have 0 or Null in their account for this achievement. (0 = Nothing) But if they have unlocked the first achievement (saying it 5 times) it will say 1 which tells the bot to skip ahead to the next achievement within that block. If they have also unlocked that it will say 2 and move on to the next achievement in that block. Doing it this way means you can have an unlimited amount of achievements related to just 1 word or command without needing to do all the setup again.

This is basically how our achievement system works. The other component to a good achievement system is obviously storing the achievements they have earned to some kind of page for the users to view it and share their achievements with others. In renegades we have around 250 achievements and they are all kept secret until someone unlocks them (which they do regularly) at which point users are free to share what they have with others so that other people can try to get the same one. Achievements are not worth anything without some 'Points' so each achievement in Renegades is worth 15 Points except for 'Unique' achievements (ones that can only be unlocked once by only 1 person) which are worth 30. These achievements are incredibly hard to obtain like typing lol 30,000 times or writing 2 million messages in to the chat. Things like that.

I hope this will help other people to put some achievements in to their room! It is a great feature.

Return to “Software Centre”

Who is online

Users browsing this forum: Bing [Bot] and 11 guests