Match replays
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 35/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Tranquilla
- Stack tecnologico
- javascript, typescript
Direzione di ricerca
Start with server/src/api/arena.ts and server/src/types/environment.ts to trace emitted events and current live event access, then read ui/src/util/playbackBuffer.ts, playbackClock.ts, and arenaReducer.ts for replay playback. The implementation notes also point to ReplayService.ts, mcp.ts, and tests for environments, services, reducers, and playback. Done means finished matches can be persisted, listed and fetched, then replayed with scrubbing and slow motion; the notes flag retention, storage growth, and #142 as planning concerns.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The arena is already an event stream — persist a match's events and add a replay player (scrub, slow-mo). Hugely shareable.
Effort: M–L
Migrated from ENHANCEMENTS.md (§2 Gameplay & fun).
Implementation notes
Priority: medium — Valuable analysis/spectator feature reusing existing SSE and playback machinery, but purely additive (no stability/security impact) and not on the core play-a-match path.
Purpose
Match replays let users (and spectators/MCP tooling) review a finished battle after the fact — currently once Environment restarts or is disposed (30-min idle GC in EnvironmentService), the SSE event history is gone. This adds durable value beyond live viewing and gives bot authors a debugging/analysis tool without needing to catch a match live.
Implementation approach
- Capture: hook the same
Environment.emit('event', ...)path already consumed byGET /api/user/:userId/arena/events(server/src/api/arena.ts) — add a recorder alongside the existingrecentLogs/recentFaultsring buffers inserver/src/types/environment.ts(MAX_RECENT_LOGSpattern) that appends every emitted event plusclock.timeto a per-match buffer, flushed/persisted onrestart()/match end (mirrors howrecentFaultsis reset at line ~570). - Persistence: new
ReplayService.ts(services singleton, same shape asArenaService.ts/AppService.ts:CREATE TABLE IF NOT EXISTSat import time, no framework migrations yet — see #142) storing{matchId, arenaId, seed, events JSONB/blob, startedAt, summary}. Event volume is significant (~10 ticks/s × up to 5 tanks × several event types for potentially minutes) — worth gzipping the JSON blob or storing to a blob column rather than one row per event. - Playback (UI): reuse
ui/src/util/playbackBuffer.tsandplaybackClock.tsalmost unmodified — they already decouple "when events arrive" from "when they're applied" and expose a playhead; a replay is just a buffer fed from a fetched array instead of a live SSE connection. Feed events through the existingui/src/util/arenaReducer.tsandui/src/util/simulate.tsunchanged — replay is only a different event source, not a different state machine, so no risk of drifting the client physics mirror fromserver/src/util/simulation.ts. - New endpoints:
GET .../arena/replays(list),GET .../arena/replays/:matchId(fetch full event log) inarena.ts; expose read-only via MCP (mcp.ts) alongsidematch_summary/recent_logsfor parity. No bot-facingcompiler.tschanges — this is spectator/analysis surface only. - Scrub/slow-mo: add a scrub bar + speed control on top of
playbackBuffer's existingtickMs/depth mechanics; scrubbing means re-seeding the reducer from event index 0 (or periodic snapshots) since state is derived by folding events, not stored per-frame.
Key details to plan
- Determinism: since
Environmentseeds a PRNG (util/random.ts), a storedseedplus event log gives two replay strategies — pure event replay (store every emitted event, simplest, robust to future physics changes) vs. re-simulation from seed (cheaper storage, but breaks ifsimulation.tschanges) — choose the former for correctness. - DB growth/retention: needs a size cap or TTL policy per arena/user; tie into
MAX_APPS_PER_USER-style caps to avoid unbounded storage abuse. - Testing: extend
environmenttests and addReplayServicetests followingservices.test.tsconventions (mockutil/db); add reducer/playback tests followingarenaReducer.test.tsand a newplaybackBuffer-from-static-array test. - Dependencies: benefits from #142 (DB migrations) landing first given a new table; otherwise standalone.
- Effort/risk: M–L as filed — mostly additive, low security risk (read-only, owner/spectator-gated like existing
/arena/events), main risk is storage/perf at scale.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 0
- Merge medio
- 21h 23m
- PR unite (30g)
- 9
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di LeeAdcock/robocodeJs.com
-
priority: medium tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
LeeAdcock/robocodeJs.com#411 ·
I maintainer di solito rispondono entro 1 giorno
-
enhancement priority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
LeeAdcock/robocodeJs.com#254 ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue priority: low tech-debt
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
LeeAdcock/robocodeJs.com#146 ·
I maintainer di solito rispondono entro 1 giorno
-
dependencies priority: low tech-debt
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 15/100
LeeAdcock/robocodeJs.com#413 ·
I maintainer di solito rispondono entro 1 giorno
-
priority: low tech-debt
Difficoltà 3/5 Mezza giornata Idoneità per principianti 32/100
LeeAdcock/robocodeJs.com#412 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di LeeAdcock/robocodeJs.com
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 70/100
microsoft/playwright#43640 ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
grasshopper-protocol/grsshppr#172 ·
I maintainer di solito rispondono entro 1 giorno
-
bug help wanted
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
Tencent/teamai-cli#1397 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
DouyinFE/semi-design#3641 ·
I maintainer di solito rispondono entro 3 giorni
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 83/100
I maintainer di solito rispondono entro 1 giorno