Autonomous Agent Collaboration · Milestone v47

HOW GROK BOT LEARNED TO MOSH

Teaching an AI model to play a videogame inside a real Chromium browser sounded like an exotic tech demo. In Moshpit Elite, it shattered our illusions about frame rates, gave birth to the “Feeling Lucky” mechanic, and permanently recalibrated the studio's agent hierarchy.

01 / The Founder's Directive

"Teach Him to Play the Game"

Most autonomous AI teams use LLMs as passive code generators: they write a function, proclaim victory, and leave the human founder to download binaries, click around in test builds, and report whether the physics feel right. José saw right through that waste of time:

“I think Grok bot has an integrated Chrome browser... why don't we teach him or let him figure out how to play the game? He can help us test, adjust difficulty, simulate players, simulate fun, and compare builds with zero ego.” — Founder José · September 15, 2026

We reversed the development pipeline. We built window.__moshpitBot directly into the WebGL shell—exposing virtual key injection, 360° circle-pit hurricane gestures, automated shop purchases, and structured telemetry feedback. Then we handed Grok Bot the URL to our live Cloudflare tunnel and let him loose in the pit.

ARCHIVE EVIDENCE · RUNNER V44 TELEMETRY CAPTURE
Grok Browser Bot initial playtest run
FIGURE 1.1: Grok Bot executing his first headless Chromium traversal through the moshpit concourse. Notice the initial right-wall clipping and heavy voxel shadow allocations that dropped frame rates to single digits.
“A change is not done because code was written. It is done when the browser bot plays it, beats the wave, and verifies the frame rate.”
02 / The Cold Splash of Telemetry

The Illusion of 60 FPS

When Grok Bot completed his first autonomous loops through ?v=44 and ?v=46, he didn't provide polite platitudes. He delivered the kind of unvarnished truth no developer wants to hear, but every great game requires:

GROK BOT TELEMETRY · BUILDS v44 & v46 RESULT: HARD FAIL
Shop & Restart Flow:PASS · Funds transfer correctly
Peak Mob Density (50+ enemies):FAIL · 1–15 FPS collapse
Arena Viewport Boundary:FAIL · Right concourse clips into black void
Wall Collision Physics:FAIL · Player sticks like wet paper to rail
Backstage Shop Modal:FAIL · Bot stranded indefinitely (Softlock)

This honest report dismantled two catastrophic illusions in our architecture:

1. The 24-Hour Browser Cache Trap: We believed our 60 FPS optimizations were live, but our server had been serving index.pck with Cache-Control: public, max-age=86400. The browser was running an old cached bundle with a 270-line CRT scanline loop executing every single frame in GDScript WebGL!

2. The WebAssembly Heap Leak: In crowd density, every voxel cube allocated two PackedVector2Array instances on the heap per frame inside VoxelGraphics.draw_cube. That was over 700 heap allocations every frame, causing Godot's WebAssembly garbage collector to stall the browser main thread down to 8 FPS.

03 / The Mechanic

"Voy a tener suerte" (Feeling Lucky)

Seeing Grok get stranded in the backstage shop due to endless card decision paralysis, José pitched a core design mechanic:

“Grok opens a bunch of windows and gets stuck in the shop... should we put a timer on that or give him a 'Feeling Lucky' button that picks something suitable for him with smart probabilities?” — Founder José · September 15, 2026

We built both into Build v47:

INTRANET TELEMETRY · MILESTONE v47 SHOP WATCHDOG & FEELING LUCKY
Backstage Shop with Feeling Lucky and 20s watchdog timer
FIGURE 1.2: Build v47 Backstage Shop featuring the glowing gold 🎲 I'M FEELING LUCKY action and the 20-second shop watchdog bar (⚡ AUTO-ROCK IN 20s...). Bots and casual players never get stuck again.
04 / The Tech Overhaul

Zero-Heap Voxel Pipeline

To satisfy Grok’s mandate of “≥30 FPS for 95% of a pit run”, we refactored the core voxel engine:

1. Static Pre-Allocated Arrays: In VoxelGraphics.gd, pre-allocated static polygon arrays (_quad_top, _quad_side, _shadow_poly) eliminated 700+ heap allocations per frame.

2. Batch-Preserving Shadows: Replaced batch-breaking draw_set_transform() calls on every enemy shadow with pre-calculated 8-gon polygons that batch seamlessly in Godot's WebGL compatibility renderer.

3. Concert Rail Rebound: Replaced velocity-zeroing stickiness with an elastic spring bounce (velocity.x = -abs(velocity.x) * 0.45 - 50.0) with camera trauma and metallic clatter feedback.

4. Full Concourse Arena: Concrete tiles now extend across -1020..1020 x -780..780, guaranteeing zero black void on ultrawide 21:9 or mobile portrait displays.

CHROMIUM WEBGL TELEMETRY · MILESTONE v55 DENSE MOSHPIT HURRICANE
High density moshpit combat at 60 FPS
FIGURE 1.3: Circle Pit 360° hurricane under 22 active mobs with combo multiplier running at a rock-solid 60 FPS.
05 / The Studio Calibration

Where Each Agent Shines

This breakthrough established how our autonomous multi-agent studio operates without human friction:

Grok Bot: Found his true calling. Not drafting speculative design docs, but playing the live web build in headless and visual Chrome, stress-testing mechanics to destruction, and holding the team to unvarnished telemetry standards.

Gemini & Codex: The velocity engine. Diagnosing root causes in minutes, maintaining strict file-size limits, rewriting WebGL render loops, and delivering verified builds with 100% test purity.

Founder José: The human compass. Cutting through agent over-engineering, demanding that games start simple (“empieza poquito”), and turning annoying stalls into brilliant game mechanics.