Bot debug-draw overlay (extend dropMarker)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 42/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- javascript, react, typescript
- Domain
- devtools, full-stack, game-dev
Research direction
Read server/src/util/compiler.ts around exposeVoid/exposeAsync1 and the existing dropMarker implementation, then trace how arena state reaches ui/src/util/arenaReducer.ts and the SVG components. The issue names server/src/types/bot.ts, server/src/util/arenaStatus.ts, ui/src/components/arena/arenaToolbar.tsx, and ui/src/util/botApi.ts as likely touchpoints. Done means bots can draw bounded points, lines, and text that appear in the arena behind an optional UI toggle, with the listed contract, lifecycle, API, and reducer tests passing.
Written by the indexing model from the issue text.
Description
Extend dropMarker into a small debug-overlay API (draw points/lines/text) so authors can visualize their bot's targeting and decisions while it runs.
Effort: S–M
Migrated from ENHANCEMENTS.md (§4 Developer experience).
Implementation notes
Priority: low — Nice-to-have developer/debugging convenience for bot authors; purely additive visual feature with no effect on core gameplay, stability, or security.
Purpose
Bot authors currently have no way to see why their bot did something — bot.dropMarker()/arena.createMarker() (server/src/util/compiler.ts:419,724) is pure in-isolate distance/bearing math with no visual trace in the arena. A debug-draw overlay (points/lines/text) lets authors visualize targeting math and decisions live, closing a real debugging gap without touching game logic.
Implementation approach
server/src/util/compiler.ts: add a new bot-facing surface (e.g.bot.debug.point/line/text), following theexposeVoid/exposeAsync1patterns (lines ~115-207) already used forbot.turn,bot.send. UnlikecreateMarker's pure-JS closure, these calls must cross the sandbox boundary to host state, so they need a native_bot_debug*callback per method.server/src/types/bot.ts(or a new sibling type): add a per-tankdebugShapesarray, modeled onbullets: Bullet[](bot.ts:64) — cleared/replaced each tick so stale drawings don't accumulate.server/src/util/simulation.ts: no physics needed if shapes are static per-tick snapshots (unlike bullets, they don't move) — but if any decay/fade-over-ticks behavior is added,ui/src/util/simulate.tsmust mirror it (per CLAUDE.md's simulation/simulate parity rule).server/src/util/arenaStatus.ts(buildArenaStatus): include each tank's current debug shapes in the snapshot, same replay pattern used for bullets/place events so a newly-connected SSE client bootstraps correctly.ui/src/util/arenaReducer.ts: add a case (alongsidebulletFired/bulletExploded, lines 190-221) to store shapes per bot.- New component
ui/src/components/arena/arenaDebugOverlay.tsx, followingarenaBullet.tsx/arenaCrater.tsx/arenaBotPath.tsxfor SVG rendering, gated by a UI toggle (arenaToolbar.tsx) since not all viewers want overlay clutter. ui/src/util/botApi.ts: document the newbot.debug.*methods (like theMarker/Arenaentries at lines 212-317) for the in-editor API reference and generatedrobocode.d.ts.
Key details to plan
- Sandbox/security: strings for
text()and coordinate args must be validated/clamped (arena bounds, string length) before storage — same care asbot.send's JSON whitelist (compiler.ts) — to prevent a bot spamming huge payloads into SSE broadcasts. - Resource caps: add a per-tank shape-count limit (pattern:
MAX_TIMERS_PER_TANK, errorE021) so a bot can't DoS the arena/SSE stream by drawing unbounded shapes every tick. - Determinism: purely visual, doesn't touch the seeded PRNG (
util/random.ts) — no replay/determinism risk expected. - No DB/service changes — this is live in-memory
Environmentstate only, so the no-migrations caveat (#142) doesn't apply. - Testing: extend
compiler.test.tsfor the new bot-facing contract (real isolate callingbot.debug.point/line/text),simulation.test.ts/simulationIntegration.test.tsfor shape lifecycle across ticks,api.test.tsifarenaStatusgains a field, andarenaReducer.test.tsfor the new SSE event case. - Effort/risk: S–M as scoped is realistic for points+lines; text rendering and a UI toggle push it toward the upper end. Low risk — additive, opt-in, no shared-state mutation of existing game mechanics.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 8m
- Merged PRs (30d)
- 8
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from LeeAdcock/robocodeJs.com
-
priority: medium tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
LeeAdcock/robocodeJs.com#411 ·
Maintainers usually reply within 1 day
-
enhancement priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
LeeAdcock/robocodeJs.com#254 ·
Maintainers usually reply within 1 day
-
good first issue priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
LeeAdcock/robocodeJs.com#146 ·
Maintainers usually reply within 1 day
-
dependencies priority: low tech-debt
Difficulty 1/5 Under an hour Newbie friendliness 15/100
LeeAdcock/robocodeJs.com#413 ·
Maintainers usually reply within 1 day
-
priority: low tech-debt
Difficulty 3/5 Half a day Newbie friendliness 32/100
LeeAdcock/robocodeJs.com#412 ·
Maintainers usually reply within 1 day
All issues in LeeAdcock/robocodeJs.com
Similar issues
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
area:cowork area:desktop documentation enhancement platform:macos
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
anthropics/claude-code#101720 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 77/100
apache/rocketmq-dashboard#6610 ·
Maintainers usually reply within 3 days
-
Add: MS NOWOpencheck:passed streams:add
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Global update drops overrideAccess, so Local API updateGlobal fails filterOptions validation (3.90 regression)Possibly taken @PINYOPATTANAWASANPORN claimed this today. Openarea: core Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
payloadcms/payload#18674 · 1 comment ·
Maintainers usually reply within 1 day