Crate Engine Documentation

Build 3D games by typing natural language commands. 6,218 real 3D models, 27+ world recipes, real-time physics, multiplayer, and AI-powered creation — all in your browser.

AI-First Creation

Type "build cyberpunk city" and get a playable 3D world in seconds. No coding required.

Rapier Physics NEW

Real rigid-body simulation powered by Rust/WASM. Objects fall, bounce, and collide realistically.

6,218 3D Models

Characters, weapons, buildings, vehicles, trees, furniture — all ready to drop into your scene.

Multiplayer

WebSocket rooms with player sync, chat, and shared building.

Quick Start

Open crateshipgames.com/play.html and type commands in the prompt bar at the bottom:

add tree                 — drops a 3D tree into the scene
add castle               — places a castle model
build medieval village   — generates a full village with NPCs
play                     — enter first-person play mode (WASD + mouse)
exit                     — return to editor mode

Architecture

ModulePurpose
engine.mjsCore renderer, scene graph, command system, HUD, world builder
character.mjsPlayer controller, NPCs, animation state machine, combat
physics.mjsRapier 3D rigid-body physics (WASM) NEW
ai-agent.mjsAI chat interface, 27+ world recipes, NPC behavior
godmode.mjsRuntime effect injection, visual FX
collision.mjsOctree capsule collision (player movement)
sound.mjsProcedural Web Audio (tones, music, SFX)
multiplayer-colyseus.mjsColyseus room bridge and shared state sync
voice-commands.mjsWeb Speech API, 50K+ NLP phrase variations
mobile.mjsVirtual joystick, touch buttons

Objects & Models

CommandDescription
add [model]Add a 3D model. e.g. add car, add house, add sword
add [model] at [x] [z]Add at specific coordinates. e.g. add tree at 10 5
remove [name]Remove an object by name
scale [name] [n]Scale object. e.g. scale castle 2
rotate [name] [deg]Rotate object. e.g. rotate house 90
move [name] to [x] [z]Move object to coordinates
color [name] [color]Change material color. e.g. color car red
clone [name]Duplicate an object
clearRemove all objects
browse [category]Open model gallery. Categories: characters, weapons, buildings, vehicles, nature, furniture

World Building

CommandDescription
build cityGenerate a full procedural city with roads, buildings, traffic, pedestrians
build medieval villageCozy village with tavern, church, houses, NPCs
build cyberpunk cityNeon-lit streets, skyscrapers, holographic signs
build castleCastle with walls, towers, courtyard, guards
build pirate portDocks, ships, tavern, cannon emplacements
build forestDense procedural forest with lakes
build space baseSci-fi corridors, landing pads, alien flora
build zombie wastelandDestroyed buildings, barricades, zombie NPCs
build dungeonUnderground chambers, torches, traps
build arenaColosseum-style fighting ring with spectators
build modern cityContemporary buildings, parks, vehicles
set ground [type]grass, sand, snow, lava, asphalt, dirt, stone, water
set terrain [type]flat, hills, mountains, canyon, island, dunes, volcano, mesa

All 27 World Recipes

Type build [name] for any of these:

medieval village    medieval town    medieval city    fantasy town
castle             castle town      pirate port      pirate island
farm               forest camp      desert town      fishing village
mountain settlement market district  military fort    cyberpunk city
space base         zombie wasteland post-apocalyptic frozen tundra
horror             dungeon          jungle           dinosaur valley
underwater ruins   modern city      arena

Characters & NPCs

CommandDescription
add npc [type]Spawn NPC. Types: knight, soldier, woman, man, robot, guard
add [n] npcsSpawn multiple NPCs. e.g. add 5 npcs
select character [name]Change player character for play mode
animate [name] [anim]Play animation: idle, walk, run, attack, dance, wave, etc.

Combat & Weapons

CommandDescription
equip [weapon]Equip weapon to character. e.g. equip sword
shooter modeEnable FPS shooting controls

Play mode controls: Left-click to attack/shoot, R to reload, Shift to sprint.

Environment

CommandDescription
set weather [type]rain, snow, clear, storm, overcast, fog
set time [period]dawn, morning, noon, afternoon, sunset, night
set fog [level]none, light, heavy
add waterAdd water plane to scene
add lightAdd point light at cursor position

Camera & View

CommandDescription
playEnter first-person play mode (pointer lock + WASD)
exitReturn to editor/orbit mode
screenshotCapture viewport as PNG
photo modeToggle cinematic photo mode

Scene Management

CommandDescription
saveSave scene to browser storage
loadShow saved scenes list
shareGenerate shareable URL with scene data
undoUndo last action
redoRedo undone action
export htmlExport as standalone HTML file
export unityExport scene as GLTF for Unity
export unrealExport scene as GLTF for Unreal Engine

Physics Engine (Rapier 3D) NEW

Crate Engine integrates Rapier 3D — a high-performance rigid-body physics engine written in Rust, compiled to WebAssembly. Objects gain realistic gravity, collisions, bouncing, and impulse forces.

Using Physics in the Editor

Click any object to open the Inspector panel, then click "Add Physics". The object becomes a dynamic rigid body that falls under gravity and collides with other physics objects and the ground.

Scripting API

// Access the physics module
const phys = window._physics;

// Initialize (loads Rapier WASM — call once)
await phys.init();

// Make an object physical
phys.addRigidbody(myMesh, 'dynamic');   // falls under gravity
phys.addRigidbody(wall, 'static');      // immovable collider
phys.addRigidbody(platform, 'kinematic'); // script-controlled

// Apply forces
phys.applyImpulse(myMesh, 0, 20, 0);   // launch upward
phys.applyForce(myMesh, 10, 0, 0);     // push right

// Remove physics
phys.removeRigidbody(myMesh);

// Query
phys.isReady();    // true after init()
phys.bodyCount();  // number of active physics bodies
phys.clear();      // remove all physics bodies

Physics Types

TypeBehaviorUse Case
dynamicAffected by gravity, forces, collisionsCrates, barrels, NPCs, vehicles
staticImmovable, other objects collide with itWalls, floors, terrain
kinematicMoved by script, pushes dynamic objectsMoving platforms, elevators, doors

Animation System

Crate Engine supports skeletal animation via Three.js AnimationMixer with automatic Mixamo retargeting.

Available Animations

Locomotion:  idle, walk, run, sprint, strafe_left, strafe_right, crouch
Combat:      attack, slash, parry, block, dodge, cast_spell
Emotion:     celebrate, sad, angry, happy, agree, disagree
Special:     swim, climb, fall, glide, dance, point, wave

Audio System

Fully procedural — no audio files needed. All sound is synthesized via Web Audio API.

CommandDescription
set music [mood]peaceful, action, mysterious, horror, epic
set ambient [type]forest, desert, underwater, city, cave
mute / unmuteToggle all audio

Multiplayer

Click the globe icon to open the multiplayer lobby. Supports WebSocket rooms with:

AI Build Agent AI

The AI agent interprets natural language and builds worlds. It works locally with zero API keys for built-in commands. For advanced LLM-powered interpretation, add an OpenRouter key in Settings.

// Examples of natural language commands:
"make a spooky haunted house with fog"
"create a racing track with 3 cars"
"build me a village with a tavern and 10 villagers"
"add a dragon flying over the castle"

Scripting API

Access engine internals via window._engineBridge:

const engine = window._engineBridge;

// Load a 3D model
engine.loadGLBModel('car', 'car', 5, 0);

// Access the Three.js scene
const scene = engine.scene;
const camera = engine.camera;
const renderer = engine.renderer;

// Run a text command programmatically
engine.exec('add tree at 10 5');

// Get all scene objects
const objects = engine.getObjects();

// Physics (NEW)
const phys = window._physics;
await phys.init();
phys.addRigidbody(objects[0], 'dynamic');

Keyboard Shortcuts

KeyEditor ModePlay Mode
WASDMove character
SpaceJump
ShiftSprint
EInteract / Pickup
RReload weapon
FEnter door / vehicle
VVoice commandVoice command
EnterFocus command bar
EscapeDeselectPause menu
DeleteDelete selected object
?Show help
/Focus command bar
`Toggle FPS counterToggle FPS counter
Ctrl+ZUndo
Ctrl+YRedo

Voice Commands

Click the microphone button or press V to activate voice input. Crate Engine supports 50,000+ phrase variations with fuzzy matching.

// Examples:
"add a big red castle"
"make it rain"
"spawn ten soldiers"
"build me a dungeon"
"play mode"

Export & Share

FormatCommandDescription
Share URLshareCompressed scene in URL — anyone can remix
Standalone HTMLexport htmlSelf-contained HTML file with Three.js
Unity (GLTF)export unityGLTF scene file for Unity import
Unreal (GLTF)export unrealGLTF scene file for Unreal Engine import
ScreenshotscreenshotPNG capture of current viewport

Crate Engine v1.0 — Built by Jamaine Martin

Open Engine | GitHub