Hello,
I’m looking to create a fairly responsive leaderboard of scores that needs to update as close to realtime as possible. Each player trying to get to the top of the leaderboard can submit multiple scores during the time the leaderboard is accepting scores (multiple times per hour/day) but I really only want to show the best attempt from each player on the leaderboard.
What is an efficient way to set up a realtime leaderboard that allows multiple submission per user but only returns the best per user that does not need to constantly search/filter for the best score from each player and replace worse scores with better scores with each submission?
My current solution includes a Score data type and Leaderboard data type in the Data section. The Score has a reference to the User and the point value for the score to sort by. Each time a score is submitted that may be worth considering to include on the leaderboard I am checking the scores currently on the leaderboard to remove any worse for that player than the one submitted (or if no other submission from that player exists) then I add the new score. This requires some fun searches/filtering that are costly/slow.
On a related note - Is there anyway to do a search for scores sorted by their point value, but only get one entry for each user? If so I think I could start to get away from needing a leaderboard type all together.