Prerequisites
Before you begin, ensure you have:- Bun v1.1.38 or higher
- Git LFS for large file support (game assets)
- Docker (optional, for CDN and PostgreSQL)
- Privy account for authentication (optional)
- macOS
- Linux
Installation
Configure environment (optional)
Create Set your Privy credentials:
.env files if you want persistent authentication:packages/client/.env: SetPUBLIC_PRIVY_APP_IDpackages/server/.env: SetPRIVY_APP_IDandPRIVY_APP_SECRET
Build the project
First build takes 5-10 minutes due to PhysX WASM compilation. Subsequent builds are cached.
Start the CDN
The CDN serves game assets (models, textures, audio, manifests):This starts a Docker nginx container on port 8080. The server will fetch manifests from the CDN at startup.
Start the game
Development mode (with hot reload):Open http://localhost:5555 in your browser.
- Client: http://localhost:3333 (Vite HMR)
- Server:
ws://localhost:5555/ws - CDN:
http://localhost:8080
The server fetches manifests from
PUBLIC_CDN_URL at startup. In development, it skips the fetch if local manifests exist.Play Online
You can play Hyperscape online without installing anything:- Production: hyperscape.club - Stable release
- Staging: staging.hyperscape.club - Latest features (may be unstable)
The staging environment is updated automatically when changes are merged to the
staging branch. Use it to test new features before they reach production.Running with AI Agents
To run the game with ElizaOS AI agents:- Game server on port 5555
- Client on port 3333
- ElizaOS runtime on port 4001
Requires ElizaOS 1.7.0+ with an LLM provider (OpenAI, Anthropic, OpenRouter, or Ollama) configured in your environment variables.
AI Agent Features
- THINKING+ACTION format - Agents explain their reasoning before acting
- Target locking - Agents finish killing one mob before switching
- Force flee - Auto-flee at less than 25% health with threats nearby
- Combat readiness - Agents assess if they’re prepared for combat
- Goal templates - Structured beginner flows (woodcutting, mining, combat)
- Real-time thoughts - Watch agent decision-making in the dashboard
What Gets Started
| Service | Port | Description |
|---|---|---|
| Client | 3333 | Vite dev server with hot reload (dev mode) |
| Server | 5555 | Game server (Fastify + WebSockets) |
| CDN | 8080 | Asset server (Docker nginx) - serves models, audio, manifests |
| PostgreSQL | 5432 | Database (Docker, auto-started by server) |
The server fetches manifests from the CDN at startup. In production, manifests are served from Cloudflare R2. In development, the local CDN serves them from
packages/server/world/assets/.Quick Play Guide
- Start the game - Your character spawns in Central Haven (starter town)
- Find green cubes (goblins) - Click to attack
- Gain XP - Level up Attack, Strength, Defense, Constitution, Prayer, Agility
- Collect loot - Coins and equipment drops
- Visit shops - Buy tools (hatchet, fishing rod, tinderbox, hammer)
- Train gathering skills - Chop trees, mine ore, fish
- Train artisan skills - Light fires, cook food, smelt bars, smith equipment
- Challenge players - Visit the Duel Arena to challenge other players to PvP combat
- Press F5 - Toggle FPS debug panel to monitor performance
Controls & Keybinds
| Key | Action |
|---|---|
| Left-click | Primary action (attack, gather, eat, wield) |
| Right-click | Context menu |
| Shift-click | Drop item (inventory) |
| F5 or \ | Toggle FPS debug panel |
| WASD | Camera movement |
| Mouse wheel | Zoom camera |