Systems Architecture
Hyperscape game logic is implemented through Systems — classes that process entities and components each game tick. Systems are organized by domain and split between client, server, and shared execution contexts.System Base Class
All systems extendSystemBase which provides:
- Dependency management (required/optional systems)
- Lifecycle hooks (init, update, cleanup)
- World reference for entity queries
- Auto-cleanup on destroy
Core Game Systems
Combat System
Location:systems/shared/combat/
The combat system implements OSRS-style tick-based combat with 20+ supporting files:
Economy Systems
Location:systems/shared/economy/
Handles all economic interactions:
- Banking — Deposit, withdraw, note conversion
- Shops — Buy/sell with general stores
- Inventory — 28-slot management with stacking
- Loot — Item drops and ground items
Movement & Collision System
Location:systems/shared/movement/
Implements tile-based movement and OSRS-accurate collision:
- TileSystem.ts — Grid-based coordinate system
- CollisionMatrix.ts — Zone-based collision storage (8×8 tile zones)
- CollisionFlags.ts — Bitmask flags (BLOCKED, WATER, OCCUPIED, walls)
- EntityOccupancyMap.ts — Entity tracking with collision integration
- BFSPathfinder.ts — Breadth-first search pathfinding around obstacles
- ChasePathfinding.ts — Combat chase behavior
- WanderBehavior.ts — NPC wandering AI
- Static object blocking (trees, rocks, stations)
- Multi-tile footprints (2×2 furnaces, large resources)
- Directional walls (for future dungeons)
- Network synchronization (zone serialization)
- Safespotting mechanics (OSRS-accurate)
Character Systems
Location:systems/shared/character/
Player character management:
- Stats tracking — Levels, XP, combat level
- Equipment — Gear slots and bonuses
- Skills — 11 trainable skills (5 combat, 3 gathering, 3 artisan)
- Prayer — Prayer point management, drain mechanics, altar recharging
Combat Constants
The combat system uses OSRS-accurate constants:Level Constants
Skills System
Hyperscape implements 17 skills with OSRS-accurate mechanics:Combat Skills
Gathering Skills
Artisan Skills
Support Skills
Each skill has independent XP tracking and levels 1-99 following OSRS XP curves. Crafting, Fletching, and Runecrafting were added in February 2026 with full OSRS-accurate mechanics.
Attack Styles
Players choose how combat XP is distributed:Mob Aggression
Event System
Systems communicate through typed events:Detailed Documentation
Combat System
OSRS-accurate damage formulas, attack styles, aggro system, and death mechanics. Includes melee, ranged, and magic combat.
Duel Arena
Player-versus-player dueling with rules negotiation, item stakes, and arena combat.
Skills & Progression
RuneScape XP curves, leveling, combat level formula, and skill requirements.
Prayer System
Prayer mechanics, drain formulas, combat bonuses, altars, and bone burying.
Tile Movement
Discrete tile-based movement, pathfinding, and OSRS melee range rules.
NPC Data
How NPCs and mobs are defined with drop tables and aggro behaviors.