
























People are trying to vibe code games. And it kind of works, at first. However, as the project grows, things begin to fall apart. Why? And what can we do about it?
I'll talk about the problem, how I fixed it, and where to go from here.
First, what is vibe coding? It's originally coined by Andrej Karpathy in a viral tweet where it's defined as where you "fully give in to the vibes, embrace exponentials and forget the code even exists".
However, since then, it's used descriptively to mean a lot of different things, anywhere from just "using AI when coding" to "not thinking about the code at all". In this blog post, I'll define it as: using AI as a high-level programming language to build something. Like other programming languages, this benefits from understanding what's going on under the hood, but doesn't necessarily require it.
With this interpretation, you could make a game without understanding code, though knowing the fundamentals still helps.
Earlier I mentioned that "as the project grows, things begin to fall apart". This is because there is evidence that as the context window fills up, model performance begins to degrade. This is especially true for game development, where the context can grow very large, very quickly.
To address this issue, there are many personal ad-hoc solutions, such as writing LLM-specific context directly in the project files, or more comprehensive solutions like Claude Code Development Kit for large-scale context management.
I couldn't find a lightweight, accessible solution, which doesn't rely on significant domain knowledge. So I made one: 🧅 Shallot, a simple, lightweight, unopinionated context management system for Claude Code. It relies on two basic commands:
/peel [prompt] to load context at the beginning of a conversation/nourish to update context at the end of a conversationAnecdotally, this works well. However, it works best when the project stays lean and well-organized, so all relevant context can easily fit in the model's context window. While Claude Code is used here, the same principles generalize to other models.
Beyond context management tools, platform choice is critical. The platform should ideally naturally keep projects lean through high-level abstractions, while also being something AI models understand well. So, what existing platforms are best suited for vibe coding?
I initially tried 3 different approaches to vibe coding games: Roblox MCP, Unity MCP, and web. For each, I tried to build a simple incremental game inspired by Grass Cutting Incremental, using Claude Code for each.
Here's how it went:
The official MCP server from Roblox. This allows AI to interact with Roblox Studio by sending commands to run code.
Pros:
Cons:
Roblox provides an excellent layer of abstraction for keeping the codebase lean and manageable, which is perfect for vibe coding. However, the walled garden and lack of context makes it infeasible for vibe coding, unless it's in-house at Roblox.
The unofficial MCP server for Unity. This allows AI to interact with the Unity Editor: reading the console, managing assets, and validating scripts.
Pros:
Cons:
Unity is a powerful engine with a lot of capabilities. However, the complexity and variability of the engine makes it difficult for AI to consistently produce good results without significant user domain knowledge.
The open web platform, using three.js for 3D rendering, rapier for physics, and bitecs for game logic.
Pros:
Cons:
This approach had the best AI performance by far, likely due to the vast amount of web development data available during training. However, the low-level nature of the libraries meant that I had to essentially build a game engine before I could build the game itself. This allows us to work at a much higher level of abstraction, like we did with Roblox.
Although it required building an engine first, this approach was the only one that produced a fun result without heavy domain knowledge.
| Platform | AI Performance | Abstraction Level | Context Management | Open Source |
|---|---|---|---|---|
| Roblox | ⭐⭐⭐ | ⭐⭐⭐⭐⭐ | ⭐ | ❌ |
| Unity | ⭐ | ⭐⭐ | ⭐⭐⭐ | ❌ |
| Web | ⭐⭐⭐⭐⭐ | ⭐ | ⭐⭐⭐⭐⭐ | ✅ |
After these experiments, I had a clear picture: the web stack had excellent AI performance but was too low-level, while Roblox had perfect abstraction but lacked openness and context management.
So, what about combining the best of both?
Introducing VibeGame, a high-level declarative game engine built on top of three.js, rapier, and bitecs, designed specifically for AI-assisted game development.
There were three key decisions that went into the design of VibeGame:
A basic game looks like this:
<world canvas="#game-canvas" sky="#87ceeb">
<!-- Ground -->
<static-part pos="0 -0.5 0" shape="box" size="20 1 20" color="#90ee90"></static-part>
<!-- Ball -->
<dynamic-part pos="-2 4 -3" shape="sphere" size="1" color="#ff4500"></dynamic-part>
</world>
<canvas id="game-canvas"></canvas>
<script type="module">
import * as GAME from 'vibegame';
GAME.run();
</script>
See it in action in this JSFiddle or the Live Demo.
This will create a simple scene with a ground plane and a falling ball. The player, camera, and lighting are created automatically. All of this is modular and can be replaced. Arbitrary custom components and systems can be added as needed.
This comes bundled with an llms.txt file containing documentation about the engine, designed specifically for AI, to be included in its system prompt or initial context.
Yes.
Well, kind of.
Here's the game I built to test building a simple incremental grass collection game using VibeGame and Claude Code. It worked very well, requiring minimal domain knowledge for implementing the core game mechanics.
However, there are still some major caveats:
So, with a definition of vibe coding that is the one-shot "make me a game" approach, it doesn't work. However, with the definition of treating vibe coding like a high-level programming language, it works very well, but requires users to understand the engine's capabilities and limitations.
To try it immediately, I built a demo where you can develop a game directly in the browser using VibeGame with Qwen3-Next-80B-A3B-Instruct: Live Demo on Hugging Face.
You can also test it locally with a frontier model like Claude Code:
npm create vibegame@latest my-game
cd my-game
npm run dev # or bun dev
Then, paste all the contents of the included llms.txt to CLAUDE.md, providing full documentation about the engine for the AI to reference (or point your own context management system to it). This works with other models as well.
The engine is currently very barebones and only supports very basic mechanics (unless writing it from scratch). However, initial results are promising.
Next steps would be:
It's also worth exploring how vibe coding games could harness more proven engines. For example, building a high-level sandbox game editor on top of Unity or Unreal Engine (similar to how Unreal Editor for Fortnite is built on Unreal Engine) could provide a more controlled environment for AI to work with, while leveraging the power of established engines.
We're also likely to see more in-house solutions from major players.
Follow me to keep up with what's going on in the space!
Links:
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。