Score values on players), which is part of the Challenge Spec.
Named Metrics Model
Scoring uses a named-metrics model. Each strategy declares its own metric keys and updates player scores after each game. This allows different strategies to coexist without conflicting — each writes to its own namespace.How It Works
- A game ends — the challenge operator sets final scores and optionally emits attributions.
- The arena constructs a GameResult from the session’s final state.
- Each applicable ScoringStrategy receives the result and incrementally updates its ScoringEntry values in the store.
- Leaderboard endpoints serve the computed scores.
Scoring Endpoints
GET /api/scoring
Global leaderboard across all challenge types.
Response 200:
404 if scoring is not configured.
GET /api/scoring/:challengeType
Per-challenge scoring, grouped by strategy.
Response 200:
404 if scoring not configured or challenge type unknown.
GET /api/stats
Global and per-challenge statistics.
Response 200:
Related
- Data Types —
GameResult,ScoringStrategy,ScoringEntry,MetricDescriptor - scoring/README.md — built-in strategies and how to write new ones