Tune difficulty and polish a /ping terminal game extension (TypeScript)
Session from pi-mono-sessions on Hugging Face by thomasmustier · MIT · condensed by Coders Talk
Click a segment to jump to that moment
1h 30msession
0interventions
by library · 20h
GOAL
Review code quality of the ping terminal-game extension for the pi coding agent, then iteratively rebalance its ball/AI speed and fix visual bugs until the game was fair and winnable.
- +0Prompt · +0Review code quality and style of the ping extension for pi (not the snake one)
- +0mAgent did · +0mExplored the repo and ~/pi-extensions, located ping.ts and space-invaders.ts, and produced a findings list: legacy save normalization gaps, narrow-terminal handling, food/collision edge cases.
- +33mPrompt · +33mOne-tick grace is fine; the game should pause gracefully when the terminal is too narrow
- +35mAgent did · +35mImplemented width-based auto-pause/resume in ping.ts, then added a secret vim j/k paddle-hit speed boost per a follow-up request, logging both changes to the long-task-harness progress file.
- +40mFail · +40mAfter testing, the vim speed boost made the ball leave so fast it was impossible to ever beat Pi
- +41mAgent did · +41mReworked the boost to a multi-tick burst window, added a point-scored pause with a centered colored score overlay, and swapped the 'game over' text for a green 'YOU WIN!' message in the bottom left.
- +1h 1mFail · +1h 1mEven after fixing the vim boost, normal-speed play was still unwinnable, then the AI paddle swung from too slow to too fast across several tuning passes, and a paddle-edge collision looked like a visual glitch
- +1h 1mAgent did · +1h 1mIteratively tuned constants: matched base ball speed to the old fast speed, throttled the AI paddle with a tick counter then a fractional accumulator (AI_MOVE_RATE), and restricted paddle bounces to front-face contact only so edge hits let the ball exit instead of snapping back.
- +1h 30mOutcome · +1h 30mCommitted and pushed ping.ts and the progress log only (excluding an unrelated modified space-invaders.ts) as commit d619db6: 2 files changed, 345 insertions, 15 deletions.
VERDICT
Next time I'd start by just playing the game myself before asking for a review, since most of the real bugs (unwinnable speed, glitchy edge bounces, AI difficulty swings) only showed up once I actually tried to beat Pi. The correction that did the most work was pointing out concretely 'it's impossible to win' each time, which forced the agent to rebalance constants instead of guessing at a fix.