Project notes for a Quick (three.js) game: layout, conventions and checks the AI crew works to
The notes every Quick (three.js) game on GameCrew AI starts with and every crew member reads: where code, levels, tuning and assets live, the conventions to keep, and the checks a change must pass.
- crew
- agents
- prompt
- project
- notes
- layout
- conventions
- template
The notes file every Quick (three.js) game on GameCrew AI starts with. The lead and every specialist get it after their own instructions, so the role prompts (ai-crew-lead and the others) refer to it as PROJECT.md. A game's own copy changes as the game does.
A three.js game (the studio's kit)
TypeScript in the browser. Assets/Game/ is yours; Assets/CCGD/ is the studio's (kit, page, test harness): read it, never change it.
### Layout
Assets/Game/main.tsexportsstart(game: Game), called once. Split the game into modules beside it (player.ts,hud.ts...), imported with.jsendings:import { Player } from './player.js'.- Imports:
'three','three/addons/<path>.js','three-mesh-bvh','ccgd'(the kit). Nothing else: no npm, no network. Assets/Game/Resources/Level/level.json: entities (id,type,pos,size,yawdegrees,props;viewsfor captures).Resources/tuning.json: knobs.Resources/Audio/<name>.wav: sounds.Textures/: textures.Models/: studio copies (don't write there).- Strict TypeScript, erasable syntax only: no
enum(use string unions oras const), nonamespace, no constructor parameter properties.
### The kit (import { ... } from 'ccgd')
game.scene(pre-lit studio PBR environment; overridescene.environmentif wanted),game.camera(PerspectiveCamera),game.renderer,game.enableBloom({ strength, radius, threshold }). One step isSTEP= 1/60 s, fixed.game.onUpdate(dt => ...)every step unless paused;game.onLateUpdateafter (cameras);game.onAlwayseven paused (menus).game.paused,game.frame,game.time.game.input:move{x right, y forward},look{x, y} radians,held(a),pressed(a),released(a). Actionsjump(Space) andpause(Esc, P) exist; add yours withinput.define({ dash: ['ShiftLeft'], interact: ['KeyE'] })(KeyboardEvent.code) and list in README Controls.input.buttons[0] = 'fire'maps a mouse button.input.lookEnabled = falsefor pointer games.- The UI:
new GameUI(game)(Assets/CCGD/kit/ui.ts):objective(label, text),meter(id, {label})→.set(0..1),counter(id, {total})→.set(n),toast(text),prompts([{keys, label}]), pause menu (onRestart(f)adds Restart) andshowEnd({title, stats, primary}). Themed fromAssets/Game/Resources/ui-theme.json. Use it for standard pieces; custom UI goes insideui.root(classgu) using theme CSS vars (--panel,--panelc,--edge,--text,--muted,--accent,--good,--bad,--r,--s; sizes--fl,--fb,--fh,--fH) and classesgu-panel,gu-label, so it takes the theme'sstyle. Never system fonts, hand-picked colours or fixed px sizes. game.level(typedLevel),ofType(level, 'pickup'),prop(entity, 'material', 'Stone').game.tuning.value('moveSpeed', 6.5): read where used, every time.game.audio.play('jump', { volume, pitch }),game.audio.loop('ambience', { volume })→{ stop, setVolume },game.audio.has(name),plays(name).game.models.place(name, parent, position, yawDegrees, height)→Promise<Placed | undefined>(root,clips,mixer,play(clip)).game.models.names().game.url('Assets/Game/Textures/x/tile.png')for project files. Reuse existing game and library assets first; make only what nothing fits (withreason), never duplicating an asset unless asked.game.log(type, detail): event (game.count(type)in tests). Log pickup, hit, death, win.game.expose('player', player): reachable in tests/probe (t.game.get<Player>('player')).CollisionWorld: capsule characters vs boxes & BVH meshes (slopes, stairs, GLBs).add(center, size, yawRad, tag),moveBox(box, center, yaw)(moving platforms),addMesh(obj, tag),addTrigger(center, size, tag)+triggersAt(ch),raycast(origin, dir, maxDist),move(ch, dt).game.xr: VR (headset session, hands, locomotion, panels in the world). Only for a VR game: readAssets/CCGD/VR.mdfirst.game.net: multiplayer rooms, peers, 60 Hz interpolated avatars, host state and events. Only for a multiplayer game: readAssets/CCGD/NET.mdfirst.game.touchOwner/game.onTouchOwner(f):'game'when the page hands a phone's touches to your own touch layout.scores(game.scores):submit(value, board?),top(board?).
Tests (Assets/Game/Tests/unit/*.test.ts, Assets/Game/Tests/play/*.test.ts)
import { test } from 'ccgd';
test('jump leaves the ground', async (t) => {
const p = t.game.get<Player>('player')!;
await t.until(() => p.grounded, 2);
t.game.input.simTap('jump');
await t.seconds(0.3);
t.gt(p.position.y, 0.5, 'in the air');
});
- Each play test gets a fresh game; time runs as fast as the machine allows (60 steps a second of game time).
t.steps(n),t.seconds(s),t.until(pred, s); assertst.ok,t.eq,t.gt,t.lt,t.near. Unit tests havet.level, no game. - Sim input:
input.simMove(x, y),simLook(px, py),simHold(a),simRelease(a),simTap(a)(one step),simClear(). - Any error the game logs fails the test. The studio's explorer (Assets/CCGD/tests) plays with random input too.
Using it in your own assistant
This is reference material: the instructions GameCrew AI's own crew runs with on a Quick (three.js) game, as the studio's code has them today. Copy what fits into an agent definition of your own and change it to suit your project. The tools it names are the studio's; over the studio's connection for assistants the same steps have the same names where they exist (compile, scene, test, capture). What the instructions say the studio refuses or checks is enforced by the studio itself, not by the wording, so in your own set-up those rules hold only as far as your assistant follows them.
Where it comes from
- GameCrew AI: the project template each game starts from
Playable Three.js games made with GameCrew
Launch a real browser build using this engine and inspect its controls or fork its project tree.
More of the AI crew on Three.js
How the AI crew builds a Quick (three.js) game: the set-up and the lead's prompt →
GameCrew AI's own multi-agent set-up for Quick (three.js): one lead, 16 specialist roles, the task brief every hand-over opens with, how tasks run side by side on their own files, and the lead's full system prompt.
AI & encounter designer: the AI crew's Quick (three.js) role prompt →
The ai & encounter designer role on GameCrew AI's crew for Quick (three.js): Designs and builds enemy, companion, creature and NPC AI plus encounter pacing: readable telegraph-commit-recovery loops, context steering and patrol paths, squad attacker tokens, Design/ai.md, tuning knobs, and tests proving fair counterplay.
Animator: the AI crew's Quick (three.js) role prompt →
The animator role on GameCrew AI's crew for Quick (three.js): Fixes and tunes character and creature motion: clips, Animator setup, procedural animation code. Checks motion with record_test and animation_sheet. Plans custom motion the stock clips lack as keyframe sheets (animation_keyframes).
Asset artist: the AI crew's Quick (three.js) role prompt →
The asset artist role on GameCrew AI's crew for Quick (three.js): Makes the game's visual assets: concept art, 3D models (library first, then generated), process_model for game-ready models, textures for the big surfaces, rigging and clips for characters. Checks every turntable and tile. Spends from the game's asset budget.
Use verified techniques inside a real game
Describe your game idea for free or connect an MCP assistant to search and contribute techniques.
