Skip to content

Leaderboards ~ Functionality

Greg edited this page Apr 28, 2025 · 3 revisions

Chigame Leaderboards Functionality

Core Functionality (MVP – Next 4 Weeks)

Backend/API

  • Game-specific leaderboards: Implement a separate leaderboard for each game (e.g., Checkers, Wordle). Store metrics per game rather than a single global table.
  • Default and custom metrics: Support the following default metrics: Wins, Games Played, and Time Spent. Provide a way for developers to define additional metrics per game (e.g., “fastest solve”, “current streak”). Use a flexible schema (e.g., a Metric model) so games can activate/deactivate counters via admin settings.
  • Result submission endpoint: Create an API (e.g., REST via Django) to submit completed game results. Each submission would include player ID, score/time, win/loss outcome, and any relevant metadata. Upon receipt, update the player’s counters and scores for the relevant game.
  • Ranking logic: For the MVP, use straightforward ranking (e.g., total wins or lowest time). Ensure players are only ranked after a minimum number of games to avoid fluke scores.
  • Leaderboard retrieval endpoint: Work with API team to define endpoints to fetch leaderboard data by game and metric (e.g., /api/leaderboard/checkers?metric=wins). Allow parameters for sorting, paging, and filtering (e.g., by friends or region).
  • User authentication & profiles: Tie leaderboard entries to authenticated user profiles. Include player ID and possibly a display name/avatar.
  • Admin interface: Use Django’s admin or a simple config page so devs can activate which metrics are collected and visible for each game.

Frontend

  • Leaderboard display per game: Build a page/view for each game’s leaderboard. Show a ranked list of players for the selected metric. Each row should include rank, player name (linking to profile), and score/value.
  • Metric selector UI: Provide a dropdown or tabs to switch between metrics (e.g., Wins, Games Played, Time Spent). When a developer adds a new metric, it should appear here automatically.
  • Sorting and filtering controls: Include UI controls for common filters. For MVP, allow toggling between Global and Friends leaderboards. Allow sorting by different stats if applicable (e.g., sort by win percentage or games played).
  • Player stats and profile linking: Display the current user’s rank/score on the leaderboard. Clicking on any player should show their stats (games played, wins, etc.), either in a tooltip or on their profile page.

Stretch Goals / Future Functionality

Backend/API

  • Expanded scopes & social integration: Integrate friend lists or regional grouping (e.g., filter by friends or by region/country).
  • Achievements/Badges: Work with Achievements team to award badges or titles (e.g., Top 10%, Expert Player) based on leaderboard rankings.
  • Analytics & insights: Track and expose stats like win/loss streaks, rank trends, or player improvement over time.

Frontend

  • Interactive visualizations: Add charts for each player (e.g., rank history, games over time).
  • Customization UI for games: Build an admin frontend where game teams can name and configure metrics.
  • User profile enhancements: Embed leaderboard info on user profiles (e.g., "Top 5% in Checkers").

Sources:
Inspiration and ideas adapted from Board Game Arena (uniform leaderboards), Streamworks (customizable metrics), and Steam leaderboards (friend filtering, social features).
Reference: Chigame Wiki – Leaderboards Research

Clone this wiki locally