Home Teleport System Documentation
Comprehensive guide for the home teleport system (polished in PR #1095, March 26, 2026).Overview
The home teleport system provides a visual, cooldown-based teleportation mechanic with:- 10-second interruptible cast time
- 30-second cooldown (server-authoritative)
- Dedicated portal visual effects
- Minimap orb integration
- Terrain-aware effect anchoring
Architecture
Components
Client:HomeTeleportButton.tsx- Main teleport button in HUDMinimapHomeTeleportOrb.tsx- Minimap orb with cooldown displayClientTeleportEffectsSystem.ts- Portal visual effectshomeTeleportUi.ts- Shared UI utilities
home-teleport.ts- Server-side handler with cooldown enforcementGameConstants.ts- Teleport timing constants
Events.ts- Teleport event definitionspackets.ts- Network packet schemas
Event Flow
Constants
HOME_TELEPORT_CONSTANTS
COOLDOWN_MS: Time between teleports (reduced from 15 minutes to 30 seconds in PR #1095)CAST_TIME_MS: Cast duration (interruptible by movement/combat)CAST_TIME_TICKS: Tick-based cast duration for server validation
Client Implementation
HomeTeleportButton
MinimapHomeTeleportOrb
ClientTeleportEffectsSystem
Server Implementation
Cooldown Enforcement
Visual Effects
Portal Effect
Components:- Veil: Translucent cylinder with gradient shader
- Orbital Rings: Rotating rings around player
- Particles: Upward-flowing particles
- Ground Anchor: Effect anchored to player’s lowest bone position
Terrain-Aware Anchoring
Problem: Portal effect floats above ground when player is on uneven terrain. Solution: Anchor to player’s lowest bone position (usually feet).UI Integration
Cooldown Display
Progress Calculation:Cast Progress Bar
Network Protocol
Packets
Client → Server:Event Definitions
Configuration
Home Position
Default: Central Haven (starter town at origin)Cooldown Tuning
Reduce Cooldown (for testing):Testing
Unit Tests
homeTeleportUi.test.ts:Integration Tests
home-teleport.spec.ts:Troubleshooting
Issue: Cooldown stuck at 0% (never refills)
Diagnosis:PLAYER_TELEPORTEDevent not firing- Cooldown animation not started
setCooldownProgress(0)not called on teleport success
Issue: Portal effect doesn’t appear
Diagnosis:ClientTeleportEffectsSystemnot registeredHOME_TELEPORT_CAST_STARTevent not emitted- Portal mesh not added to stage
Issue: Portal floats above ground
Diagnosis:getLowestBonePosition()returning player.position instead of bone position- VRM skeleton not loaded
- Terrain system not ready
Issue: Server sends wrong remainingMs
Diagnosis:lastHomeTeleportMap not updated on successful teleport- Clock skew between server and client
- Cooldown constant mismatch
Performance Considerations
Portal Effect Optimization
Geometry:- Veil: 32 segments (low-poly cylinder)
- Rings: 64 segments each (smooth circles)
- Particles: 50 instances (instanced rendering)
- TSL node materials (WebGPU-optimized)
- Shared textures across all portals
- No per-frame texture updates
Cooldown Animation
RAF-Based (60 FPS):Related Documentation
- HomeTeleportButton.tsx - Main teleport button
- MinimapHomeTeleportOrb.tsx - Minimap orb
- ClientTeleportEffectsSystem.ts - Portal effects
- home-teleport.ts - Server handler
- GameConstants.ts - Timing constants
Changelog
March 26, 2026 (PR #1095)
- Polished cast effects with dedicated portal visuals
- Reduced cooldown from 15 minutes to 30 seconds
- Server sends
remainingMsin cooldown rejection packets - Added minimap orb integration
- Terrain-aware portal anchoring (lowest bone position)
- Cast progress bar with smooth animation
- Cooldown refill visual with radial progress
- 8 files changed, 649 additions, 53 deletions
Pre-March 2026
- Basic teleport functionality
- 15-minute cooldown
- No visual effects
- No minimap integration