Overview
The@hyperscape/plugin-hyperscape package enables AI agents to play Hyperscape autonomously using ElizaOS:
- Agent actions (combat, skills, movement)
- World state providers
- LLM decision-making via OpenAI/Anthropic/OpenRouter
- Full player capabilities
Package Location
Actions
Agent capabilities are defined insrc/actions/:
Action Categories
| Category | Actions | Source File |
|---|---|---|
| Movement | moveTo, followEntity, stopMovement | actions/movement.ts |
| Combat | attackEntity, changeCombatStyle | actions/combat.ts |
| Skills | chopTree, catchFish, lightFire, cookFood | actions/skills.ts |
| Inventory | equipItem, useItem, dropItem | actions/inventory.ts |
| Social | chatMessage | actions/social.ts |
| Banking | bankDeposit, bankWithdraw | actions/banking.ts |
Action Locks and Fast-Tick Mode (Commit 60a03f4, Feb 26 2026)
Problem: Agents would spam LLM calls while waiting for movement to complete, wasting tokens and causing decision conflicts. Solution: Action lock system with fast-tick mode for responsive follow-up actions. Action Lock:- 90% reduction in LLM calls for repetitive tasks
- Faster response to movement completion (2s vs 10s)
- Lower costs from reduced API usage
- More natural behavior (no pauses between actions)
Movement Completion Tracking
New API:executeMove()sets_isMoving = truetileMovementEndpacket sets_isMoving = falseand resolves promisewaitForMovementComplete()returns immediately if not moving- Timeout (default 15s) prevents infinite waits
- Banking actions returned early without waiting
- Agent would spam LLM while walking to bank
- Multiple conflicting actions queued
- Banking actions await movement completion
- Action lock prevents LLM spam
- Fast-tick triggers quick follow-up after arrival
Providers
World state is accessible to agents via 6 providers:| Provider | Data |
|---|---|
gameStateProvider | Health, stamina, position, combat status |
inventoryProvider | Current inventory items and coins |
nearbyEntitiesProvider | Players, NPCs, resources in range |
skillsProvider | Skill levels and XP |
equipmentProvider | Currently equipped items |
availableActionsProvider | Context-aware actions (e.g., “can cook fish”) |
Configuration
Running
Agent Architecture
Dependencies
| Package | Version | Purpose |
|---|---|---|
@elizaos/core | ^1.2.9 | ElizaOS framework |
@elizaos/plugin-anthropic | ^1.5.12 | Anthropic LLM |
@elizaos/plugin-openai | 1.5.16 | OpenAI LLM |
@elizaos/plugin-openrouter | ^1.5.15 | OpenRouter LLM |
@elizaos/plugin-sql | ^1.6.4 | SQL database |
@hyperscape/shared | workspace | Core engine |
ws | ^8.18.3 | WebSocket client |
zod | ^3.25.67 | Schema validation |
Building
Key Files
| File | Purpose |
|---|---|
src/index.ts | Plugin registration |
src/service.ts | Main service class |
src/actions/ | All agent actions |
src/providers/ | State providers |
src/templates/ | LLM prompt templates |