Client Application
The Hyperscape client is a React-based web application with Three.js WebGPU rendering. It provides a modern MMORPG experience with VRM avatars, responsive UI panels, and real-time multiplayer.Client code lives in
packages/client/src/. The rendering systems are in packages/shared/src/systems/client/.Architecture Overview
Entry Point
The client entry point ispackages/client/src/index.tsx:
Authentication Flow
Authentication uses Privy for wallet-based login:Screens
Login Screen
- Wallet connection via Privy
- Social login (email, Google)
- Session persistence
Character Select Screen
- List existing characters
- Create new character
- Character preview with VRM avatar
Game Client
- Main game loop
- World initialization
- UI overlay rendering
UI Components
Unified Tooltip System (March 2026)
New Feature (PR #1102): Unified tooltip styling system with consistent behavior across all UI panels.
packages/client/src/ui/core/tooltip/tooltipStyles.ts
Style Functions:
- Inventory Panel
- Equipment Panel
- Bank Panel
- Skills Panel
- Prayer Panel
- Spells Panel
- Store Panel
- Trade Panel
- Duel Panel
- Action Bar
- Loot Window
- Consistent visual language across all UI
- Centralized style management
- Easy theme customization
- Reduced code duplication (~500 lines eliminated)
Core UI (CoreUI.tsx)
The main UI wrapper that renders HUD elements and game panels:Game Panels
Located inpackages/client/src/game/panels/:
HUD Components
Located inpackages/client/src/game/hud/:
StatusBars.tsx- Health, prayer, run energy barsXPProgressOrb.tsx- XP tracking orb with skill iconsActionProgressBar.tsx- Skilling action progressEntityContextMenu.tsx- Right-click context menusMinimap.tsx- RS3/OSRS-accurate top-down map view with location iconsNametags.ts- Entity name/level labels
Minimap System
The minimap provides RS3/OSRS-accurate navigation with location icons and entity tracking. Visual Standards (OSRS-accurate):- White dots: Other players
- Yellow dots: NPCs, mobs, and buildings
- Red dots: Ground items and loot
- White square: Local player (distinct from other players)
- Red flag: Destination marker (RS3-style)
Quest Icon States:
Quest giver NPCs display state-aware icons based on quest progress:
- Blue ”!”: NPC has at least one available quest (not started)
- Blue ”?”: NPC has at least one quest in progress
- No icon: All quests completed (shows bank/shop icon if NPC provides those services)
- Icons disappear when all of an NPC’s quests are completed
questIds field in their configuration:
questIds field is passed through the spawn → network → client pipeline so the minimap can identify quest giver NPCs and display appropriate icons.
Icon Detection:
Icons are automatically assigned based on entity configuration:
Bug Fix (PR #885): Fixed broken NPC service detection cast. The
services field is string[], not { types: string[] }. This also fixed bank/shop icon detection which was previously broken.- Entity dots: 6px diameter (compact for clarity)
- Location icons: 12px diameter (prominent for navigation)
- 3D terrain rendered via orthographic camera (throttled to ~15fps for performance)
- 2D overlay canvas for entity pips and icons (60fps for smooth interaction)
- Cached projection-view matrix keeps pips synced with throttled 3D render
- Pre-allocated vectors avoid GC pressure in render loop
- Click-to-move on minimap
- Scroll to zoom (20-1000 tile extent)
- Rotates with main camera (RS3-style)
- Destination marker persists until reached
- Resizable and collapsible
- Edit mode support for UI customization
3D Graphics System
WebGPU Renderer
The graphics system uses Three.js with WebGPU for high-performance rendering: WebGPU Initialization Timeouts: The renderer includes timeout protection to detect GPU driver issues:- Bloom: Glow effects for magical items and particles
- Tone Mapping: HDR to LDR conversion with auto-exposure
- Color Grading: LUT-based color correction
- Outline: Entity highlighting for hover/selection
- Issue: When LUT was “none” but hover triggered outline, stale LUT data leaked into rendering
- Solution: Zero LUT intensity when disabled so outline-only rendering stays clean
- Benefit: Entity highlights work correctly even when color grading is disabled
Rendering Pipeline
- Pre-render: Update matrices, frustum culling
- Shadow Pass: Render cascaded shadow maps (CSM)
- Main Pass: Render scene with deferred lighting
- Post-Processing: Bloom, tone mapping, color grading (TSL-based)
- UI Overlay: Render 2D React UI on top
Model Loading & Transform Baking
TheModelCache system handles GLTF model loading with transform baking to prevent rendering issues:
- Position/rotation/scale properties
- Baked into matrices
- Non-decomposable transforms (shear)
Camera System
Supports multiple camera modes:Camera Initialization Fix (PR #829): The camera now correctly initializes with
theta=Math.PI for standard third-person behind-the-player view. Previously, theta=0 placed the camera in front of the player, causing backwards movement on fresh load.VRM Avatar System
Characters use VRM format avatars with humanoid bone mapping:VRM Bone Mapping
Client Systems
Located inpackages/shared/src/systems/client/: