Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support leaderboard "scopes" #59

Open
Vrixyz opened this issue Aug 24, 2022 · 2 comments
Open

Support leaderboard "scopes" #59

Vrixyz opened this issue Aug 24, 2022 · 2 comments

Comments

@Vrixyz
Copy link
Contributor

Vrixyz commented Aug 24, 2022

Context

Sometimes in games, scoring systems can involve muiltiple leaderboards, where scores are:

  • Grouped by resource
    • speed to finish a level
    • wealth at the end
    • ...
  • Grouped by context
    • levels
    • a different leaderboard for each day
    • ranked play or "casual"
    • ...

Exact need

I would like to easily embed multiple leaderboards in my game.

Current workaround

We can create a lot of leaderboards and use different uuid+secret for each of our resource/context, but it becomes quickly a lot of code and error-prone.

Proposed solutions

Sub-Leaderboards

Add a tag to each score, which we could filter and rebuild any sub-leaderboard necessary, that could enable scores to exist in multiple sub-leaderboards

Pros

  • most modular for developers

Cons

  • scores can easily be hard to read if the filter is too complicated
  • easy to misuse with the wrong tag or filter ?

Collection of leaderboards

Current Leaderboard becomes a collection of leaderboard:

  • each one having their own string name, with an optional default one such as "main"
  • They are created lazily when a player needs one specific type.

Pro

  • developer-facing API can easily be adapted to support an optional "LeaderboardName" target

Cons

  • easily DDOSable ? (might be circumvented with wildcards of possible leaderboard names..?)
  • backend and administration UI to be reworked more heavily than sub-leaderboards
@mockersf
Copy link
Member

mockersf commented Aug 28, 2022

this can be simulated currently using the meta field when submitting a score: https://docs.rs/bevy_jornet/latest/bevy_jornet/struct.Leaderboard.html#method.send_score_with_meta

@Vrixyz
Copy link
Contributor Author

Vrixyz commented Aug 30, 2022

Seems good enough to me, next step is probably filtering via more complex queries but that should probably be another discussion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants