Search code examples
androidiosparse-platformgoogle-play-servicesleaderboard

How to implement a leaderboard which automatically resets itself periodically?


I want to implement a leaderboard for my mobile game (iOS, Android) which will periodically reset after 2 weeks. The leaderboard will only contain top 100 players. After 2 weeks it will save the top 10 player IDs along with their scores in a database, clean all entries and will begin to receive new entries for the next 2 weeks. The whole process must be automated.

I need advise about which service to use and how to implement it in that service. I am looking into Parse, GameSparks, Google Play Game Services etc at the moment. The service must be available on both iOS and Android.


Solution

  • I'm not versed well enough with any of the services you mention to say if any of these provide the functionality you need, but it certainly is possible using custom software.

    The easiest way would be to have some sort of datastore (Redis for example), a thin API on top of it to provide any functionality you need, and then a script or program that is run every 2 weeks and saves/clears the leaderboard (you could do this with cron)