Sign In Register

How can we help you today?

Start a new topic
Answered

Player statistics and Achievements

I'm trying to create achievements and trigger them based on player statistics (Kills, Wins, Damage etc) what would be the best approach for this? Also I would like to display achievements progress but I'm not sure how to do it.


Suggestions?


Thanks


Best Answer

Hi Liam,


I ended up using player script data and generating statistics based on a list setup in properties which works perfectly fine but I have to maintain that list to make sure it does have the right values. Now I was working with partioned leaderboards and I was just wondering if would be a good idea to use that for statistics like have a single leaderboard called TotalScore for example then:


TotalScore.statType.pvp.statName.kills

TotalScore.statType.pvp.statName.damage

etc etc


Then based on this I could easily trigger achievements based on those values, then for listing statistics to players I could just call LeaderboardsEntriesRequest and parse it accordingly.


What do you think? Is this a good idea? I'm a bit worried about the amount of API calls?


Anyone?



Hi Hjupter,


Your best bet would be to track these values manually. You could create a document for a player to store these statistics. Then when you are updating them, check to see if the player has hit the required number. So if the kill value has hit 10 use SparkPlayers addAchievement method to add the specific achievement. You could then retrieve this document and use it to display the values in the game. Does that make sense ? You could also store and them in a players scriptData. Does that sound like it would work for you ? Let us know if you have any further questions.


Thanks,

Liam



Hi,


Yes that's kinda what Im doing right now just was wondering is there was a better way I came from PlayFab  and BrainCloud and it have a page where you can define player statistics then those get listed in achievements so they can be triggered automatically, would be great if you guys add this feature. 


Also the other question was how to display progress, I guess I could have the max for each achievement into that document but that to be honest its a bit of pain. Why dont just expose the filter value of trigger data? I could be using that to track the achievement progress.


Thanks

Answer

Hi Liam,


I ended up using player script data and generating statistics based on a list setup in properties which works perfectly fine but I have to maintain that list to make sure it does have the right values. Now I was working with partioned leaderboards and I was just wondering if would be a good idea to use that for statistics like have a single leaderboard called TotalScore for example then:


TotalScore.statType.pvp.statName.kills

TotalScore.statType.pvp.statName.damage

etc etc


Then based on this I could easily trigger achievements based on those values, then for listing statistics to players I could just call LeaderboardsEntriesRequest and parse it accordingly.


What do you think? Is this a good idea? I'm a bit worried about the amount of API calls?


Anyone?


Login to post a comment