How Claude Code optimized a game's battle engine: measure first, profile again, admit failures

Ivaricus · reddit · 2026-11-04

A solo dev building Houses of Veyra (Godot 4, 14k-line campaign script, 230+ tests) shares how Claude Code handled an "every soldier fights" feature: stage 1 was measure-only tooling with CPU throttled 4x to emulate phones. Profiling found per-soldier scans ate over a third of the frame at 80v80; the first grid fix (24.7→19.1ms) was flagged as disappointing by the model itself, which re-profiled and rewrote spacing as one batched pass per physics step. It verified 72 full battles matched old outcomes, then honestly reported "phones barely moved." Key practices: demand measure-first stages, prove rewrites return identical answers, compare on player-feel metrics, and reward the model for admitting a fix didn't work.

Original post →

More from coding & agent

coding & agent channel →