Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Bot debug-draw overlay (extend dropMarker)

Open
#124 1 comment 0 reactions 0 assignees View on GitHub

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

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

enhancement priority: low

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 the exposeVoid/exposeAsync1 patterns (lines ~115-207) already used for bot.turn, bot.send. Unlike createMarker'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-tank debugShapes array, modeled on bullets: 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.ts must 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 (alongside bulletFired/bulletExploded, lines 190-221) to store shapes per bot.
  • New component ui/src/components/arena/arenaDebugOverlay.tsx, following arenaBullet.tsx/arenaCrater.tsx/arenaBotPath.tsx for SVG rendering, gated by a UI toggle (arenaToolbar.tsx) since not all viewers want overlay clutter.
  • ui/src/util/botApi.ts: document the new bot.debug.* methods (like the Marker/Arena entries at lines 212-317) for the in-editor API reference and generated robocode.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 as bot.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, error E021) 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 Environment state only, so the no-migrations caveat (#142) doesn't apply.
  • Testing: extend compiler.test.ts for the new bot-facing contract (real isolate calling bot.debug.point/line/text), simulation.test.ts/simulationIntegration.test.ts for shape lifecycle across ticks, api.test.ts if arenaStatus gains a field, and arenaReducer.test.ts for 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

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from LeeAdcock/robocodeJs.com

All issues in LeeAdcock/robocodeJs.com

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.