How do achievements works?

Grab your favourite IDE and tinker with the innards of game engines

How do achievements works?

Postby BubbleQ on Thu Aug 25, 2011 10:19 pm

Hey, gonna keep the question simple.

How do a achievement system works, specially the one teamfortress uses?

All I can think of that they would have used if statments, like this:

Code: Select all
if !player in air and getFrag:   {
    doUnlockAIRFRAGachievement;
    erase: doUnlockAIRFRAGachievement;
    return 1;
}

Very bad mix between python and c++, if any of them

But sins there is 379 achievements to unlock when a guy plays the game for the first time, this must be an very ineffective way?
---------------------------------
I am a happy mapper!
Archlinux
User avatar
BubbleQ
1337 p0st3r
1337 p0st3r
 
Joined: Sat Jun 07, 2008 11:03 pm
Location: Sweden, Steungsund

Re: How do achievements works?

Postby stoopdapoop on Thu Aug 25, 2011 11:03 pm

can't mess with achievements unless you have steamworks access :(
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: How do achievements works?

Postby Gary on Thu Aug 25, 2011 11:37 pm

AS codebase has them right?
Have a question related to modding or something I posted? Something that needs staff attention? I haven't been active lately, but feel free to PM me or message me on Steam(link below)

User avatar
Gary
Interlopers Staff
Interlopers Staff
 
Joined: Wed Dec 16, 2009 12:40 am
Location: USA, FL

Re: How do achievements works?

Postby stoopdapoop on Thu Aug 25, 2011 11:46 pm

OB as well, but any edits you make will be fruitless. At least as far as I understand.
I'm Brown
Image
User avatar
stoopdapoop
Veteran
Veteran
 
Joined: Sun Aug 21, 2005 2:14 am
Location: Ann Arbor, MI

Re: How do achievements works?

Postby BubbleQ on Fri Aug 26, 2011 9:40 am

Ehh, I am not going to edit them or ad some my self whatever. This question was more theoretical pushed, as my biggest concern for a game with 300 achievements was if it would be horrible cpu intense?
---------------------------------
I am a happy mapper!
Archlinux
User avatar
BubbleQ
1337 p0st3r
1337 p0st3r
 
Joined: Sat Jun 07, 2008 11:03 pm
Location: Sweden, Steungsund

Re: How do achievements works?

Postby zombie@computer on Fri Aug 26, 2011 10:02 am

BubbleQ wrote:Ehh, I am not going to edit them or ad some my self whatever. This question was more theoretical pushed, as my biggest concern for a game with 300 achievements was if it would be horrible cpu intense?

c++ cant handle one million of if-statements a second.
c++ can handle hundreds of billions of if-statements a second.
Even if the code would evaluate all of those achievenents every frame, it still wouldn't hurt performance. AT ALL.

Luckily, it doesnt. Kill-achievenents only need to be evaluated after someone has been killed, for instance.
When you are up to your neck in shit, keep your head up high
zombie@computer
Forum Goer Elite™
Forum Goer Elite™
 
Joined: Fri Dec 31, 2004 5:58 pm
Location: Lent, Netherlands

Return to Programming

Who is online

Users browsing this forum: No registered users