Sign In Register

How can we help you today?

Start a new topic

Team leaderboard based on Sum of Players' max score

I am not able to configure a team leaderboard in a desired way. I would appreciate all possible help.

I want it to be based on sum of each member's max score. Not the sum of all scores.

Player1 and Player2 are in the same team called Team1.
Player1 scores 100, Player2 scores 10 --> Team score should be 110 now.
Then Player1 scores 200 --> Team score should be 210 now.

Any configuration that I am trying gives at the end 310 or 200 which is not what I want. Is it possible to achieve in GameSparks?

Can anyone help me with this?


Hi Maciej,

I think for this setup you'd need two leaderboards. One to track the player's max score and another to track the team score. The way this would work would be:

- Player/client sends score event to the player max score leaderboard (Maximum calculation type).

- This will trigger a 'NewHighScoreMessage'.

- In the NewHighScoreMessage script retrieve the score and post to the team leaderboard via SparkRequests (Sum calculation type).

This way the Team's Sum leaderboard will only be triggered when a player has beaten their previous high score. If you have any further questions or run into any difficulties implementing this please let us know.



That way Team's Sum will be increased by a player new high score. I would like to increase it by the difference between a new and an old high score of this player.

I think that the only way is to make a Team leaderobard based on Sum as you suggested with a custom event named for example "AddPointsToTeam". When a player submits a new highscore I have to calculate the difference in a cloud script and use the "AddPointsToTeam" event to submit a difference to the Team leaderboard.
I will also have to use the "AddPointsToTeam" with a player's highest score when a player joins a team. And respectively substract points when he leaves.

Now I see it is doable. I just thought there is a simpler way. For me it is one of a desired behaviour of a team leaderboard to be based on members' highscores. For example in the game like Tibia to calculate the current strength of a team based on the sum of members' levels. Or, if I am not mistaken, the Toon Blast calculates it that way too.


Hi Maciej,

You could implement this using the NewHighScoreMessage script to store the player's previous high score in their scriptData. Each time the message is triggered, check if the player has a previous high score saved and retrieve it before updating it with the new score. Then use the difference between the two to update your team leaderboard.



Login to post a comment