Back/Engineering/Cursor/Claude
IntermediateEngineeringCursorClaude

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

Learn to build a complex 3D multiplayer game, even with no prior game development experience. This workflow guides you through an iterative process of using an AI assistant like Cursor and Claude as a junior developer to go from a simple concept to a functional prototype.

From How I AI

How I AI: Speedrun a 3D Multiplayer Game in 15 Minutes with Cody De Arkland

with Claire Vo

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

Tools Used

Cursor

AI-first code editor

Claude

Anthropic AI assistant

Step-by-Step Guide

1

Start with a Simple Prompt

Begin by giving your AI assistant in an IDE like Cursor a high-level prompt to generate the basic structure of your game. Don't aim for perfection; start with a minimal viable concept, like a gray cube on a starry background.

2

Add Core Functionality Layer by Layer

Iteratively add features by prompting the AI. For example, ask it to add movement controls (W, A, S, D). This forces you and the AI to start solving core challenges like 3D physics and user input handling.

Prompt:
Add controls for movement using the W, A, S, and D keys. The ship should be able to pitch, yaw, and roll.
3

Integrate 3D Models and Learn as You Go

Find a 3D model from a source like SketchFab. Ask your AI assistant to write the code to import the model (e.g., in GLTF or GLB format). Use this opportunity to ask the AI to explain the underlying technology, such as how 3D model loaders work in Three.js.

Prompt:
How do I import a GLTF model into my Three.js scene and replace the gray cube with it? Also, explain how the GLTFLoader works.
4

Debug Visual Issues with Precise Prompts

When you encounter visual bugs, like a model facing the wrong way, describe the problem and the desired outcome to the AI with as much detail as possible. Being specific is key to solving complex visual and orientation issues.

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.
5

Implement Advanced Features like Multiplayer

Once the single-player experience is solid, ask the AI for the best way to implement multiplayer functionality. It might suggest options like WebSockets. Have the AI generate the server and client code, and then ask it to review its own implementation to catch potential bugs, race conditions, or optimization issues.

Pro Tip: Treat the AI as a code reviewer. After it generates a complex piece of logic, ask it: 'Can you review this code for any potential issues or race conditions?'

Become a 10x PM.
For just $5 / month.

We've made ChatPRD affordable so everyone from engineers to founders to Chief Product Officers can benefit from an AI PM.