Code2Games: Enabling Coding Agents for Gaming World Generation
Wei Wu, Ziyang Xu, Zeyu Zhang, Yang Zhao, Hao Tang
Peking University · La Trobe University
Published October 4, 2026 · on the feed October 6, 2026 · ▲ 7 · arXiv 2610.05033
The abstract
Generating a high-quality gaming world from a natural-language game intent requires joint reasoning about scene structure, spatial layout, gameplay objectives, interactive entities, and executable gameplay logic. Existing coding agents can generate individual assets, scenes, or scripts, but often struggle to maintain consistency across these components. We propose Code2Games, an agentic framework that builds a structured gaming world upon a base Blender world generated from the same game intent. Code2Games coordinates scene analysis, gameplay planning, constrained gaming-world generation, and gaming-engine customization through a shared scene-gameplay representation with persistent element correspondence. After world generation, Code2Games adapts the generated world to Unreal Engine 5 and employs an execution-guided reconstruction process that uses compilation diagnostics, runtime feedback, and gameplay test results to resolve inconsistencies arising during engine adaptation. To systematically evaluate gaming-world generation, we introduce the GameCode4D benchmark, which comprises ten fixed game prompts spanning different levels of scene and gameplay complexity. We evaluate the generated results across four dimensions: visual quality, interactive fidelity, multimodal artifact quality, and playable-game quality. Experiments demonstrate that, compared with direct gaming-world generation by coding agents and existing baseline methods, Code2Games consistently improves the visual quality and interactive fidelity of generated gaming worlds, as well as the quality of the resulting games after engine adaptation.
The Brief
2:42A short podcast summary of the paper. Written and voiced by AI.
Transcript
Code2Games. Enabling Coding Agents for Gaming World Generation. By Wei Wu and four others, from Peking University and La Trobe University. Published on the fourth of October. Its code repository is public and real: about twenty source files.
Turning a natural-language game intent into a high-quality gaming world means reasoning about many things at once: scene structure, spatial layout, gameplay objectives, interactive entities, and gameplay logic that actually executes. These are not independent. An objective needs entities to act on, the entities need places in the layout, and the logic has to refer to all of them correctly.
Coding agents today can generate the individual pieces, an asset, a scene, a script. Where they often struggle is keeping those pieces consistent with one another, so that the logic refers to entities that exist, placed where the layout put them.
Code2Games is an agentic framework that builds a structured gaming world on top of a base world in Blender, generated from the same game intent. Its answer to the consistency problem is a shared scene-gameplay representation with persistent element correspondence. Every stage of the work refers back to the same set of elements, so an object in the scene and the gameplay rule that uses it stay linked from start to finish.
Through that representation, Code2Games coordinates four activities: scene analysis, gameplay planning, constrained gaming-world generation, and customization for the game engine. Once the world exists, it is adapted to Unreal Engine 5. That adaptation can introduce inconsistencies of its own, so an execution-guided reconstruction process follows. It draws on compilation diagnostics, runtime feedback, and gameplay test results to find and resolve them.
To evaluate this kind of generation systematically, the authors also introduce the GameCode4D benchmark. It comprises ten fixed game prompts that span different levels of scene and gameplay complexity. Results are judged along four dimensions: visual quality, interactive fidelity, the quality of multimodal artifacts, and the quality of the playable game.
The comparisons are against direct gaming-world generation by coding agents and against existing baseline methods. Code2Games consistently improves the visual quality and the interactive fidelity of the generated worlds, and it improves the quality of the resulting games after adaptation to the engine. The abstract reports these as consistent improvements without giving figures.
Most of the design serves one constraint: every component has to agree with every other. A shared representation keeps scene and gameplay in step during generation, and execution feedback restores that agreement when moving into a real engine disturbs it. The evaluation follows the same logic, scoring not only how the world looks but whether it plays.
More with an account
Listen to every day’s papers
Daily playlists, deep dives, quests for the papers, and quizzes on their key terms.
Join free