My Performance
User analytics, filtering, and KPI dashboard
GET
Authenticated
/app/performance.html
Provides a full analytical view of a user's performance across finalised games, including KPIs, filters, and event-level scoring.
Purpose
- Summarise player performance
- Provide multi-dimensional filtering
- Break down scoring by event type
- List all filtered games
Only finalised games are included. [oai_citation:0‡performance.html](sediment://file_000000001a647243ae25b3bb05ba5663)
Data sources
| Source | Purpose |
|---|---|
games/list.php |
Base dataset (all games) |
games/play_state.php |
Event-level scoring data |
UI structure
- Top navigation bar (standardised)
- Filters panel
- KPI summary cards
- Event-type scoring breakdown
- Games table
Filters
| Filter | Description |
|---|---|
| Opponent | Filter by opponent name |
| Scenario | Filter by scenario |
| My race/faction | Player’s army |
| Opponent race/faction | Opponent army |
| Include archived | Toggle archived games |
Filters are applied client-side after initial load. [oai_citation:1‡performance.html](sediment://file_000000001a647243ae25b3bb05ba5663)
KPI calculations
| KPI | Logic |
|---|---|
| Games played | Count of filtered finalised games |
| Win / Loss / Draw | Based on result or score difference |
| Avg degree of victory | Mean of (my_score − opp_score) |
| Avg points scored | Mean of my_score |
Result determination
- Uses explicit
resultfield if available - Fallback:
- Win: diff > 100
- Loss: diff < -100
- Draw: otherwise
This ensures backward compatibility with incomplete data. [oai_citation:2‡performance.html](sediment://file_000000001a647243ae25b3bb05ba5663)
Event scoring breakdown
- Fetches events per game via
play_state - Filters events by player side
- Aggregates:
- Total points per event type
- Average per game
Uses cached event map to avoid duplicate API calls. [oai_citation:3‡performance.html](sediment://file_000000001a647243ae25b3bb05ba5663)
Data flow
- Load all games via API
- Filter to finalised
- Populate filter dropdowns
- Apply client-side filters
- Render:
- KPIs
- Games table
- Event breakdown
Performance considerations
- Client-side filtering (fast, but scales with dataset)
- Event data fetched per game (potential bottleneck)
- Caching via
EVENTS_BY_GAME
This design trades API simplicity for frontend load cost. [oai_citation:4‡performance.html](sediment://file_000000001a647243ae25b3bb05ba5663)
Known risks
- N+1 API calls for event data
- Large datasets may impact performance
- No pagination
Future improvements
- Move aggregation to backend (API endpoint)
- Add pagination / lazy loading
- Pre-aggregate KPIs in DB
- Cache event summaries per game