Back/Engineering/Claude/Claude Code
AdvancedEngineering

How to Speedrun a 3D Multiplayer Game Prototype in 15 Minutes with Claude Code CLI

Speedrun a small multiplayer flight prototype by fixing the minimum scene and control contract, getting one local player working, adding an authoritative WebSocket loop in a separate workstream, and testing synchronization and failure behavior before adding polish.

How to Speedrun a 3D Multiplayer Game Prototype in 15 Minutes with Claude Code CLI

Cody initializes a project with Claude Code, asks for a polygon style Three.js flight simulator with movement, banking, and pitch controls, runs the first build, diagnoses reversed orientation and controls, starts an Express and WebSocket multiplayer server in parallel, and tests several connected players within the live demo.

Before you start

What you need

  • A clean repository with documented client and server commands
  • A minimal flight model: coordinate system, forward axis, controls, camera, speed, and boundaries
  • Three.js plus a licensed low polygon model with known orientation and scale
  • A multiplayer contract for join, input, state, disconnect, identity, and tick rate
  • Two or more browser clients plus latency, reconnect, malformed message, and cleanup tests

What you’ll make

A local multiplayer prototype where several clients join, move distinct aircraft, see synchronized state, disconnect cleanly, and recover from common errors, with known hacks and production gaps clearly recorded.

Tools used

Step by step

The workflow

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

6 steps

Step01

Project Setup and AI Initialization

Initialize the repository and have Claude Code inspect the framework, scripts, and structure. Create a concise project guide with client and server commands, file boundaries, coordinate conventions, and checks.

Example prompt
npm create vite@latest your-game-name -- --template react
cd your-game-name
claude init --yolo
Step02

Provide the Initial Creative Prompt

Specify the smallest flight loop: Three.js scene, licensed low polygon aircraft, coordinate system, forward axis, controls, camera, speed, world boundary, and visual feedback.

Example prompt
Build the first local slice of a low polygon Three.js flight simulator. Coordinate system: [axes and forward]. Controls: [mapping]. Camera: above and behind the model. Implement movement, bank, pitch, speed, boundary, and a debug axis helper. Use the licensed model at [path] and document its native orientation and transform. No multiplayer yet.
Step03

Run and Debug the First Version

Run the first version and debug behavior with observable facts such as axis direction, model transform, camera position, and input mapping. Fix one coordinate issue at a time and keep the debug helper until flight is correct.

Example prompt
It looks like my camera is facing the front of the model... we should be looking should be fixed to the tail of the plane. All of my flight controls are reversed. Now we should fix that. I also want the camera to be slightly above and behind the model.
Step04

Build the Multiplayer Backend in Parallel

Create a separate server workstream with Express and WebSockets after the local loop works. Define shared message types and a thin join, input, state, and disconnect protocol before building more features.

Example prompt
In the `server` directory, build a multiplayer backend for my game.

Use Node.js, Express, and Socket.io.

The server must handle the following:
- Player connections and disconnections.
- Broadcasting player movement data to all connected clients.
- [Describe any additional features, like a chat system or player list].

Generate all necessary files and install dependencies.
Step05

Prompt the Backend AI

Ask the backend agent to assign player IDs, validate bounded input messages, run a fixed tick, broadcast accepted state, and remove disconnected or timed out players.

Example prompt
Implement the multiplayer server for this protocol: [shared types]. The server assigns IDs, validates message schema, size, rate, numeric ranges, and sequence, updates authoritative state at [tick rate], broadcasts snapshots, and cleans up disconnects and heartbeat timeouts. Add tests for malformed messages, duplicate joins, abrupt disconnect, and reconnect.
Step06

Launch and Test the Multiplayer Prototype

Launch server and at least two independent browser clients. Test distinct identities, movement, visibility, disconnect, reconnect, latency, cleanup, and malformed traffic, then record known limitations before adding chat, persistence, or public hosting.

What good looks like

  • The single player scene has correct forward, camera, banking, pitch, boundaries, and control mapping before networking begins.
  • The server validates message type, identity, rate, range, and size, and clients do not authoritatively set arbitrary world state.
  • Multiple real browser clients remain acceptably synchronized through join, movement, disconnect, reconnect, and idle cleanup.
  • Client and server changes remain isolated enough to inspect and combine, and the final repository starts from documented commands without hidden manual steps.

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 model, camera, and controls use different definitions of forward
Draw the coordinate contract, inspect model axes and transforms, add a debug helper, and fix the root transform before reversing controls piecemeal.
Parallel client and server agents implement incompatible message shapes
Write the protocol and shared types first, keep work in separate branches or directories, and integrate through one thin vertical slice.
Clients can spoof identity, position, speed, or arbitrary messages
Validate and rate limit inputs server side, assign identities on the server, and keep the server authoritative over accepted state.
Disconnected players or sockets remain visible and consume resources
Implement heartbeat, timeout, disconnect cleanup, bounded state, and tests for abrupt tab close and reconnect.
The 15 minute result is mistaken for an internet ready game
Document missing authentication, abuse controls, persistence, scaling, observability, accessibility, security, and load testing.

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