Sign In Register

How can we help you today?

Start a new topic

Team leaderboards based on points per active user

Hi,


I would like to create a team leaderboard that shows some kind of "score factor" per team: sum of points earned by members of this team, divided by the number of active players within that team (to give larger and smaller teams an equal chance). Is there a way to set this up purely via Leaderboards and Running Totals? E.g. set up a running total for points earned and one to track active players, and combine these somehow in one leaderboard.


A workaround I see would be:

  • Track total number of points per team in a custom collection
  • When points are earned by a member of this team, make the calculation in cloud code
  • Send an event with the resulting new "point factor" with default calc set to LAST
  • Set up a leaderboard that shows this value.
But I'd rather use a solution that doesn't require a custom collection and cloud code calculation

Thanks!


Hi Ivo,


A solution to this would likely require some cloud code to work. You could achieve this by wrapping your team score event inside of another one so that you could pass the score value in, then get the latest team average score, add the new one on, do your calculations and then submit the score using SparkRequest to send the score event with the updated total. Does that make sense ? If you have any further questions just let us know.


Regards,

Liam

Thanks Liam for the suggestion, not sure I follow completely, does this effectively mean I don't need a custom collection to store the "latest team average score" in (or how do I "get the latest team average score")?


I ended up using the workaround as I described, works like a charm, only drawback is that now leaderboard resets also mean I have to reset the custom collection.

Login to post a comment