๐ฎ Sister Brawl โ Deep Architecture Audit#
Date: 2026-06-04 (updated from 2026-05-31)
Auditor: Hermes (OWL)
Scope: Full-stack audit โ frontend, backend, config, deploy, docs, fun audit v2
Game ID: sisterbrawl (alias: sister-brawl)
๐ Table of Contents#
- Executive Summary
- Architecture Overview
- Frontend Game Code
- Nakama Match Handler
- K8s & Monitoring Deploy
- Known Issues & Fixes
- Perfection Cycle โ What’s New
- Operational Runbooks
- Doc Map
1. Executive Summary#
| Area | Status | Notes |
|---|
| Game Config | โ
Solid | funday-plugin.json complete, allowSoloAutostart: true |
| Frontend Components | โ
Complete | ~2,500 LOC across 14 files (incl. TutorialOverlay) |
| Game Store | โ
Complete | 507 LOC, Svelte 5 runes, prediction, interpolation, damage numbers, progression |
| Nakama Handler | โ
Complete | ~1,491 LOC, 60Hz, physics, combat, replay, spectating, progression, character specials |
| Metrics | โ
Complete | 4 metrics, Grafana, 3 Prometheus alerts |
| K8s Manifests | โ
Complete | ConfigMap, NetworkPolicy, PDB, CronJob, Service + sidecar |
| Dockerfile | โ
Complete | Multi-stage, metrics scripts |
| Live Rendering | โ
Working | Solo mode + MP, 2D canvas at 1280ร493, 60fps |
| Fun Score | ๐ก 3.4/5 | Up from 2.8 โ see Fun Audit v2 |
2. Architecture Overview#
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Browser (Client) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Game.svelte (~1,285 LOC) โ โ
โ โ โโโ Threlte <Canvas> โ 3D arena + entities โ โ
โ โ โโโ 2D Canvas fallback (solo/headless) โ โ
โ โ โโโ gameStore.svelte.ts (507 LOC) โ โ
โ โ โ โโโ Client-side prediction + reconciliation โ โ
โ โ โ โโโ Entity interpolation (lerp) โ โ
โ โ โ โโโ Hit-stop (freeze-frame on big hits) โ โ
โ โ โ โโโ Floating damage numbers โ โ
โ โ โ โโโ Progression data (XP/levels) โ โ
โ โ โโโ spectatorStore.ts (175 LOC) โ โ
โ โ โโโ audio.ts (250 LOC) โ layered music + 14+ SFX โ โ
โ โ โโโ particleSystem.ts (80 LOC) โ โ
โ โ โโโ screenShake.ts (119 LOC) โ โ
โ โ โโโ UI: CharacterSelect, HUD, Results, Replay โ โ
โ โ SpectatorViewport, TutorialOverlay (NEW) โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Nakama WebSocket โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
โผ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ Nakama Server (K3s) โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ match_handler.ts (~1,491 LOC) โ โ
โ โ โโโ 60Hz tick โ input โ physics โ broadcast โ โ
โ โ โโโ 6 character definitions + balance โ โ
โ โ โโโ Character-specific specials (NEW) โ โ
โ โ โ โโโ Ember: Fireball + burn DOT โ โ
โ โ โ โโโ Frost: Ice Wall obstacle โ โ
โ โ โ โโโ Volt: Dash Strike AoE โ โ
โ โ โ โโโ Shade: Teleport Crit โ โ
โ โ โ โโโ Terra: Ground Pound stun โ โ
โ โ โ โโโ Aqua: Water Shield reflect + heal โ โ
โ โ โโโ Kill threshold match end (10 kills) โ โ
โ โ โโโ Dramatic finish (last 10s slow-mo) โ โ
โ โ โโโ XP/Level progression (Nakama storage) โ โ
โ โ โโโ Replay recording (10 Hz, Nakama storage) โ โ
โ โ โโโ Free camera spectator mode โ โ
โ โ โโโ 3 RPCs: replay, metrics, spectate โ โ
โ โ โ โ
โ โ metrics.ts (187 LOC) โ โ
โ โ โโโ 4 Prometheus metrics โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โ Metrics Sidecar (Python, :9101) โ โ
โ โ โโโ Polls RPC โ serves Prometheus text โ โ
โ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
3. Frontend Game Code#
File Inventory#
| File | LOC | Purpose |
|---|
src/Game.svelte | ~1,285 | Main game โ Threlte canvas, 2D fallback, platform bus, input loop, hit-stop, damage numbers |
src/stores/gameStore.svelte.ts | 507 | Reactive store โ prediction, interpolation, replay, hit-stop, damage numbers, progression |
src/stores/spectatorStore.ts | 175 | Spectator mode โ free camera, interpolation |
src/lib/audio.ts | 250 | Procedural Web Audio โ layered music (100โ140 BPM ramp), 14+ SFX, volume persistence |
src/lib/particleSystem.ts | 80 | Data-only particle pool (200 max) |
src/lib/screenShake.ts | 119 | Stackable screen shake, quadratic decay |
src/components/CharacterSelect.svelte | 99 | Character grid, ability tooltips, ready |
src/components/GameHUD.svelte | 133 | HP bars, scores, controls hint, mute |
src/components/CountdownOverlay.svelte | 47 | Animated 3-2-1-FIGHT! |
src/components/ResultsOverlay.svelte | ~170 | MVP card, scoreboard, K/D/A, rematch, XP progression |
src/components/ReplayControls.svelte | 120 | Seek, speed, play/pause |
src/components/SpectatorViewport.svelte | 320 | Free camera 3D viewport |
src/components/TutorialOverlay.svelte | ~90 | NEW โ 3-step first-fight onboarding |
src/types/index.ts | 253 | Entity, Character, Match types |
Character Roster#
| ID | Name | HP | Speed | ATK | SPL | Ability |
|---|
ember | Ember | 100 | 5.0 | 8 | 20 | Fireball + burn DOT (2 DPS, 3s) |
frost | Frost | 90 | 4.5 | 7 | 25 | Ice Wall (blocks movement/projectiles, 10s) |
volt | Volt | 80 | 6.0 | 6 | 18 | Dash Strike AoE (chains to nearby enemies) |
shade | Shade | 85 | 5.5 | 9 | 22 | Teleport behind enemy + guaranteed crit |
terra | Terra | 130 | 3.5 | 12 | 30 | Ground Pound AoE stun (1s) |
aqua | Aqua | 95 | 5.0 | 7 | 15 | Water Shield (reflect projectiles + heal 15 HP) |
4. Nakama Match Handler#
Opcodes#
| Opcode | Value | Direction | Purpose |
|---|
| STATE_UPDATE | 1 | SโC | Full state broadcast |
| GAME_OVER | 2 | SโC | Match ended (now includes progression data) |
| ERROR | 3 | SโC | Error message |
| PLAYER_JOINED | 4 | SโC | Player joined |
| READY | 5 | Both | Ready toggle |
| COUNTDOWN | 6 | SโC | Countdown tick |
| MATCH_START | 7 | SโC | Match started |
| CHARACTER_SELECT | 8 | Both | Character selection |
| SCORE_UPDATE | 9 | SโC | Score/kill |
| SPECTATOR_JOINED | 10 | SโC | Spectator notif |
| INPUT | 100 | CโS | Player input |
Game Constants#
| Constant | Value |
|---|
| TICK_RATE | 60 Hz |
| MATCH_TIMEOUT | 300s (18,000 ticks) |
| KILL_THRESHOLD | 10 kills (immediate win) |
| ARENA_SIZE | 56ร56 (ยฑ28) |
| GRAVITY | -20 m/sยฒ |
| ATTACK_RANGE | 1.5 units |
| ATTACK_COOLDOWN | 15 ticks (250ms) |
| SPECIAL_COOLDOWN | 90 ticks (1.5s) |
| JUMP_VELOCITY | 10 m/s |
| KNOCKBACK | 8 m/s |
| HITSTUN | 20 ticks (333ms) |
| BLOCK_REDUCTION | 80% |
New: Character Specials (Server-Side)#
All 6 characters now have unique special abilities on the server:
- Ember: Fireball projectile with burn DOT (2 DPS, 3s)
- Frost: Ice Wall obstacle (blocks movement/projectiles, 10s lifetime)
- Volt: Dash Strike AoE (damage + chain to all enemies within 4 units)
- Shade: Teleport behind nearest enemy + guaranteed 2x crit
- Terra: Ground Pound AoE (damage + 1s stun in 5-unit radius)
- Aqua: Water Shield (reflects nearby projectiles + self-heal 15 HP)
New: Progression System#
- XP per match: 10 base + 5 per kill + 10 win bonus
- Streak bonus: 3+ win streak = 2x XP
- Levels: 100 XP per level
- Stored in Nakama storage: collection=“progression”, key="{userId}/xp"
- Included in GAME_OVER payload for client display
New: Match End Conditions#
- Kill threshold: First team to 10 kills wins immediately
- Timeout: 5-minute fallback (team with most kills wins)
- Dramatic finish: Last 10 seconds when kill leader โฅ 8 (client indicator)
5. K8s & Monitoring Deploy#
| Resource | Name | Purpose |
|---|
| ConfigMap | sisterbrawl-config | Game metadata |
| NetworkPolicy | sisterbrawl-network-policy | Nakama โ game traffic |
| PDB | sisterbrawl-pdb | minAvailable: 1 |
| CronJob | sisterbrawl-health-check | Every 5 min |
| Service | sisterbrawl | Headless ClusterIP |
| Deployment | sisterbrawl-metrics | Python sidecar (:9101) |
Prometheus Alerts#
| Alert | Severity | Condition |
|---|
SisterBrawlHighTickLatency | warning | p95 > 20ms for 1m |
SisterBrawlVeryHighTickLatency | critical | p99 > 50ms for 30s |
SisterBrawlNoActivePlayers | info | 0 players for 10m |
6. Known Issues & Fixes#
โ
Resolved#
| Issue | Fix |
|---|
| “Failed to load game component” | Fixed โ game renders correctly now |
allowSoloAutostart: false | Changed to true |
| No client-side prediction | Implemented in gameStore |
| No entity interpolation | Implemented in gameStore |
| No screen shake | Implemented (stackable, quadratic decay) |
| No particles | Implemented (pooled, character-specific) |
| No audio system | Implemented (14+ SFX, layered music) |
| No bot AI | Implemented (moves toward player, attacks) |
| No replay system | Nakama storage-based at 10Hz |
| No spectator mode | Implemented with free camera |
| No 2D canvas fallback | Implemented for solo/headless |
| All specials identical on server | Each character now has unique special |
| Match end only by timeout | Kill threshold (10) + dramatic finish |
| No damage numbers | Floating damage numbers on 2D canvas |
| No tutorial | 3-step first-fight onboarding |
| No progression | XP/levels with Nakama storage |
| Music was soulless | Layered kick/bass/lead with tempo ramp |
๐ก Remaining#
| Issue | Severity | Notes |
|---|
| No death cam | ๐ก | Can’t see what killed you |
| No stage hazards | ๐ก | Flat arena, no environmental kills |
| Comms token 500 | ๐ก | Platform issue, not game |
| MP untested | ๐ก | Solo works, MP needs live test |
7. Perfection Cycle โ What’s New#
Fun Audit v2 Results#
| Metric | v1 (2026-05-28) | v2 (2026-06-04) | ฮ |
|---|
| Fun Stack avg | 2.8/5 (estimated) | 3.4/5 (playtested) | +0.6 |
| Usability | 1 | 4 | +3 |
| Clarity | ?3 | 3 | confirmed |
| Responsiveness | ?4 | 4 | confirmed |
| Competence | ?3 | 3 | confirmed |
| Agency | ?3 | 3 | confirmed |
| Emotion | ?3 | 3.5 | +0.5 |
| Meaning | ?2 | 2 | confirmed |
| Memory | ?2 | 2 | confirmed |
| ๐ด killers | 3 | 0 | -3 |
| Core loop BROKEN | 2 | 0 | -2 |
Changes in This Cycle#
- Character-specific specials โ All 6 characters now have unique server-side abilities
- Match-end kill threshold โ First to 10 kills wins immediately
- Hit-stop โ 2-3 frame freeze on KO and special hits
- Damage numbers โ Floating text on 2D canvas showing damage taken
- Audio upgrade โ Layered kick/bass/lead music with 100โ140 BPM tempo ramp
- Tutorial overlay โ 3-step first-fight onboarding (move โ attack โ special)
- Progression system โ XP/levels/streaks with Nakama storage
- Dramatic finish โ Last 10 seconds indicator when kill leader โฅ 8
8. Operational Runbooks#
Deploy Nakama Module#
cd /home/usr/funday/nakama-modules && npm run build
sudo kubectl rollout restart deployment nakama -n funday-platform
sudo kubectl logs -n funday-platform deployment/nakama --tail=20
Deploy Frontend#
bash /home/usr/funday/scripts/build-atomic.sh
systemctl is-active funday-frontend
curl -s -o /dev/null -w "%{http_code}" http://localhost:3000/play/sisterbrawl
Deploy K8s#
sudo kubectl apply -f games/sisterbrawl/deploy/k3s-deployment.yaml
sudo kubectl apply -f games/sisterbrawl/deploy/k3s-metrics-deployment.yaml
sudo kubectl get pods -n funday-platform -l app=sisterbrawl
Health Checks#
curl -sf http://127.0.0.1:3000/health # Frontend
curl -sf https://funday.gg/v2/healthcheck # Nakama
sudo journalctl -u funday-frontend -f # Frontend logs
sudo k3s kubectl logs -n funday-platform -l app=nakama --tail=50 # Nakama logs
9. Doc Map#
| Document | Path |
|---|
| This audit | docs/audits/sisterbrawl/ (Hugo) |
| Fun Audit v1 | docs/fun-ops/audits/2026-05-28-sisterbrawl-fun-audit.md |
| Fun Audit v2 | docs/fun-ops/audits/2026-06-04-sisterbrawl-fun-audit-v2.md |