Back/Engineering/Cursor/Claude
IntermediateEngineering

How to Iteratively Build a 3D Game from Scratch with an AI Coding Assistant

Build a 3D game as a sequence of playable slices, asking the coding assistant to explain unfamiliar graphics and networking choices, measuring each new behavior, and returning to a clean checkpoint when layered fixes obscure the coordinate or state model.

How to Iteratively Build a 3D Game from Scratch with an AI Coding Assistant

Cody describes starting his space flight game with a gray cube, adding star motion and controls one piece at a time, learning Three.js and GLTF model concepts as Cursor introduces them, diagnosing model orientation and camera errors, adding WebSocket multiplayer, and periodically simplifying when accumulated fixes drift from the goal.

Before you start

What you need

  • A one sentence game loop and a strict first playable scope
  • A clean repository, version control, run commands, and browser target
  • A coordinate, camera, input, asset, update loop, and performance plan
  • Licensed models, textures, sounds, and known native orientation or scale
  • A test matrix for controls, frame rate, resize, pause, network state, and cleanup

What you’ll make

A series of small playable builds that progress from scene and movement to imported assets and multiplayer, with each layer explained, tested, committed, and documented well enough for the owner to continue safely.

Tools used

Step by step

The workflow

Follow the sequence once, then adapt the prompts, checks, and handoffs to your own setup.

5 steps

Step01

Start with a Simple Prompt

Define the first playable in one sentence and ask the assistant for the smallest architecture: scene, renderer, camera, player, input, update loop, boundary, files, dependencies, and commands.

Example prompt
Plan the smallest playable version of [game loop] for the browser. Use [engine]. Define coordinate system, forward axis, update loop, input state, camera, boundary, files, dependencies, performance budget, and acceptance test. No networking, menus, progression, or polish yet.
Step02

Add Core Functionality Layer by Layer

Implement one layer at a time: scene and cube, movement, camera, feedback, boundary, then only the next behavior. Run and play each layer, measure frame rate, inspect the diff, and commit before continuing.

Example prompt
Add controls for movement using the W, A, S, and D keys. The ship should be able to pitch, yaw, and roll.
Step03

Integrate 3D Models and Learn as You Go

When importing GLTF or GLB assets, ask how loading, scene graphs, pivots, scale, materials, animation clips, and disposal work. Record the asset license and normalize its orientation in one root transform.

Example prompt
Import the licensed model at [path]. Inspect and report its native scale, pivot, bounding box, forward and up axes, materials, and animations. Normalize it in one root group without changing gameplay coordinates. Add loading, error, fallback, and disposal behavior, then explain the scene graph.
Step04

Debug Visual Issues with Precise Prompts

Describe visual bugs with screenshots plus numeric state: model world transform, camera position and target, axis helper, pressed keys, and expected versus actual direction. Fix the earliest incorrect transform instead of reversing later controls.

Example prompt
The imported ship model is loading sideways. The front of the ship should be facing forward, but it's currently oriented 90-degrees to the left. Please adjust the model's rotation upon loading to fix this.
Step05

Implement Advanced Features like Multiplayer

Add multiplayer only after the local game loop is stable. Define shared message types and server authority, build one join and movement slice, validate input, test several real clients and disconnects, and preserve offline or error behavior.

What good looks like

  • Each slice has one observable gameplay improvement and preserves the previous controls, camera, frame rate, and build.
  • Imported assets use explicit scale, pivot, forward axis, licensing, loading, and fallback behavior.
  • The owner can explain the render loop, transforms, input state, asset lifecycle, and multiplayer boundary introduced so far.
  • When an approach becomes tangled, the team restores a clean checkpoint and restates the core requirements instead of stacking compensating fixes.

Build your next product with ChatPRD

Turn an idea into a PRD, user stories, and a plan.

Try ChatPRD free

After the steps

Runbook notes

How to recover when the loop fails and where human judgment helps.

Recover

If it goes sideways

The assistant adds systems and polish before the movement loop is stable
Define the first playable and implement scene, player, input, camera, and boundary before optional features.
Model, camera, and physics transforms accumulate rotations that mask the real axis mismatch
Use debug axes and a transform hierarchy, document native asset orientation, and normalize it once at the model root.
New objects, listeners, animation loops, or network handlers leak and degrade frame rate
Measure frame time and memory, dispose resources, remove listeners, and maintain one controlled update loop.
The owner accepts unfamiliar libraries or generated code without understanding failure behavior
Ask for architecture and lifecycle explanations, read primary documentation, and add focused tests before expanding.
Several corrective prompts produce a fragile patchwork
Stop, summarize requirements and current failure, compare with the last clean commit, and rebuild the smallest faulty layer.

Start shipping
better products.

Join 100,000+ product managers who use ChatPRD to write better docs, align teams faster, and build products users love.

Free to start
No credit card
SOC 2 certified
Enterprise ready