Skip to main content

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 in src/actions/:

Action Categories

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:
Fast-Tick Mode:
Short-Circuit LLM: For obvious decisions, skip LLM and execute directly:
Benefits:
  • 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)
Configuration:

Movement Completion Tracking

New API:
How it works:
  1. executeMove() sets _isMoving = true
  2. tileMovementEnd packet sets _isMoving = false and resolves promise
  3. waitForMovementComplete() returns immediately if not moving
  4. Timeout (default 15s) prevents infinite waits
Example:
Before (commit 60a03f4):
  • Banking actions returned early without waiting
  • Agent would spam LLM while walking to bank
  • Multiple conflicting actions queued
After:
  • 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:

Configuration

Running

This starts ElizaOS alongside the game server. The AI agent connects as a real player and plays autonomously.

Agent Architecture

Dependencies

Building

Key Files

License

MIT License - can be used in any ElizaOS agent.