Progress Achievements

Started by knucracker, February 27, 2014, 01:56:02 PM

Previous topic - Next topic

knucracker

Progress achievements are associated with a stat.  When that stat hits a value, the achievement is awarded.  Along the way steam will show how far along you are with a progress bar.  Take for instance "ACH_14   Forty-Niner   Collected 100 AoO in Prospector Zone".  For this there is a stat that goes from 0 to 100.  Once at 100, you get the achievement.

Now, the question is how to store this stat.  The best way seems to be to store the stat at steam and to let that be the canonical count.  But what about people who have been playing the game already?  Welp, my thinking is that if the steam stat is 0 and your local count (as stored in you local game you have already been playing) is greater than 0, then I will set the steam stat to your local total.  If this is not true, then I simply increase the steam stat by 1 for each AoO that you collect.

The good things about this are that if you have already picked up 100 of these things, you will get the achievement as soon as you pick up one more.  So old timers aren't cheated out of their progress.  It also means that if you nuke your game or your hard drive crashes you won't lose your count when you reinstall (the steam stat becomes the value that matters once it is non-zero).

The bad thing about this is that your Steam stat and your local count can get out of sync.  If you play on two computers your steam stat for counting AoO will go up, but each computer will only have a count for each.  I don't think this is really much of a big deal, though.

Anyway, wanted to throw this out there as I now go and code it up in case there is something serious I've not considered.

Karsten75

I think the [STAT_AOO] = 0

[STAT_INHIBITORS] = 0

Could usefully be renamed to avoid confusion.  Maybe it's only confusing while you have debug statements printing them, but

Progress_Tormented
Progress_Prospector

Seems more understandable?

knucracker

Those are just the internal names I used.  Each stat also has a "Display Name" field I configure at steam.  I could be printing out that value as well...
But what is supposed to happen is there is someway via steam to create a stats display page on the community hub.  And presumably on that page the Display Name value will be shown.

stewbasic

Does this mean that, for example, collectors I've built pre-steam version should count towards achievements? If so, this is not what I observe. Only STAT_MISSIONSCOMPLETE seems to have carried over, everything else is 0. Maybe you didn't start counting these things until a recent version and this is expected, in which case nevermind.

knucracker

Correct, the build and destroy counts were only recently added in the steam version. So they will all start at 0.