Sign In Register

How can we help you today?

Start a new topic

Multiple Leaderboards

Hello, i was wondering how to achieve multiple leaderboard creation based on a specific value given.


I have multiple collections that store various server databases that correspond to the "server" that the player is active on.


For example:

image


The issue is i need a leaderboard that is organized by players gold, BUT each player can be associated with multiple servers, and thus i need multiple of these leaderboards.


I've been following the partition leaderboard setup and got something like this:

image


The problem being, the player might be active on 3 servers, iD 1, 3, and 7. The players gold on each server might be 2100, 400, and 9000.


Now there might be thousands to millions of players on a given server. By this setup the player might not register on each server, and only on the most recent.


Whats the best way to have multiple of these leaderboards based on players gold for each server? Keep in mind there might be hundreds of servers over time (1 week release per)


These are the links ive been addressing for most of my information:

https://docs.gamesparks.com/tutorials/social-features/creating-a-leaderboard.html

https://docs.gamesparks.com/documentation/configurator/leaderboards/running-totals.html

https://docs.gamesparks.com/documentation/configurator/leaderboards/

https://docs.gamesparks.com/tutorials/social-features/partitioning-leaderboards.html


this last link is very similar to how i currently have it setup:

https://support.gamesparks.net/support/discussions/topics/1000075101



If i was hard to follow, picture what i want being partitioning, but rather than the storage being like this:

LEADERBOARD

"playerID 1"

"serverID" : 1

"gold" : 200


"playerID 2"

"serverID" : 1

"gold" : 200


"playerID 3"

"serverID" : 1

"gold" : 200


It would be something more like this: 

LEADERBOARD_1    //The server id is stored in the leaderboard name, this is the major difference

"playerID 1"

     "gold":200

"playerID 2"

     "gold":100

"playerID 3"

     "gold":50


The second option allowing for multiple leaderboard support


Hi Dylan,


Partitioning would be the way to go here. So option 2 where you are grouping the server attribute and passing it in through the score event would work. The score would be posted to a leaderboard each time a unique "server" string was passed in. Passing the score in with an existing "server" name would update the score for that partition. Does that make sense ? 


Regards,

Liam

But wouldn't the multiple "servers" per player still be an issue?

Because each player can be on multiple "servers" resulting in varying gold per server.


This is what i currently have setup:

The event

image


The leaderboard:

image



The result:

image


Issue with the result, what if the player was on server 2 as well as server 1? And the gold on server 2 was 20000.


Wouldn't the player only exist or be found on the most recent server? Not both/all of them?

Hi Dylan,


The player would be on any leaderboard that they provided a unique server string attribute for. So if on server "1" the posted 1250 like above. They could also post 20000 on server "2". As it's a separate partition the running totals are separate also. Is this the functionality you require here ?


Regards,

Liam

Yes, that is exactly it!

So far ive thought of 2 ideas on how to make this work, but both are un-prefered.


1) Make a new event and leaderboard for each "server"

Advantages:

-Would meet requirements

Disadvantages:

-Resuslts in manual, weekly work

-Easy to make mistakes

-Would plug up the events section of the cloud code


2) Work with the current partition setup

Advantages:

-simple to implement

Disadvantages:

-Doesn't work as intended - players would only be recorded as their most recent server

-Probably would be poorly optimized, if a player wants to retrieve top 20, those positions might be 4, 1600, 1701, 1800, 9000 etc. when found in the leaderboard

-If a player has 2 accounts, one on an old server and one on a new server, and they are rank 1 and 400 respectively, other players would randomly see that player go missing making this option unacceptable


This is what i have thought of so far, but hopefully you have something better, because worst case i have to do option one which would be a pain :(

Hi Dylan,


For option 2. Players will post a score to a leaderboard based on what server value they pass in. So if they are on server 1,2 or 3 it willjust be up to you to identify which one they need to post to before the score is submitted so it will go to the correct partition. Does that make sense ? Why would a player have 2 accounts here ? 


Regards,

Liam

Yes it does make sense, but the resulting pictures above tell me that players probably wont be able to store multiple data, as if they can only store 1 server/data at a time opposed to multiple.


There are some games, such as Idle Heroes, who have weekly *server* releases. This helps to reduce progress gaps since this game revolves heavily on player 2 player competition. 


Reasons a player might have multiple accounts:

-Some people like to "start over" again. Many games have multiple save options and its basically to allow this to happen.

-Maybe a player gets his friend to get the game, they probably will create data on the new server so they can progress together.

-After a player learns the game mechanics, they might want to start over with this new knowledge in mind, resulting in less mistakes

-The longer the server is up (more are released), less players will be active, maybe they want to start anew to meet new people

Login to post a comment