Overview
BeatLeader is an alternative competitive platform for Beat Saber that provides detailed score analytics and replay capabilities. ScoreSaber Reloaded integrates with BeatLeader to offer enhanced score statistics, hand accuracy tracking, and replay storage for tracked players.What is BeatLeader?
BeatLeader provides:- Detailed score statistics and breakdowns
- Hand accuracy tracking (left/right hand)
- Full combo (FC) accuracy calculations
- Score improvement tracking
- Replay file storage and viewing
- Advanced performance metrics
How SSR Integrates
API Service
SSR uses a dedicated BeatLeader API service with rate limiting:common/src/api-service/impl/beatleader.ts:8-16
Score Stats Endpoint
The service fetches detailed score statistics from BeatLeader’s CDN:common/src/api-service/impl/beatleader.ts:6-38
Data Synchronized
Score Statistics
BeatLeader provides comprehensive score statistics that SSR tracks for each play:- Base metrics: Score, accuracy, misses
- Hand accuracy: Separate tracking for left and right hand
- FC accuracy: Theoretical accuracy if full combo was achieved
- Miss breakdown: Missed notes, bad cuts, bomb hits, wall hits
- Pauses: Number of pauses during the play
- Full combo status: Whether the score was a full combo
backend/src/service/beatleader.service.ts:105-128
Score Improvements
When a player improves their score, BeatLeader tracks the improvement delta:backend/src/service/beatleader.service.ts:130-147
Replay Storage
Automatic Replay Archival
SSR automatically downloads and stores replays for:- All scores from players with replay tracking enabled
- All top 50 global scores
backend/src/service/beatleader.service.ts:153-173
Replay Access
Replays can be accessed through the API:backend/src/controller/beatleader.controller.ts:27-46
API Endpoints
Score Stats
Fetch detailed score statistics for a specific score:scoreId(number): The BeatLeader score ID
ScoreStatsResponse containing current and previous score statistics
backend/src/controller/beatleader.controller.ts:12-26
Replay Download
Redirect to the raw replay file:scoreId(string): Score ID in format{id}.bsor
Score Comparison
SSR can compare a player’s current score with their previous attempt:backend/src/service/beatleader.service.ts:217-242
Tracking Criteria
BeatLeader scores are only tracked for players who are already being tracked in the SSR database. This prevents storing data for every BeatLeader player globally.
backend/src/service/beatleader.service.ts:81-97
Caching
BeatLeader data is cached to improve performance:backend/src/service/beatleader.service.ts:64-74
Discord Integration
Failed replay saves are logged to Discord for monitoring:backend/src/service/beatleader.service.ts:165-169
Benefits
Integrating with BeatLeader provides:- Enhanced Analytics: Detailed hand accuracy and miss breakdowns
- Replay Preservation: Long-term storage of replay files
- Score Improvement Tracking: Track progress over multiple attempts
- Full Combo Analysis: See what accuracy you could achieve with FC
- Historical Data: Compare current performance with past plays