Skip to main content

Manifest-Driven Architecture

Hyperscape uses a manifest-driven architecture where game content is defined in JSON files rather than hardcoded in TypeScript. This enables rapid content iteration and modding without touching game logic.

Architecture Overview

Key Components


Manifest Organization

Directory Structure


Loading Process

1. Atomic Directory Loading

DataManager uses atomic loading for multi-file manifests:
This prevents partial loads that could cause inconsistent game state.

2. Load Order

Manifests load in dependency order:
  1. Tier requirements - Needed for item normalization
  2. Items - Core item definitions
  3. NPCs - Mob and NPC definitions
  4. Gathering resources - Trees, rocks, fishing spots
  5. Recipe manifests - Cooking, firemaking, smelting, smithing
  6. Skill unlocks - Milestone unlocks by level
  7. Stations - Anvil, furnace, range configuration
  8. World areas - Zone definitions
  9. Stores - Shop inventories

3. Validation

Each manifest is validated on load:
  • Required fields: Missing fields cause load failure
  • Duplicate IDs: Duplicate item/NPC IDs are rejected
  • Type checking: JSON structure validated against TypeScript interfaces
  • Reference integrity: Item/NPC references validated

Data Providers

ProcessingDataProvider

Provides runtime access to processing recipes:
See Data Providers API for full documentation.

TierDataProvider

Provides tier-based level requirements:

StationDataProvider

Provides world station configuration:

Adding New Content

Example: Adding a New Smithing Recipe

Step 1: Edit packages/server/world/assets/manifests/recipes/smithing.json
Step 2: Add the item definition to manifests/items/armor.json
Step 3: Restart the server
The new recipe will appear in the smithing interface for players with level 68+ Smithing and mithril bars.

Manifest Schemas

Smelting Recipe

Smithing Recipe

Station Configuration

Tier Requirements


Benefits of Manifest-Driven Design

1. Separation of Concerns

  • Content creators edit JSON files
  • Developers build systems that consume manifests
  • Designers balance without code changes

2. Hot Reloading

In development, manifest changes can be applied without full rebuilds:

3. Modding Support

Community members can create content packs by providing custom manifest files.

4. Type Safety

TypeScript interfaces ensure manifests match expected structure:

5. Testability

Manifests can be mocked for testing:

Migration from Hardcoded Data

The smithing system demonstrates the migration from hardcoded data to manifests:

Before (Hardcoded)

After (Manifest-Driven)


Best Practices

1. Use Providers, Not Direct Access

2. Validate at Load Time

3. Cache Provider References

4. Use Type Guards


Performance Optimizations

Pre-allocated Buffers

Data providers use pre-allocated buffers to avoid allocations in hot paths:

Lazy Initialization

Providers initialize on first access:

Indexed Lookups

Data is indexed by multiple keys for O(1) access: