codingBy HowDoIUseAI Team

How to vibe code a 3D game that doesn't fall apart after level one

A real breakdown of building a 10,400-line 3D roguelite with Claude Code and Codex, and what it actually takes to make AI-built games fun.

A one-level demo where a cube jumps over another cube is easy to fake. A 3D roguelite with boss fights, procedural levels, meta progression, and a chaos system that spawns tornadoes inside a library is a completely different animal. That's exactly the gap one recent project closed: a sequel called The Librarian 2, built almost entirely through natural-language prompting, ended up as a 3D procedurally generated roguelite with boss enemies, natural disasters, meta progression, and a chaos system, spanning 10,400 lines of code across 33 modules with zero asset files.

That last detail matters more than it sounds. Zero asset files means every model, texture, and effect was generated through code rather than imported from an art pipeline. No Blender exports, no Unity Asset Store packages, no sprite sheets. Just prompts turning into geometry.

The takeaway wasn't that AI has made game development trivial. It was closer to the opposite: game development is far from cooked, but it's also a lot harder than the one-level demos on social media make it look. That distinction is the whole reason this project is worth breaking down.

What tools actually built this game?

The build used a two-tool workflow instead of sticking with one assistant for the entire process. The initial build ran through Claude Code with Opus 5, then switched to Codex and GPT-5.6 Sol for all the fine-tuning.

Claude Code is Anthropic's agentic coding tool, and it's built to do more than autocomplete lines. It reads your entire codebase, plans multi-file changes, executes them, and can run terminal commands on your behalf. According to Anthropic's own docs, Claude Code is an agentic coding tool that reads your codebase, edits files, runs commands, and integrates with your development tools, available in your terminal, IDE, desktop app, and browser. That's the layer that handled the heavy lifting of scaffolding a 33-module 3D game from scratch — setting up the render loop, the enemy spawning logic, the level generation system, and the core game state before anything needed polish.

OpenAI Codex CLI took over for the fine-tuning phase. Codex isn't the same tool it was at launch. What started as a simpler alternative to Claude Code has grown into a full agentic coding surface. Independent documentation of the CLI notes that Codex now ships with native subagents, MCP server support, auto-review, hooks, and remote Codex Cloud tasks, putting it in the same category as Claude Code rather than a lightweight competitor. That maturity is exactly why it worked well for the second half of this project — the phase where bugs, balance issues, and "why did the player disappear into nothing" moments needed fast, targeted fixes rather than large architectural decisions.

Splitting the work this way — one model for the big swings, another for the follow-through — is becoming a common pattern for anyone doing serious AI-assisted development, not just game projects.

Why does switching between Claude Code and Codex actually make sense?

Different models have different strengths at different stages of a build, and pretending one tool should do everything is where a lot of vibe-coded projects fall apart.

The initial build phase needs a model that can hold a huge amount of context and make sound architectural calls — deciding how enemy AI should be structured, how the chaos system should hook into the physics engine, how procedural generation should avoid producing broken or unplayable levels. That's reasoning-heavy work, and it benefits from a model tuned for the most demanding reasoning and long-horizon agentic work, which is the exact positioning Anthropic gives its top-tier Opus models.

Fine-tuning is a different kind of work entirely. It's fast iteration: "the enemy is too fast," "the tornado spawned inside the building," "make the banana peel actually slippery." This is where a CLI with quick review loops and inline code review pays off. Codex's own feature docs highlight a /review command that provides inline code review without modifying the working tree, useful as a pre-commit check — exactly the kind of tight loop you want when you're chasing down dozens of small bugs instead of designing new systems.

How do you avoid the "one-level demo" trap?

Most AI-built games shown off online stop at the exact point where things get hard: one level, one enemy type, no persistence between sessions, no real difficulty curve. Getting past that requires a few deliberate choices.

Write the whole design brief up front, not in fragments. A long, detailed prompt covering every system you want — progression, enemy variety, environmental hazards, chaos events — gives the model something to architect around instead of bolting features onto a fragile foundation one request at a time.

Build systems, not one-offs. A single boss fight is a demo. A boss system that can spawn different enemy types with shared health, damage, and drop logic is a game. The difference between the two is almost entirely in how the initial architecture request gets framed.

Expect the first version to break in interesting ways. Enemies moving too fast and vanishing entirely, tornadoes spawning inside buildings instead of outside them — these are the kinds of bugs that show up in genuinely emergent systems, not scripted ones. That's a good sign the underlying systems are actually dynamic rather than hardcoded.

Layer in the weird stuff last. Small touches — a banana peel that makes you slip, a mushroom that makes you grow — are cheap to add once the core loop works, and they're what make a functional game feel like a fun one. Trying to add flavor before the fundamentals are solid usually means redoing both later.

What does 10,400 lines with zero assets actually mean for solo developers?

Skipping traditional art assets entirely is one of the more interesting implications of this project. Every visual element — characters, environments, effects — came from procedurally generated code rather than imported 3D models or textures. For solo builders without an art background, that's a genuinely different path into 3D game development than the traditional Unity-plus-Asset-Store route.

It's not free of trade-offs. Procedurally generated visuals tend to look more abstract and geometric than hand-modeled assets, and getting them to feel intentional rather than placeholder-ish takes iteration. But for someone testing whether an idea is fun before investing in art direction, it removes one of the biggest bottlenecks in solo game development: needing to be a coder and an artist at the same time.

Which tools should you actually start with?

If this kind of project sounds appealing, here's a practical starting point rather than a wishlist of every AI coding tool on the market:

  1. Claude Code — best for the initial architecture and scaffolding phase. Install it, point it at an empty project directory, and describe your game's core systems in as much detail as possible before writing a single line yourself.
  2. OpenAI Codex CLI — best for fast iteration once the core game loop exists. Use it for bug fixes, balance tweaks, and the kind of rapid back-and-forth that fine-tuning demands.
  3. GitHub — commit early and often. Treating your AI-generated codebase like any other project, with regular commits and a readable history, makes it possible to roll back when an agent introduces a regression instead of losing hours of progress.

Start small: get a single playable mechanic working end to end before asking for procedural generation, boss systems, or meta progression. A vertical slice you can actually play tells you more in ten minutes than a thousand-word spec document ever will.

The real lesson from a 10,400-line, zero-asset roguelite isn't that anyone can now build a game in an afternoon. It's that the ceiling for what one motivated person can ship with the right tools and the right workflow just moved a lot higher — and most people haven't tested where that new ceiling actually sits yet.