Scoreboard API — See yesterday's rank in daily leaderboards

Was talking with @Voxybuns about an in-dev game of theirs, and they had an idea of giving a player an in-game reward if they were first place in a leaderboard by the end of the day. Currently though, there's no real way to check for this kind of thing conveniently.

It would be cool to have a "rankYesterday" number included within a call for the player's personal best — if they submitted a score to a daily board on a given day, then their final rank at the midnight GMT changeover could be logged server-side for a day, and the game could snag that info if the player logged in to peek tomorrow.
If the player didn't submit any score on a given day, or they're trying to get their best for a non-daily board, then it could just return nil or somethin'.

For instance, using the example described above...you could have a daily competition where you play one round a day, submit to the global leaderboard, and then come back tomorrow — if your "rankYesterday" returned 1, then the game would know that you finished first place out of everyone globally yesterday, and could give you a local prize.

Could also be used for stat-keeping (at least, assuming that the player would be checking in every day to e.g. keep a streak) — then the game could know definitively what rank the player wound up in at the end of each day, and keep track of it locally for some cool game history.

3 Likes

Could be possible to have two boardIds that you ping-pong between each day?
Then you could calculate locally if it's passed the day marker?

edit: would also mean you can show the whole yesterday board if needed

Unfortunately I don't beliiiieve so? If you could have a board that could stick around for two days, then it'd probably be possible to just alternate between 'em with some silly epoch timing to determine whether to use the "even" or "odd" board. But unfortunately, right now you can only either have a leaderboard not clear at all, or have it clear every day indiscriminately. So both boards would be emptied at the changeover

1 Like