ESC
AKJV Bible — Operation Divine Scroll
Pricing — Alfred AI Plans Domains Cart News Contact Help Center Affiliate Program — Earn 20%
Game Engine SDK v3.0

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.

20 Modules
8 Camera Modes
WebXR VR Ready
ROS 2 Robot Bridge
Modules

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.

Architecture

How It Fits Together

The SDK orchestrates 20 modules through a single entry point. Add what you need.

Your Game Code
GoSiteMeGame (orchestrator)
↕ manages
Core Systems
SceneManager
CameraSystem
AudioEngine
UISystem
ThemeEngine
↕ integrates
Infrastructure
MultiplayerSystem
VoiceRoom
AIWorkerManager
WebXRManager
MobileInput
↕ v3.0 Embodiment Layer
Robotics & Spatial (NEW)
RobotBridge
SensorManager
DigitalTwin
Teleoperation
AutonomyEngine
ProximityAudio
↕ calls
Platform APIs
Leaderboard API
Agent Chat (Alfred)
Match Registry
Achievement Store
Quick Start

Up and Running in Minutes

1. Include the SDK

HTML
<!-- 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

JavaScript
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

JavaScript
// 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.

API Reference

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 PropertyTypeDescription
namestringGame title
slugstringUnique game ID for API calls
containerHTMLElementDOM element for the renderer
sceneObjectSceneManager options: background, fogDensity, shadows, camera
cameraModesArrayArray of camera mode configs (see CameraSystem)
themesObjectTheme definitions for ThemeEngine
agentsArrayAgent definitions (name, color, elo, depth, style, traits)
aiWorkerUrlstringURL to your AI worker script
wsChannelstringWebSocket channel for multiplayer
voiceChatbooleanEnable WebRTC voice room
vrbooleanEnable WebXR
mobilebooleanEnable mobile virtual joystick
particlesObject|falseParticle field config or false to disable
lightingObjectLighting preset options (accent colors, intensities)

Methods

MethodReturnsDescription
start()PromiseInitialize everything, start render loop
destroy()voidClean shutdown of all systems

Events

EventArgsDescription
'ready'All systems initialized, render loop running
'vr-support'(supported: boolean)WebXR availability detected
'destroyed'All systems shut down

Properties

PropertyTypeDescription
.sceneSceneManager3D scene, camera, renderer
.cameraCameraSystemCamera mode management
.audioAudioEngineSound synthesis
.uiUISystemToast, panel, modal
.themesThemeEngineTheme management
.achievementsAchievementSystemAchievement tracking
.agentsAgentSystem|nullAgent management (if agents configured)
.aiAIWorkerManager|nullAI workers (if aiWorkerUrl configured)
.multiplayerMultiplayerSystem|nullWebSocket (if wsChannel configured)
.voiceVoiceRoom|nullVoice chat (if multiplayer + voiceChat configured)
.xrWebXRManager|nullVR (if vr configured)
.mobileMobileInput|nullMobile controls (if mobile configured)
.leaderboardLeaderboardSystemRankings and ELO
.particlesParticleField|nullAmbient particles

SceneManager

Wraps Three.js scene, camera, renderer, and render loop. Supports ECS-style systems.

MethodArgsDescription
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, ArrayRaycast from screen coords, returns intersections
destroy()Dispose renderer, geometries, materials

Events

EventArgsDescription
'tick'(dt, elapsed)Fired every frame with delta time and total elapsed
'resize'(width, height)Window resized
'started'Render loop started

Properties

PropertyTypeDescription
.sceneTHREE.SceneThe Three.js scene
.cameraTHREE.PerspectiveCameraThe main camera
.rendererTHREE.WebGLRendererThe WebGL renderer
.raycasterTHREE.RaycasterBuilt-in raycaster

CameraSystem

Manages multiple camera modes with scroll-zoom and smooth transitions.

MethodDescription
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

PresetUsageDescription
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)numberBird'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.

MethodDescription
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

PresetDescription
.moveShort click / move sound
.captureImpact / capture
.alertWarning / check double-beep
.victoryAscending victory fanfare
.drawDescending draw sound

MultiplayerSystem

WebSocket pub/sub with auto-reconnect and spectator presence.

MethodDescription
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

EventArgsDescription
'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.

MethodDescription
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

EventArgsDescription
'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.

MethodDescription
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
Example: Chess AI
// 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.

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

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

MethodDescription
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

EventArgsDescription
'unlocked'(definition)Achievement unlocked — show popup UI here

WebXRManager

Enter immersive VR with controller input events.

MethodDescription
isSupported()Check if immersive-vr is available (async)
enter()Enter VR session with controller setup (async)
exit()End VR session

Events

EventArgsDescription
'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.

MethodArgsDescription
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

ConfigDefaultDescription
count500Number of particles
spread30Spread radius
size0.08Point size
color0x7D00FFParticle color
opacity0.4Particle opacity
drift0.002Vertical drift speed

ThemeEngine

Register unlimited visual themes and hot-swap at runtime. Themes define colors, materials, fog, and lighting.

MethodReturnsDescription
register(name, definition)voidRegister a named theme with colors, fog, material overrides
apply(name)voidApply a registered theme — updates scene, materials, fog, lighting
current()stringReturns name of the currently active theme
list()string[]Returns array of all registered theme names

Theme Definition

PropertyTypeDescription
backgroundnumberScene background color (hex)
fognumberFog color (hex)
fogDensitynumberFog density (0–1)
accentnumberPrimary accent color for materials
ambientnumberAmbient light color
ambientIntensitynumberAmbient light intensity

Events

EventArgsDescription
'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.

ConfigDefaultDescription
threshold0.15Dead zone threshold (0–1) before input registers
size120Joystick visual diameter in pixels
position'bottom-left'Joystick anchor position on screen

Events

EventArgsDescription
'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.

MethodReturnsDescription
connect(url, options)PromiseConnect to a ROS 2 bridge WebSocket endpoint
subscribe(topic, callback)voidSubscribe to a ROS topic (e.g. /joint_states, /scan)
publish(topic, msg)voidPublish a message to a ROS topic (e.g. /cmd_vel)
callService(name, args)PromiseCall a ROS service and await the response
disconnect()voidGracefully close the ROS bridge connection

Events

EventArgsDescription
'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.

MethodReturnsDescription
addSensor(id, type, config)SensorRegister a sensor: 'lidar', 'imu', 'camera', 'depth'
update(id, data)voidPush new sensor data for visualization
removeSensor(id)voidRemove sensor and clean up Three.js objects
getSensor(id)Sensor|nullGet sensor instance by ID
setVisible(id, visible)voidToggle sensor visualization on/off

Sensor Types

TypeVisualizationData 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 spaceImageData or base64 JPEG
'depth'Color-mapped depth planeFloat32Array depth image

DigitalTwinSystem v3.0

Sync a 3D model with a physical robot in real time. Joint angles, positions, and sensor overlays update live.

MethodReturnsDescription
loadModel(url, config)Promise<Model>Load URDF or GLTF robot model into the scene
setJointState(jointName, angle)voidUpdate a named joint to a target angle (radians)
syncFromROS(topic)voidAuto-sync joint states from a ROS /joint_states topic
setPosition(x, y, z)voidSet the twin's world position
highlight(jointName, color)voidHighlight a joint with a color overlay for diagnostics
getModel()THREE.GroupAccess the underlying Three.js model group

Events

EventArgsDescription
'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.

MethodReturnsDescription
enable(inputSource)voidEnable teleoperation with 'keyboard', 'gamepad', or 'vr'
disable()voidStop teleoperation and send zero-velocity command
setSpeedLimit(linear, angular)voidSet maximum linear (m/s) and angular (rad/s) velocities
setSafetyBounds(bounds)voidDefine a bounding box the robot cannot leave
emergencyStop()voidImmediately halt all movement and disable input
getLatency()numberCurrent round-trip latency in milliseconds

Events

EventArgsDescription
'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.

MethodReturnsDescription
setGoal(goal, params)Promise<Plan>Set a high-level goal; engine plans actions via Alfred AI
execute(plan)PromiseExecute a plan step by step with real-time feedback
pause()voidPause autonomous execution (resumes where it left off)
resume()voidResume paused execution
abort()voidCancel current execution and reset state
override(action)voidInject a manual action into the execution sequence
getStatus()ObjectCurrent status: {goal, step, progress, state}

Events

EventArgsDescription
'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.

MethodReturnsDescription
attachSource(id, object3d, config)AudioSourceAttach a spatial audio source to a Three.js object
play(id)voidStart playback of an attached source
stop(id)voidStop playback
setListener(camera)voidSet the listener position (usually the camera)
removeSource(id)voidRemove an audio source and clean up

Source Config

PropertyDefaultDescription
maxDistance50Distance at which volume reaches zero
refDistance1Distance at which volume is 100%
rolloffFactor1How quickly sound fades with distance
looptrueWhether the source loops
volume1.0Base volume (0–1)
coneInnerAngle360Inner cone angle for directional audio (degrees)
Inspiration

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.

Download Template Developer Portal

Someone from somewhere

just launched website.com

Just now

Call Alfred