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
C
Customer Support
said
almost 3 years ago
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".
This Segments documentation should help you achieve this.
Thanks,
Oisin
E
Eric Moncada
said
almost 3 years ago
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
Customer Support
said
almost 3 years ago
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
E
Eric Moncada
said
almost 3 years ago
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
N
Njal Frode Lie
said
almost 3 years ago
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!)
Eric Moncada
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
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
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Eric,
This Segments documentation should help you achieve this.
Thanks,
Oisin
Eric Moncada
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
Customer Support
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
Eric Moncada
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
Njal Frode Lie
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
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2338 topics