Implementing Achievements

waelouaijan

  • Posts: 78
Hi There,

I have been contemplating and trying the best method to implementing in-game achievements with a correlation to a multiplier, without increasing the load greatly. Basically, a simple example would be....

if [score(Game attribute)] = 1000
set Multiplier (game attribute) = Multiplier + 1

if [Score]  = 2000
set Multiplier (game attribute) = Multiplier + 1

etc... etc...

The problem is... I only want to multiplier to add the score had been achieved once, rather than it adding to the multiplier in each session.

I thought to include a boolean attribute which sets to true once the ability has been completed, and add in if boolean = false add 1 to the multiplier. But by doing that and having it remain throughout the course of someones adventure with this game I would have to create a boolean-game attribute to memorize what has already been accomplished.

The larger problem is that there are 25 achievements (meaning the multiplier reaches x25), and I believe, creating 25 dedicated boolean-game attributes may just cause too heavy a load for the game.

Just to clarify, the reason I am not designating a fixed multiplier number for each achievement is because there is no linear growth to the achievements... ie: which ever is completed first simply adds to the multiplier.

Would really appreciate any help I could get.

Best,

Will

Meestar

  • Posts: 654
Hi There,

I have been contemplating and trying the best method to implementing in-game achievements with a correlation to a multiplier, without increasing the load greatly. Basically, a simple example would be....

if [score(Game attribute)] = 1000
set Multiplier (game attribute) = Multiplier + 1

if [Score]  = 2000
set Multiplier (game attribute) = Multiplier + 1

etc... etc...

The problem is... I only want to multiplier to add the score had been achieved once, rather than it adding to the multiplier in each session.

I thought to include a boolean attribute which sets to true once the ability has been completed, and add in if boolean = false add 1 to the multiplier. But by doing that and having it remain throughout the course of someones adventure with this game I would have to create a boolean-game attribute to memorize what has already been accomplished.

The larger problem is that there are 25 achievements (meaning the multiplier reaches x25), and I believe, creating 25 dedicated boolean-game attributes may just cause too heavy a load for the game.

Just to clarify, the reason I am not designating a fixed multiplier number for each achievement is because there is no linear growth to the achievements... ie: which ever is completed first simply adds to the multiplier.

Would really appreciate any help I could get.

Best,

Will

Well, if you don't want to make 25 booleans, you can make a game attribute list.  Then you add 25 falses to the list and when an achievement has become true, set the corresponding list index to true.
PM me if you require help.  I'm always glad to help out!

waelouaijan

  • Posts: 78
Hi Meestar,

That sounds like a great idea, and serves my purpose better than I thought. Though, I haven't worked much with lists, and Stencylpedia doesn't go into lists with much detail. I tried searching the web for a tutorial, but to no avail.

I was able to create the lists without any problems and they work like a charm, but I am facing one minor issue. I was wondering if there is a way to setup the list to check how many of the items in the list are true and set that amount as the multiplier. Basically, what I am not know how to do is block in the following logic:

- When (Scene) created
- [check how many items have been set to true] as number
- set multiplier = multiplier + (1x[check how many items have been set to true] as number)

I would really appreciate if you could show me how to block that in. I really appreciate the help.

Best,

Will

flyingninja77

  • Posts: 30
You can also start with an empty list.  When you get an achievement, it adds the Achievement name to the list (this serves a double purpose) and then have some code that adds +1 to the multiplier for each item in the list.

So if you ever wanted to check which achievements you had reached, you could just see if its name is in the achievement list.  If not, then you haven't gotten it yet (that's what I mean by it serves a double purpose).  The more I work with lists, the more I find how useful they can be.

Meestar

  • Posts: 654
Hi Meestar,

That sounds like a great idea, and serves my purpose better than I thought. Though, I haven't worked much with lists, and Stencylpedia doesn't go into lists with much detail. I tried searching the web for a tutorial, but to no avail.

I was able to create the lists without any problems and they work like a charm, but I am facing one minor issue. I was wondering if there is a way to setup the list to check how many of the items in the list are true and set that amount as the multiplier. Basically, what I am not know how to do is block in the following logic:

- When (Scene) created
- [check how many items have been set to true] as number
- set multiplier = multiplier + (1x[check how many items have been set to true] as number)

I would really appreciate if you could show me how to block that in. I really appreciate the help.

Best,

Will

When created:
For each item in list Achievements
    if item
       increment true count by 1
PM me if you require help.  I'm always glad to help out!

waelouaijan

  • Posts: 78
Hi Again,

So after a full day of trial and error and almost ripping my hair out this is what I came to in terms of code blocks:

 True/False Method
Here for some reason the multiplier is completely ignoring the blocks. So it doesn't seem to be adding anything whether true or false (this is attached as a behavior to the game over screen).




Adding an item to the list
Here the behavior is also attached to the game over screen, though, it registers the first multiplier change only, afterwards it stops registering them. (ie:if I unlock 500 and get the times 2 multiplier, when I get a score of 2000 it still registers the multiplier as 2.)



Please note, that in the multiplier calculation at the bottom I had to introduce the if [Multiplier] = 1, since it's initial value is equal to 1, and if I do not introduce this rule then each time the character dies, the multiplier will have +1 added to it.

I would really appreciate it if someone could tell me where I have gone wrong, because I cant seem to figure it out. I really appreciate all the help I have received so far. Thanks a bunch.

Best,

Will

dtrungle

  • Posts: 1938
Your Add Item To List behavior, inside Do After 0.1, simply change it to

Set MULTIPLIER to (1 + Number of Items in MISSIONLIST)

waelouaijan

  • Posts: 78
Oh Gosh, thanks a bunch dtrungle. Don't I feel like the idiot :P

it worked like a charm!!

PROBLEM SOLVED:)