Generate a Mini-Game from a Single Prompt? Testing the Cocos AI Agent Plugin

A Cocos Creator AI agent plugin uses DeepSeek to build a playable Mario start scene from scratch with zero manual input.
A Bilibili developer's Cocos Creator AI agent plugin aims to generate playable mini-games from a single prompt. The second dev log showcases three-level context compression, tool approval for safe execution, multi-agent parallelism, and persistent memory — demonstrated live by autonomously building a Mario start scene using DeepSeek V3, entirely without manual intervention.
Project Goal: Let AI Write Games for You
In game development — a field that heavily relies on collaboration between code and art — AI agents are playing an increasingly important role. A Bilibili developer has been continuously updating a "Cocos Creator Game Agent Plugin" project with an ambitious goal: generate a playable mini-game from a single sentence.
Cocos Creator is a cross-platform game engine developed by Xiamen Yaji Software (Cocos), born from the open-source Cocos2d-x project. It has since evolved to Cocos Creator 3.x, supporting both 2D and 3D game development with one-click publishing to iOS, Android, Web, WeChat Mini Games, and more. Cocos Creator holds a significant share of China's mobile and mini-game market. Its editor is built on Electron and offers an extensible plugin system — the technical foundation that makes deep integration of the AI agent plugin possible.
This isn't simple code completion or asset generation. The agent is expected to handle everything from understanding requirements and building scenes to writing scripts — running through the complete development workflow of a mini-game. In the second dev log, the author demonstrated several new features and walked through the entire process of using AI to build a Mario start scene from scratch.
For Cocos Creator, one of China's leading game engines, deeply integrating an AI agent into the editor could fundamentally reshape how developers work.
Core New Features: From Tool Approval to Multi-Agent Collaboration
This update introduces a fairly comprehensive set of new capabilities, including tool approval, skill management, agent scheduling, context statistics, and MCP (Model Context Protocol) support — together forming a more complete agent workflow framework.
MCP is a standardized protocol proposed and open-sourced by Anthropic in late 2024, designed to address interoperability between AI models and external tools and data sources. Its core idea is to provide large language models with a unified "tool-calling interface specification," enabling models to interact with file systems, databases, code execution environments, third-party APIs, and other external capabilities in a standardized way — without requiring custom adapters for each scenario. Before MCP, integrating different AI tools with external systems typically required writing bespoke glue code for each combination. MCP defines a standardized Server/Client communication model, so tool developers only need to implement the protocol interface once to make it accessible to all MCP-compatible AI hosts. MCP is now widely supported by Claude, Cursor, Windsurf, and other mainstream AI tools, and is rapidly becoming the de facto standard for agent tool integration.
Real-Time Context Compression: Three-Level Mechanism to Control Token Costs
The most noteworthy feature is real-time context compression. The author classifies compression into three levels — L0, L1, and L2 — based on information loss, with the goal of keeping the context consistently "clean" while avoiding wasteful Token consumption.

To appreciate the value of this design, it helps to understand how large language models work. Tokens are the basic unit of text measurement for models — roughly 1–2 tokens per English word or Chinese character — and API costs scale directly with token count. More critically, overly long contexts trigger "attention dilution," where models struggle to attend uniformly to all key information in very long inputs, particularly content in the middle of the context window (a phenomenon known in the field as the "Lost in the Middle" problem). A 2023 Stanford study found that when processing long documents, models assign far more attention weight to information at the beginning and end than in the middle — which can cause early instructions or intermediate outputs to be effectively "forgotten" in multi-step tasks.
The L0/L1/L2 tiered compression strategy is fundamentally about dynamically trading off between information fidelity and Token efficiency: L0 is typically lossless cleanup (removing duplicates, normalizing formatting); L1 is lossy summarization (preserving the semantic skeleton); L2 is aggressive compression (retaining only key state snapshots). This three-tier mechanism allows the agent to adaptively adjust memory density based on task stage and remaining budget. It's worth noting that while mainstream model context windows have grown from GPT-3's early 4K tokens to GPT-4o's 128K and beyond, a larger window doesn't make the problem disappear — inference cost scales roughly linearly or even quadratically with context length. Tiered compression therefore delivers irreplaceable engineering value on both cost control and output quality.
This design directly addresses a core pain point in current AI agent applications. In long-running, multi-step development tasks, context expands rapidly — not only driving up costs, but causing the model's attention to scatter and output quality to degrade. Tiered compression is essentially giving the agent a "memory manager" that preserves critical information while clearing out noise, making it a crucial piece of production-ready engineering.
Multi-Agent Parallelism and Dual-Mode Switching
The plugin supports opening multiple conversation windows simultaneously to work with multiple agents in parallel. It also offers two modes — Discussion and Work — where Discussion mode is used to clarify requirements, and Work mode is switched on when it's time to actually execute tasks.
This mode separation is quite practical: Discussion mode leans toward conversational requirement clarification, preventing the agent from making premature changes to the project when goals are still unclear; Work mode focuses purely on execution. It essentially simulates the natural rhythm of human-AI collaboration — align on goals first, then get to work.
Live Demo: AI Builds a Mario Start Scene from Scratch
In the demonstration, the author had the agent build a Mario start scene from scratch, including scene structure and game scripts. The prompts and game assets were prepared in advance, and the driving model was the fast inference version of the DeepSeek V3 series.
DeepSeek V3 is a flagship Mixture-of-Experts (MoE) model released by DeepSeek in late 2024. The MoE architecture uses a "Router" mechanism to dynamically route inputs to the most relevant "expert" sub-networks, activating only a small fraction of total parameters per inference — effectively decoupling parameter scale from inference cost. DeepSeek V3's architecture of 671 billion total parameters with 37 billion active parameters achieves code generation and reasoning capability close to GPT-4o. Its improved auxiliary-loss-free load balancing strategy makes expert utilization more balanced, with particularly strong performance on structured tasks like code generation and mathematical reasoning. Perhaps most notably, its API pricing is roughly 1/20 to 1/10 that of GPT-4o, making agent tasks that require heavy tool-calling and long-context interaction economically viable — a key reason for its rapid adoption in the domestic developer community.

The entire process took roughly ten minutes. The agent first conducted a series of investigations, then generated a task list, and proceeded step by step. One detail worth highlighting: the agent proactively noticed that the project's resolution settings were incorrect, and promptly requested permission to call a tool to fix the project settings — after being granted approval, it successfully adjusted the design resolution to 800×600.
This "proactively identify problem → request permission → execute fix" loop is a perfect illustration of the Tool Approval mechanism. When the agent needs to call a tool with side effects — such as modifying files, executing code, or changing configurations — the system pauses execution and sends a confirmation request to the human operator. Only after receiving explicit authorization does it proceed.
This "Human-in-the-Loop" architecture originates from a classic safety paradigm in automated systems design: introducing human judgment at critical decision points to prevent automated systems from causing irreversible harm through mistaken assumptions or out-of-bounds behavior. This need is especially pressing in the AI agent domain — an agent with tool-calling capabilities can directly operate on the file system, execute code, and call external APIs. If goal misinterpretation or permission misuse occurs, the consequences are far more severe than a simple text output error. OpenAI, Anthropic, and other organizations have listed the "principle of least privilege" and "interruptibility" as core design requirements in their agent safety frameworks. Tool approval is the concrete engineering implementation of these principles — a necessary safeguard for agents to move from "experimental tools" to "production-ready tools."
Scene Takes Shape and Memory Is Formed
As the task progressed, the overall scene structure gradually took shape.

After completing the build, the agent proactively summarized its work and formed a memory. Behind this mechanism lies a systematic compensation for the inherent "stateless" nature of large language models: standard LLMs treat each call as independent and retain no context information after a session ends.
To address this limitation, mature agent frameworks typically introduce multi-layered external memory systems: short-term memory stores the current session context; long-term memory persists semantic summaries to vector databases or structured storage; episodic memory saves structured logs of specific task execution processes; and procedural memory accumulates reusable operation templates and tool-usage experience. In game development, this mechanism is particularly valuable — a complete game project typically involves dozens of scenes and hundreds of script files, and the agent must maintain accurate awareness of project architecture, module dependencies, and known issues across multiple sessions over extended periods. The memory mechanism persists critical information in structured form — such as JSON or Markdown summaries of scene structure, completed modules, and known issues — enabling the agent to maintain coherent "project awareness" across sessions and tasks over a long project lifecycle. This step is especially critical for long-term projects, as it means subsequent tasks can build on existing knowledge rather than re-understanding the project state from scratch each time. For minor issues remaining in the scene, the author also had the agent perform autonomous fixes.
Runtime Verification: All Features Completed by AI Independently
Final runtime testing showed that the arrow keys correctly selected the number of players, and sound effects were in place. Since the subsequent levels haven't been developed yet, selecting a player count only prints a log entry — which is expected behavior.

The author specifically noted: the entire scene and scripts were written by AI, with absolutely no manual intervention throughout. This is the most convincing part of the demonstration. From scene structure and interaction logic to audio integration, the agent independently completed a fully functional start scene.
Observations and Reflections: The Real Boundaries of AI Game Development
From this dev log, it's clear that AI agent integration in game engines is evolving from "assisted coding" toward "end-to-end task execution." A few signals worth noting:
Engineering capabilities are catching up. Features like context compression, tool approval, and memory mechanisms may seem like small details, but they determine whether an agent can reliably operate in real-world projects. Compared to the raw capability ceiling of the underlying model, these engineering details are often the actual bottleneck for practical deployment. The evolution of mainstream agent frameworks like LangChain, AutoGen, and CrewAI confirms this: what truly differentiates applications in practice is rarely the parameter count of the underlying model, but rather the completeness of engineering-level components like memory management, tool scheduling, and error recovery.
The integration value of domestic toolchains. The combination of DeepSeek powering the Cocos engine demonstrates a fully domestic-stack AI game development pathway, which has real practical value for China's independent developers and small-to-medium teams.
Maintaining a realistic perspective on the current stage. The demo task conditions were relatively ideal: assets prepared in advance, prompts carefully designed, and scene structure clearly defined. The road to truly "generating a complete playable game from a single sentence" — especially for complex gameplay logic, performance optimization, and dynamic art generation — is still quite long.
The plugin is still under active development, and the author has indicated that the full first level of the Mario game will be completed in future updates. For developers interested in AI-assisted game development, this is a practical project well worth following over the long term.
Related articles

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites—It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI—they're copying shared prompts or scraping others' work. Learn AI coding tools' real limits.

Getting Started with AI Agent Development: A Complete Guide from Concept to Practice
A comprehensive guide to AI Agent architecture and development, covering automated marketing, intelligent customer service, and investment analysis scenarios with single and multi-agent collaboration.

The Truth Behind Codex 'Build a Website in 5 Minutes': AI Isn't Creating Sites — It's Helping You Copy Them
Exposing the truth behind viral Codex 5-minute website videos: creators aren't building original sites with AI — they're copying shared prompts or scraping others' work.