Sign In Register

How can we help you today?

Start a new topic
Answered

Leaderboard partition question

Hi, I have a general leaderboard for my game, and I would also like to display it per country.

I tried to partition the leaderboard on the country, which works well, but in that case I'm not able to retrieve the general one, I can only get the leadeboard for a given country.


Any advice for that ?


Thanks


Best Answer

Hi Eric,


What you can do here is have your Leaderboard Country Partition setup in place, then have a separate Global Leaderboard which would feed off the same running total but only use the score attribute. Using your example if you had an Score event set up with a "score" and "country" attributes like below you could achieve this.



Now set up your Country Leaderboard like below. Here we are telling the Leaderboard to create a new partition each time a new Country is passed in via the event.



Finally set up the Global one like this.



The important thing here is that the Global Leaderboard is only using the score attribute so will contain all of the scores posted to any of the County Partitions. So with this setup in place I logged two scores, one from "IE" and one from "UK". On the Irish partition I posted a score of 70 (check image below for reference) and on the UK one I posted a score of 60. Now navigate to the Manage Screen and click on the Leaderboard tab to review the results.



As you can see the Global Leaderboard will contain both scores and no country info as it's not using the country attribute at all.



Let me know if this helps and if you have any further questions. Just so you know the Global Leaderboard has no partitions so will always be retrievable with the shortCode "LB_GLOBAL". To retrieve partitioned Leaderboards you include the partition data with the shortCode. For the UK one it's "LB_COUNTRY.country.UK".


Thanks,

Liam



Hi Eric,


This Segments documentation should help you achieve this.


Thanks,


Oisin

Sorry I don't get it.

I understand segments, but don't see how they can fit with my need.

Also read this post : https://support.gamesparks.net/support/discussions/topics/1000063309


Let's imagine I have

- UserA - FR - 67 points

- UserB - UK - 60 points

- UserC - FR - 50 points


I would like to retrieve the full leaderboard

1) UserA - 67 points

2) UserB - 60 points

3) UserC - 50 points


And also FR leaderboard :

1) UserA - 67 points

2) UserC - 50 points


The solution I see for the moment is to create 2 identical leaderboards, one for global and another partioned on the country.


Thanks



Answer

Hi Eric,


What you can do here is have your Leaderboard Country Partition setup in place, then have a separate Global Leaderboard which would feed off the same running total but only use the score attribute. Using your example if you had an Score event set up with a "score" and "country" attributes like below you could achieve this.



Now set up your Country Leaderboard like below. Here we are telling the Leaderboard to create a new partition each time a new Country is passed in via the event.



Finally set up the Global one like this.



The important thing here is that the Global Leaderboard is only using the score attribute so will contain all of the scores posted to any of the County Partitions. So with this setup in place I logged two scores, one from "IE" and one from "UK". On the Irish partition I posted a score of 70 (check image below for reference) and on the UK one I posted a score of 60. Now navigate to the Manage Screen and click on the Leaderboard tab to review the results.



As you can see the Global Leaderboard will contain both scores and no country info as it's not using the country attribute at all.



Let me know if this helps and if you have any further questions. Just so you know the Global Leaderboard has no partitions so will always be retrievable with the shortCode "LB_GLOBAL". To retrieve partitioned Leaderboards you include the partition data with the shortCode. For the UK one it's "LB_COUNTRY.country.UK".


Thanks,

Liam


Hi Liam,


Thanks for this detailed answer, having 2 leaderboards (one global and one portioned) is definitely the way to go in that case.


Best,

Eric

Hello Liam,


Thanks for your detailed answer to Eric.


Do you think you could take the time to expand your example to also including city?


So, it would be:

- a global leaderboard

- one for each country a person comes from, created dynamically

- and one for each city in a country, created dynamically


Thank you very much 

(and, let me know if I should create a new thread for this, instead of replying inside of an answered thread. Thanks!)


Best,

Njal



Login to post a comment