← Latest papers
🤖 machine learning

Knowledge-Conditioned, Single-Pass LLM Synthesis of Executable Unity Game Scenes: A Compiler Error Census across 26 Goal Playable Concepts

This paper evaluates the capability of large language models to generate executable Unity C# code in a single pass without iterative repair, revealing that despite testing 10,400 generations across various models and conditions, none successfully compiled due to a fundamental lack of engine-specific knowledge, with errors categorized as either grounding issues (invented APIs) or hygiene issues (structural defects) depending on the specific game concept.

Original authors: Hugh Xuechen Liu, Kıvanç Tatar

Published 2026-07-14
📖 5 min read🧠 Deep dive

Original authors: Hugh Xuechen Liu, Kıvanç Tatar

Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer

Imagine you ask a super-smart robot to build a fully playable video game level in Unity (a popular game engine) in one single go. No "oops, let me try again" loops. No human fixing typos. Just one draft, and that's it.

That's exactly what this paper did. The researchers asked four different AI models to write the code for 26 different types of game goals (like "Stealth," "Rescue," or "Capture"). They ran this experiment 10,400 times.

The Big Surprise: Zero Successes
Here is the hard truth the paper found: None of the 10,400 attempts worked. Not a single one compiled into a runnable game scene. The robot didn't just make a few mistakes; it failed completely every single time.

The paper explicitly rules out the idea that "bigger models" or "better instructions" would fix this in a single pass. Even the biggest model they tested (a 30-billion-parameter AI) and the most detailed instruction guides (called "schemas") couldn't get a single game to start. The authors measured this exhaustively across 26 different game concepts and 20 random variations for each, so there's no doubt: in a single-shot attempt, current AI cannot build a working Unity game from scratch.

The Two Types of Mistakes: "Grounding" vs. "Hygiene"
Since every single attempt failed, the researchers didn't just count the failures; they took a magnifying glass to the 90,673 error messages the computer spat out. They sorted these errors into two funny categories:

  1. Hygiene Errors (The "Messy Room" Problems): These are basic coding mistakes that have nothing to do with video games. Think missing semicolons, unmatched curly braces {}, or syntax errors. It's like trying to write a story but forgetting to put a period at the end of a sentence. The AI just got the grammar wrong.
  2. Grounding Errors (The "Fake Dictionary" Problems): This is where it gets interesting. These errors happen because the AI invented things that don't exist. It would write code using a Unity tool called GuardAI or a function called DetectInvisibility, but those tools don't actually exist in the game engine. It's like a chef writing a recipe that calls for "magic flour" or "unobtainium." The AI knows what it wants to do (make a guard detect you), but it doesn't know the real name of the tool the engine uses to do it.

The "One-Size-Fits-All" Myth is Dead
The paper argues against the idea that you can just give the AI a better "schema" (a strict template of how to write the code) to fix everything.

  • They tried giving the AI a strict template with no schema, a minimal one, and a full, detailed one.
  • Result: The strict templates actually made things worse for some models. They caused the AI to get confused and stop writing code entirely (getting rejected before it even tried to compile). For the models that did try, the strict templates just cleaned up the "Hygiene" (grammar) errors but left the "Grounding" (fake tool) errors untouched. The AI still invented fake tools; it just did so in a neater format.

Why Some Games Were Harder Than Others
The researchers noticed a pattern based on what the game was supposed to do.

  • The "Physics & Senses" Games: Concepts like Stealth (moving without being seen), Rescue (saving someone), and Exploration (finding things) were the hardest. These rely heavily on the game engine's "perception" and "physics" systems. The AI failed here mostly with Grounding errors. It tried to invent complex, fake systems for "vision cones" or "pathfinding" because it didn't know the real names of the Unity tools for those things.
  • The "Simple Logic" Games: Concepts like Capture (taking ownership of an object) were "easier" in a weird way. They failed mostly with Hygiene errors. The AI got the logic right (I need to track who owns this item) but messed up the basic code structure. It didn't need to invent fake engine tools because the logic was simple enough to be done with basic variables.

The "Size" Trap
You might think, "Maybe a bigger brain would know the real tool names!" The paper tested models ranging from 7 billion to 30 billion parameters.

  • The finding: Bigger didn't mean better. The 30-billion model didn't produce a working game any more than the 7-billion one. It just produced different kinds of mistakes. The bigger models were better at following the strict templates, but they still couldn't bridge the gap to the real engine tools.

The Takeaway for Designers
The paper concludes that the bottleneck isn't that the AI is "dumb" or that the instructions were bad. The bottleneck is missing knowledge. The AI simply doesn't have the specific, up-to-date dictionary of the Unity game engine in its head.

If you want an AI to build a game in one shot, you can't just ask it to "try harder" or "follow a template." You have to give it the actual manual for the game engine. Until then, the AI will keep trying to build castles out of "magic bricks" that don't exist. The paper suggests that for now, humans need to be the ones holding the blueprint, using the AI to help with the messy parts, but not expecting it to build the whole house alone in a single draft.

Drowning in papers in your field?

Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.

Try Digest →