Sign In Register

How can we help you today?

Start a new topic
Answered

Display player 'level' in a leaderboard

Hello everyone,

I'm new to GameSparks and had a question about leaderboard entries.

What I want to achieve is a leaderboard that displays a 'level' for each player entry. I imagine I can use virtual goods to keep track of the level a player is. (And the level would be driven by XP).

Example:

Name   Lvl   Score
1 player1 4  824245
2 player3 3 42455
3 player5 2 3435

What would be the best way to go about it? Tried searching but I can't seem to find anything related. I'm using Unity and C#. Thanks!


Best Answer

Hi Bart,


To add a field to your leaderboard for display purposes only, you'd need to add an attribute for it to the event you use to update your leaderboad, setting it's 'Default Aggreation Type' to 'Supplemental'. You'll also need to add this attribute to your Leaderboard's fields.


If the player's level is merely a number you wish to store against each player I'd recommend using the player's scriptData to store it.


Regards,

Vinnie


Answer

Hi Bart,


To add a field to your leaderboard for display purposes only, you'd need to add an attribute for it to the event you use to update your leaderboad, setting it's 'Default Aggreation Type' to 'Supplemental'. You'll also need to add this attribute to your Leaderboard's fields.


If the player's level is merely a number you wish to store against each player I'd recommend using the player's scriptData to store it.


Regards,

Vinnie

Hi Vinnie,

Thanks for your reply. I think I've got it working. I've used an attribute 'Level' set to Last. Because when a player levels up, it should display the player's current level on all leaderboards.

Using the scriptdata for a player could cause a lot of server load if it has to retrieve every value from a player for every leaderboard request, or shouldn't I worry about this? It would be a little cleaner I think.

Bart

Login to post a comment