playMaker

Author Topic: How do you approach an unlock/reward system?  (Read 1741 times)

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
How do you approach an unlock/reward system?
« on: October 04, 2017, 08:39:03 AM »
Hi

I am making a mobile game with an unlock system that I want to have work with a pretty broad set of things to unlock.

For instance:

Level 5 - Unlock a cow character

Level 7 - Reward with some gems

Level 9 - Reward with a power up

Level 10 - Reward with an owl character


So the problem being that these are not all just simple game objects I can add in.
What I was thinking is using an Array and put a string in at each level with the name of the thing I want to use as a reward. "CowCharacter_01" "Gems_X100" for instance, and then have a rewards manager that figures out what each of these strings relate to, although that feels like it could get pretty messy pretty quickly.

How do other people approach this type of thing?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: How do you approach an unlock/reward system?
« Reply #1 on: October 04, 2017, 09:42:59 PM »
Hi,
My suggestion comes just out of my head so it is not tested or anything.

I would have an array that holds the kind of reward for each level.
That array would be a string array.

level 05 would be "CharacterReward" on
level 06 would be "No Reward"
level 07 would be "GemReward"
level 08 would be "No Reward"
level 09 would be "PuReward"
level 10 would be "CharacterReward"

Then use a "string switch" so you know which kind of reward you need to give.

Or use a "Send Event By Name and use some Global transitions

Then have another array for each kind of reward get the 1st one on the list, give the reward and remove it from the list.

Or if you want specific things for each Level you could make templates,
Drop each template into the array (on the variable select 'Array Type' "object" then set 'object type' to "FsmTemplate")
Then get "Run Template FSM" (Works the same as run fsm, but you can use a variable)

You could then reduce your template amount for example :

On the GemReward Template :
Check for the level, then depending on the level give X amount of gems.

This way you could use the same template on each level in the array that should give gems.

There are probably many other ways you could do this, but these just came up in my head :)

jasperPT

  • Full Member
  • ***
  • Posts: 115
  • I am a VFX Animator teaching myself to make games
Re: How do you approach an unlock/reward system?
« Reply #2 on: October 11, 2017, 11:59:14 AM »
Hey thanks for the reply, I have put some of this info into my system and is quite useful!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7614
    • jinxtergames
Re: How do you approach an unlock/reward system?
« Reply #3 on: October 11, 2017, 12:06:02 PM »
Hi,
Nice!

Maybe you like to share what you did :) (for others that would stumble on this thread)