Build Immersive 3D Games & Robotics
Everything you need to create multiplayer 3D WebXR games, digital twins, and robotic embodiment on the GoSiteMe platform — rendering, voice chat, AI agents, leaderboards, VR, spatial audio, and ROS 2 bridge — all pre-built in one SDK.
Everything Built In
20 production-ready modules. Use what you need, skip what you don't.
Scene Manager
Three.js scene, camera, renderer, raycasting, shadow maps, fog, and render loop — configured in one call. Supports system-based architecture with addSystem().
Camera System
Orbit, fixed, cinematic, top-down, and WASD free-walk — all built-in as presets. Cycle modes, scroll-zoom, and build custom modes with the same interface.
Multiplayer (WebSocket)
Channel-based pub/sub with auto-reconnect. Spectator presence system, message broadcasting, and multi-channel subscriptions out of the box.
Voice Room (WebRTC)
Full mesh WebRTC voice chat with ICE/STUN/TURN, mute/deafen, speaking detection, and automatic peer lifecycle management. Uses your multiplayer channel for signaling.
AI Worker Manager
Spawn Web Workers for AI computation. Promise-based command/response pattern with timeouts. Works with any AI engine — chess engines, pathfinding, NPC brains.
Agent & Avatar System
Define game agents with personality traits. Auto-generate 2D canvas avatars and 3D holographic busts. Built-in Alfred AI chat integration for NPC conversations.
Audio Engine
Web Audio API synthesized sounds — no audio files needed. 5 built-in presets (move, capture, alert, victory, draw), ambient drones, and a sound registration system.
Leaderboard & ELO
Full ELO rating system with K-factor calculation. Register matches, report results, fetch rankings. Client-side ELO preview for instant feedback.
Achievements
Define and unlock achievements with localStorage persistence. Event-driven popup notifications. Track unlock status across sessions.
Theme Engine
Register unlimited visual themes with custom colors, materials, and fog settings. Hot-swap themes at runtime with event-driven updates.
WebXR Manager
Enter immersive VR with controller support. Trigger, grip, and squeeze events. Feature detection for graceful fallback on non-VR devices.
Mobile Input
Virtual joystick with configurable threshold. Auto-detected on touch devices. Emits normalized directional events for camera or character movement.
Particles & Effects
Ambient particle field with drift animation. Burst particle effects, victory fountains, and arc-motion animations — all GPU-friendly.
UI System
Toast notifications, panel toggles, modal management. Complete CSS design system included in the starter template — HUD, buttons, badges, settings, leaderboard.
RobotBridge v3.0
WebSocket bridge to ROS 2 and hardware controllers. Send velocity commands, read joint states, and subscribe to sensor topics in real time from the browser.
SensorManager v3.0
Real-time sensor data visualization for LIDAR point clouds, IMU orientation, camera feeds, and depth maps — rendered directly in the Three.js scene.
DigitalTwinSystem v3.0
Synchronize a 3D avatar with a physical robot's state. Joint angles, sensor readings, and actuator positions update in real time for monitoring and simulation.
TeleoperationSystem v3.0
Remote control with latency compensation, dead-reckoning prediction, and safety bounds. Operate physical robots from anywhere using keyboard, gamepad, or VR controllers.
AutonomyEngine v3.0
Goal-based autonomous decision-making powered by Alfred AI. Define objectives, let the engine plan actions, and monitor execution with full override capability.
ProximityAudio v3.0
Spatial audio with distance-based attenuation. Sound sources attached to 3D objects get louder as the listener approaches — perfect for immersive VR and multiplayer.
How It Fits Together
The SDK orchestrates 20 modules through a single entry point. Add what you need.
Up and Running in Minutes
1. Include the SDK
<!-- Three.js (required) --> <script src="/assets/js/vendor/three.r128.min.js"></script> <!-- GoSiteMe Game Engine SDK --> <script src="https://gositeme.com/sdks/game-engine/gositeme-game-engine.js"></script>
2. Create Your Game
const game = new GoSiteMeGame({ name: 'My Awesome Game', slug: 'my-game', scene: { background: 0x0a0a14, fogDensity: 0.03, shadows: true, camera: { fov: 50, position: [0, 8, 12] } }, cameraModes: [ GoSiteMeGame.CameraSystem.presets.orbit({ radius: 12 }), GoSiteMeGame.CameraSystem.presets.cinematic(), GoSiteMeGame.CameraSystem.presets.freeWalk(), ], wsChannel: 'vr:my-game', voiceChat: true, vr: true, mobile: true, }); game.start();
3. Add Your Game Logic
// Add a 3D object const cube = new THREE.Mesh( new THREE.BoxGeometry(1, 1, 1), new THREE.MeshStandardMaterial({ color: 0x6c5ce7 }) ); game.scene.scene.add(cube); // Animate every frame game.scene.on('tick', (dt, elapsed) => { cube.rotation.y += dt; }); // Handle clicks with raycasting document.addEventListener('click', (e) => { const hits = game.scene.raycast(e.clientX, e.clientY, [cube]); if (hits.length > 0) { game.audio.play('capture'); GoSiteMeGame.Animate.burst(game.scene.scene, cube.position); game.ui.toast('Hit!'); } }); // Broadcast moves to spectators game.multiplayer.publish({ type: 'move', data: { x: 1, z: 3 } });
4. Start from the Full Template
Download template.html — a complete game boilerplate with the full UI design system (loading screen, mode selector, HUD, event log, settings, leaderboard, voice room, agent avatars, screen effects) already wired up to the SDK. Just add your game logic.
Complete API Reference
Every class, method, and event in the SDK.
GoSiteMeGame — Main Orchestrator
The primary entry point. Instantiate with your configuration and call start().
| Config Property | Type | Description |
|---|---|---|
name | string | Game title |
slug | string | Unique game ID for API calls |
container | HTMLElement | DOM element for the renderer |
scene | Object | SceneManager options: background, fogDensity, shadows, camera |
cameraModes | Array | Array of camera mode configs (see CameraSystem) |
themes | Object | Theme definitions for ThemeEngine |
agents | Array | Agent definitions (name, color, elo, depth, style, traits) |
aiWorkerUrl | string | URL to your AI worker script |
wsChannel | string | WebSocket channel for multiplayer |
voiceChat | boolean | Enable WebRTC voice room |
vr | boolean | Enable WebXR |
mobile | boolean | Enable mobile virtual joystick |
particles | Object|false | Particle field config or false to disable |
lighting | Object | Lighting preset options (accent colors, intensities) |
Methods
| Method | Returns | Description |
|---|---|---|
start() | Promise | Initialize everything, start render loop |
destroy() | void | Clean shutdown of all systems |
Events
| Event | Args | Description |
|---|---|---|
'ready' | — | All systems initialized, render loop running |
'vr-support' | (supported: boolean) | WebXR availability detected |
'destroyed' | — | All systems shut down |
Properties
| Property | Type | Description |
|---|---|---|
.scene | SceneManager | 3D scene, camera, renderer |
.camera | CameraSystem | Camera mode management |
.audio | AudioEngine | Sound synthesis |
.ui | UISystem | Toast, panel, modal |
.themes | ThemeEngine | Theme management |
.achievements | AchievementSystem | Achievement tracking |
.agents | AgentSystem|null | Agent management (if agents configured) |
.ai | AIWorkerManager|null | AI workers (if aiWorkerUrl configured) |
.multiplayer | MultiplayerSystem|null | WebSocket (if wsChannel configured) |
.voice | VoiceRoom|null | Voice chat (if multiplayer + voiceChat configured) |
.xr | WebXRManager|null | VR (if vr configured) |
.mobile | MobileInput|null | Mobile controls (if mobile configured) |
.leaderboard | LeaderboardSystem | Rankings and ELO |
.particles | ParticleField|null | Ambient particles |
SceneManager
Wraps Three.js scene, camera, renderer, and render loop. Supports ECS-style systems.
| Method | Args | Description |
|---|---|---|
addSystem(sys) | Object with update(dt, elapsed) | Register a system for the render loop |
start() | — | Begin the render loop |
stop() | — | Pause the render loop |
raycast(x, y, objects) | screenX, screenY, Array | Raycast from screen coords, returns intersections |
destroy() | — | Dispose renderer, geometries, materials |
Events
| Event | Args | Description |
|---|---|---|
'tick' | (dt, elapsed) | Fired every frame with delta time and total elapsed |
'resize' | (width, height) | Window resized |
'started' | — | Render loop started |
Properties
| Property | Type | Description |
|---|---|---|
.scene | THREE.Scene | The Three.js scene |
.camera | THREE.PerspectiveCamera | The main camera |
.renderer | THREE.WebGLRenderer | The WebGL renderer |
.raycaster | THREE.Raycaster | Built-in raycaster |
CameraSystem
Manages multiple camera modes with scroll-zoom and smooth transitions.
| Method | Description |
|---|---|
addMode(mode) | Register a camera mode object |
setMode(indexOrName) | Jump to a mode by index or name |
next() | Cycle to the next mode |
Built-in Presets
| Preset | Usage | Description |
|---|---|---|
presets.orbit(opts) | { radius, height, speed, lookAt } | Auto-rotating orbit |
presets.fixed(name, pos, lookAt) | Arrays [x,y,z] | Static camera at fixed position |
presets.cinematic(opts) | { radius, height } | Slow swooping orbit with variable radius |
presets.topDown(height) | number | Bird's-eye view straight down |
presets.freeWalk(opts) | { speed, yaw, pitch } | WASD + mouse first-person movement |
AudioEngine
Synthesized sound effects using Web Audio API. No audio files needed.
| Method | Description |
|---|---|
init() | Create AudioContext (call from user gesture) |
registerSound(name, fn) | Register a sound synthesizer function fn(ctx, dest) |
play(name) | Play a registered sound by name |
startAmbient(opts) | Start ambient drone: { frequency, volume, type, harmonic } |
toggle() | Toggle mute. Returns new state. |
Presets: AudioEngine.presets
| Preset | Description |
|---|---|
.move | Short click / move sound |
.capture | Impact / capture |
.alert | Warning / check double-beep |
.victory | Ascending victory fanfare |
.draw | Descending draw sound |
MultiplayerSystem
WebSocket pub/sub with auto-reconnect and spectator presence.
| Method | Description |
|---|---|
connect() | Connect to WebSocket and join channel |
publish(data) | Broadcast data to all channel subscribers |
subscribe(channel) | Subscribe to an additional channel |
disconnect() | Close connection |
Events
| Event | Args | Description |
|---|---|---|
'connected' | — | WebSocket connected and subscribed |
'disconnected' | — | Connection lost (auto-reconnects in 5s) |
'message' | (data, channel) | Data received from any subscribed channel |
'spectator-count' | (count) | Spectator presence count updated |
VoiceRoom
WebRTC mesh voice chat using the multiplayer channel for signaling.
| Method | Description |
|---|---|
join() | Request mic access and join voice room |
leave() | Leave voice room and stop all streams |
toggleMic() | Toggle mute/unmute (joins if not joined) |
toggleDeafen() | Toggle deafen for all peers |
Events
| Event | Args | Description |
|---|---|---|
'joined' | — | Successfully joined voice room |
'left' | — | Left voice room |
'peer-joined' | (peerId, name) | A peer joined |
'peer-left' | (peerId) | A peer left |
'peer-audio' | (peerId, stream) | Received audio stream from peer |
'peer-mute' | (peerId, muted) | Peer toggled mute |
'mic-toggle' | (isMuted) | Local mic toggled |
'deafen-toggle' | (isDeafened) | Local deafen toggled |
AIWorkerManager
Manage Web Workers for AI computation with promise-based communication.
| Method | Description |
|---|---|
spawn(name, configCmds) | Create a named worker with init + config commands |
query(name, cmds, matchFn) | Send commands and await response matching matchFn(msg) |
terminate(name) | Terminate a named worker |
terminateAll() | Terminate all workers |
// Spawn a Stockfish-compatible engine game.ai.spawn('engine', ['uci', 'setoption name Skill Level value 10']); // Query for best move const result = await game.ai.query( 'engine', ['position fen ...', 'go depth 12'], (msg) => typeof msg === 'string' && msg.startsWith('bestmove') );
AgentSystem
AI opponent personality, avatars, and chat integration.
| Method | Description |
|---|---|
get(name) | Get agent by name |
random() | Pick a random agent |
randomN(n) | Pick N unique random agents |
renderAvatar(canvas, agent, size) | Render 2D avatar to a canvas element |
createHoloBust(agent) | Create 3D holographic bust (returns THREE.Group) |
chat(agentName, message, convId) | Send message to agent via Alfred API (returns Promise) |
LeaderboardSystem
ELO ratings, match tracking, and rankings via the GoSiteMe API.
| Method | Description |
|---|---|
fetch() | Get leaderboard data from API |
registerMatch(p1, p2) | Register a new match. Returns match_id. |
reportResult(matchId, status, opts) | Report result for ELO calculation |
eloChange(elo, oppElo, score, K) | Static: calculate ELO change (client preview) |
AchievementSystem
Define, track, and unlock achievements with localStorage persistence.
| Method | Description |
|---|---|
define(id, opts) | Define an achievement: { name, description, icon } |
unlock(id) | Unlock an achievement. Returns false if already unlocked. |
isUnlocked(id) | Check if achievement is unlocked |
getAll() | Get all definitions with unlock status |
Events
| Event | Args | Description |
|---|---|---|
'unlocked' | (definition) | Achievement unlocked — show popup UI here |
WebXRManager
Enter immersive VR with controller input events.
| Method | Description |
|---|---|
isSupported() | Check if immersive-vr is available (async) |
enter() | Enter VR session with controller setup (async) |
exit() | End VR session |
Events
| Event | Args | Description |
|---|---|---|
'enter' | — | Entered VR |
'exit' | — | Exited VR |
'trigger' | (controller, state) | Controller trigger (0=left, 1=right, start/end) |
'grip' | (controller, state) | Controller grip button |
Animate & Effects
Static helper methods for animations and particle effects.
| Method | Args | Description |
|---|---|---|
Animate.arc(obj, target, opts) | Three.js object, {x,z}, {arcHeight, duration} | Move object in arc to target (returns Promise) |
Animate.burst(scene, pos, opts) | THREE.Scene, Vector3, {count, color, lifetime} | Burst particle effect at position |
Animate.victory(scene, opts) | THREE.Scene, {count, colors, lifetime} | Multi-color victory fountain |
ParticleField
| Config | Default | Description |
|---|---|---|
count | 500 | Number of particles |
spread | 30 | Spread radius |
size | 0.08 | Point size |
color | 0x7D00FF | Particle color |
opacity | 0.4 | Particle opacity |
drift | 0.002 | Vertical drift speed |
ThemeEngine
Register unlimited visual themes and hot-swap at runtime. Themes define colors, materials, fog, and lighting.
| Method | Returns | Description |
|---|---|---|
register(name, definition) | void | Register a named theme with colors, fog, material overrides |
apply(name) | void | Apply a registered theme — updates scene, materials, fog, lighting |
current() | string | Returns name of the currently active theme |
list() | string[] | Returns array of all registered theme names |
Theme Definition
| Property | Type | Description |
|---|---|---|
background | number | Scene background color (hex) |
fog | number | Fog color (hex) |
fogDensity | number | Fog density (0–1) |
accent | number | Primary accent color for materials |
ambient | number | Ambient light color |
ambientIntensity | number | Ambient light intensity |
Events
| Event | Args | Description |
|---|---|---|
'theme-changed' | (name: string, def: Object) | Emitted after a theme is applied |
MobileInput
Virtual joystick with configurable threshold. Auto-detected on touch devices. Emits normalized directional events.
| Config | Default | Description |
|---|---|---|
threshold | 0.15 | Dead zone threshold (0–1) before input registers |
size | 120 | Joystick visual diameter in pixels |
position | 'bottom-left' | Joystick anchor position on screen |
Events
| Event | Args | Description |
|---|---|---|
'joystick-move' | {x: number, y: number} | Normalized direction vector (−1 to 1) |
'joystick-end' | — | Touch released, joystick reset |
RobotBridge v3.0
WebSocket bridge to ROS 2 and hardware controllers. Bi-directional communication with physical robots from the browser.
| Method | Returns | Description |
|---|---|---|
connect(url, options) | Promise | Connect to a ROS 2 bridge WebSocket endpoint |
subscribe(topic, callback) | void | Subscribe to a ROS topic (e.g. /joint_states, /scan) |
publish(topic, msg) | void | Publish a message to a ROS topic (e.g. /cmd_vel) |
callService(name, args) | Promise | Call a ROS service and await the response |
disconnect() | void | Gracefully close the ROS bridge connection |
Events
| Event | Args | Description |
|---|---|---|
'ros-connected' | — | Successfully connected to ROS bridge |
'ros-disconnected' | (reason: string) | Connection lost or closed |
'ros-error' | (error: Error) | Communication error |
SensorManager v3.0
Real-time sensor data visualization. Render LIDAR, IMU, cameras, and depth maps directly in the Three.js scene.
| Method | Returns | Description |
|---|---|---|
addSensor(id, type, config) | Sensor | Register a sensor: 'lidar', 'imu', 'camera', 'depth' |
update(id, data) | void | Push new sensor data for visualization |
removeSensor(id) | void | Remove sensor and clean up Three.js objects |
getSensor(id) | Sensor|null | Get sensor instance by ID |
setVisible(id, visible) | void | Toggle sensor visualization on/off |
Sensor Types
| Type | Visualization | Data Format |
|---|---|---|
'lidar' | 3D point cloud (BufferGeometry) | Float32Array of [x,y,z] points |
'imu' | Orientation indicator (axes helper) | {quaternion: [w,x,y,z], accel: [x,y,z]} |
'camera' | Texture plane in 3D space | ImageData or base64 JPEG |
'depth' | Color-mapped depth plane | Float32Array depth image |
DigitalTwinSystem v3.0
Sync a 3D model with a physical robot in real time. Joint angles, positions, and sensor overlays update live.
| Method | Returns | Description |
|---|---|---|
loadModel(url, config) | Promise<Model> | Load URDF or GLTF robot model into the scene |
setJointState(jointName, angle) | void | Update a named joint to a target angle (radians) |
syncFromROS(topic) | void | Auto-sync joint states from a ROS /joint_states topic |
setPosition(x, y, z) | void | Set the twin's world position |
highlight(jointName, color) | void | Highlight a joint with a color overlay for diagnostics |
getModel() | THREE.Group | Access the underlying Three.js model group |
Events
| Event | Args | Description |
|---|---|---|
'model-loaded' | (model: THREE.Group) | Robot model finished loading |
'joint-updated' | (name, angle) | A joint has been updated |
'sync-lost' | — | ROS sync data has not arrived within timeout |
TeleoperationSystem v3.0
Remote robot control with latency compensation and safety bounds. Supports keyboard, gamepad, and VR controllers.
| Method | Returns | Description |
|---|---|---|
enable(inputSource) | void | Enable teleoperation with 'keyboard', 'gamepad', or 'vr' |
disable() | void | Stop teleoperation and send zero-velocity command |
setSpeedLimit(linear, angular) | void | Set maximum linear (m/s) and angular (rad/s) velocities |
setSafetyBounds(bounds) | void | Define a bounding box the robot cannot leave |
emergencyStop() | void | Immediately halt all movement and disable input |
getLatency() | number | Current round-trip latency in milliseconds |
Events
| Event | Args | Description |
|---|---|---|
'teleop-enabled' | (source: string) | Teleoperation started with specified input source |
'teleop-disabled' | — | Teleoperation stopped |
'safety-limit' | (axis: string) | Robot reached a safety boundary |
'e-stop' | — | Emergency stop triggered |
'latency-warning' | (ms: number) | Latency exceeded threshold (default 200ms) |
AutonomyEngine v3.0
Goal-based autonomous decision-making powered by Alfred AI. Define objectives, monitor execution, override at any time.
| Method | Returns | Description |
|---|---|---|
setGoal(goal, params) | Promise<Plan> | Set a high-level goal; engine plans actions via Alfred AI |
execute(plan) | Promise | Execute a plan step by step with real-time feedback |
pause() | void | Pause autonomous execution (resumes where it left off) |
resume() | void | Resume paused execution |
abort() | void | Cancel current execution and reset state |
override(action) | void | Inject a manual action into the execution sequence |
getStatus() | Object | Current status: {goal, step, progress, state} |
Events
| Event | Args | Description |
|---|---|---|
'plan-ready' | (plan: Plan) | Alfred AI has generated an execution plan |
'step-complete' | (step, result) | One step of the plan completed |
'goal-achieved' | (goal, summary) | All steps completed successfully |
'goal-failed' | (goal, error) | Plan execution failed — requires human intervention |
ProximityAudio v3.0
Spatial audio with distance-based attenuation. Attach sound sources to 3D objects for immersive audio landscapes.
| Method | Returns | Description |
|---|---|---|
attachSource(id, object3d, config) | AudioSource | Attach a spatial audio source to a Three.js object |
play(id) | void | Start playback of an attached source |
stop(id) | void | Stop playback |
setListener(camera) | void | Set the listener position (usually the camera) |
removeSource(id) | void | Remove an audio source and clean up |
Source Config
| Property | Default | Description |
|---|---|---|
maxDistance | 50 | Distance at which volume reaches zero |
refDistance | 1 | Distance at which volume is 100% |
rolloffFactor | 1 | How quickly sound fades with distance |
loop | true | Whether the source loops |
volume | 1.0 | Base volume (0–1) |
coneInnerAngle | 360 | Inner cone angle for directional audio (degrees) |
What You Can Build
The SDK handles all the infrastructure. You bring the game design.
Board Games
Chess, checkers, go, backgammon — use the grid system, move animations, AI workers, ELO rankings, and spectator feeds.
Racing Games
Vehicle physics with free-walk camera, real-time multiplayer position sync, lap timers, and voice chat for team races.
Arena Combat
Real-time PvP with the eval bar as health, burst effects for hits, agent avatars as NPCs, and VR controller input for attacks.
Puzzle Games
3D puzzle pieces with arc animations, theme engine for visual variety, achievements for completion, and leaderboard for speed runs.
Card / Dice Games
3D cards with flip animations, dice rolls with physics, multiplayer turn sync, and spectator voice commentary.
VR Experiences
Immersive WebXR worlds with controller interaction, spatial audio ambient drones, and social voice rooms for shared experiences.
Robot Control Dashboards
3D digital twin visualization, real-time LIDAR point clouds, teleoperation with safety bounds, and voice commands via Alfred AI.
Industrial Simulations
Digital twin factories, warehouse robots with autonomous path planning, sensor dashboards, and multi-operator teleoperation rooms.
Ready to Build Your Game?
Download the template, plug in your game logic, and ship.
Someone from somewhere
just launched website.com
Just now