Skip to content
AI-Coded Underwater Game Teaches AgentLoop Tuning in 5 Levels
Game Development 8 min read

AI-Coded Underwater Game Teaches AgentLoop Tuning in 5 Levels

The author used AI coding (Qoder) to build an open-source Three.js underwater exploration game in three days, mapping AgentLoop's five agent-tuning stages to five game levels; shares costs (54 tasks, 20 iterations, ~$140), lessons on references, MVP-first, and technical tips for AI-assisted 3D game development.

Alibaba Cloud Native
Alibaba Cloud Native
Alibaba Cloud Native

Why Design a Game

Inspired by Starry Nightrider — a 3D game where Van Gogh cycles through The Starry Night built by a non-developer using LLMs — the author spent a weekend creating an underwater game using AgentLoop's octopus mascot Loopie. The goal: turn AgentLoop's five tuning stages (observation, audit, evaluation, experiment, optimization) into playable levels, making abstract concepts tangible through interaction rather than passive reading.

Models now handle Three.js fluently. A previous article used Three.js to visualize AgentCore; this project upgrades to a full HTML game under 5 MB (HTML 57.2 KB, images 3.08 MB, audio 0.85 MB, scripts 0.74 MB), playable offline with no install or login.

Game Introduction: Self-Evolving Archipelago

Five islands represent the AgentLoop MVP loop:

01 Mist Lighthouse · Agent Observation

02 Border Customs · Agent Audit

03 Echo Theater · Agent Evaluation (in development)

04 Twin Experiment Isle · Agent Experiment (in development)

05 Growth Garden · Agent Optimization (in development)

First two levels are live at https://aliyun.github.io/ai-agent-handbook/games/; source at https://github.com/aliyun/ai-agent-handbook.

Level 1: Mist Lighthouse (Observation)

Side-scroller reminiscent of Super Mario. Loopie pilots a submersible rightward; arrow keys move, jump, crouch, boost. No timer, free exploration. Fog hides the execution path; lighting the lighthouse reveals the full trace — metaphor for observability turning opaque requests into clear trajectories. Press Esc to return to map; progress saves.

Level 2: Border Customs (Audit)

Shifts to 3D exploration inspired by Starry Nightrider . Freely swim a volumetric sea, collect shells and stars, deliver to the Border Customs landmark to clear. Default third-person chase camera (W/S forward/back, A/D turn, Space up, Shift down); press C for immersive cockpit view. Embodies audit: verify caller identity, permissions, data destinations — every action trace accountable.

Development Summary

Three days, Qoder's top model, 54 tasks, 20 versions from 2D to 3D, ~10k credits (~$140 at official pricing). Cheaper than traditional game dev but first-time AI coding is time-heavy; many optimization opportunities remain.

Lessons Learned

Find High-Quality References

Ask AI to research not for cloning but for a visual quality benchmark. Studied Starry Nightrider , Subnautica , Song of the Deep , Super Mario. Before/after screenshots show Loopie's octopus form extended into richer, volumetric scenes — each object re-rendered via Three.js, not copied.

Before reference: basic Loopie octopus assets
Before reference: basic Loopie octopus assets
After reference: volumetric underwater scene with Three.js re-rendered objects
After reference: volumetric underwater scene with Three.js re-rendered objects

Clarify the Game's Purpose

Purpose drives narrative. This game's story follows AgentLoop's five tuning stages, each level mapping to one stage.

Build MVP Locally First

Prototype a minimal playable slice to validate feel and visuals before expanding. Local testing saves tokens and deploy time; the author pushed three post-launch updates because CI/CD on the Handbook repo added long test/deploy cycles.

Technical Decisions

Blurry rendering? Check the render pipeline: use original-resolution textures, avoid premature downsampling.

Don't bundle all assets into a single HTML intro page; let the browser parallel-load, cache, and retry per page needs.

Automated tests must verify actual visual output.

Separate local hardware testing from CI environment for 3D games.

Future Plans

Complete the remaining three levels with bolder mechanics. Contributions welcome via PR to https://github.com/aliyun/ai-agent-handbook.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

AI codinggame developmentopen-sourceThree.jsWebGLQoderAgentLoopAgent Tuning
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.