Skip to main content

Overview

Hyperscape features a player-driven economy with banking, shops, loot drops, and item trading.

Currency

Coins are the universal currency:
  • Dropped by all mobs
  • Used to purchase from shops
  • Stackable in inventory

Inventory

Configuration

// From packages/shared/src/constants/GameConstants.ts
export const INVENTORY_CONSTANTS = {
  MAX_INVENTORY_SLOTS: 28,
  MAX_BANK_SLOTS: 100,
  MAX_STACK_SIZE: 1000,
  DEFAULT_ITEM_VALUE: 1,
} as const;

Capacity

  • 28 slots in active inventory (RuneScape-style)
  • 100 slots in bank storage
  • 1000 max stack for stackable items
  • Items must be managed carefully
  • Stackable items (coins, arrows) share a slot

Item Properties

PropertyDescription
StackableMultiple units per slot (up to 1000)
TradeableCan be exchanged
WeightAffects run energy
RequirementsLevel gates for use

Banking

Features

  • Unlimited storage slots
  • Accessible at bank locations in starter towns
  • Each bank is independent (no shared storage)

Operations

  • Deposit: Move items from inventory to bank
  • Withdraw: Move items from bank to inventory
  • Organize: Drag to rearrange
Banks are safe storage—items cannot be lost from banks.

Shops

General Store

Available in all starter towns:
ItemPrice
Bronze Hatchet50 coins
Fishing Rod25 coins
Tinderbox15 coins
Arrows (10)20 coins

Shop Mechanics

  • Stock replenishes over time
  • Prices are fixed
  • Sell items back for reduced value

Loot Drops

Mob Drops

All mobs drop loot on death:
Mob TierTypical Drops
Level 1Coins, bronze equipment (rare)
Level 2More coins, steel equipment (uncommon)
Level 3Substantial coins, mithril equipment (uncommon)

Drop Tables

Drop tables are defined in NPC manifests and calculated at runtime:
// From packages/shared/src/data/npcs.ts (lines 107-149)
export function calculateNPCDrops(
  npcId: string,
): Array<{ itemId: string; quantity: number }> {
  const npc = getNPCById(npcId);
  if (!npc) return [];

  const drops: Array<{ itemId: string; quantity: number }> = [];

  // Add default drop if enabled
  if (npc.drops.defaultDrop.enabled) {
    drops.push({
      itemId: npc.drops.defaultDrop.itemId,
      quantity: npc.drops.defaultDrop.quantity,
    });
  }

  // Roll for drop tiers: always, common, uncommon, rare, veryRare
  npc.drops.always.forEach(processDrop);
  npc.drops.common.forEach(processDrop);
  npc.drops.uncommon.forEach(processDrop);
  npc.drops.rare.forEach(processDrop);
  npc.drops.veryRare.forEach(processDrop);

  return drops;
}
Drop tables are defined in world/assets/manifests/npcs.json and loaded by DataManager.

Economy Flow

Item Tiers

Weapons

TierAttack ReqExamples
Bronze1Bronze Sword
Steel10Steel Sword
Mithril20Mithril Sword

Armor

TierDefense ReqSlots
Leather1Helmet, Body, Legs
Steel10Helmet, Body, Legs
Mithril20Helmet, Body, Legs

Bows

TierRange ReqType
Wood1Shortbow
Oak10Oak Bow
Willow20Willow Bow

Player Trading

Trade System

Players can trade items directly with each other using an OSRS-style two-screen confirmation flow:

Initiating a Trade

  1. Right-click another player
  2. Select “Trade with [Player Name]”
  3. If not adjacent, your character walks to them automatically
  4. Trade request appears as pink clickable chat message

Trade Flow

Offer Screen:
  • Add items by left-clicking inventory items (adds 1)
  • Right-click for context menu: Offer-1, Offer-5, Offer-10, Offer-X, Offer-All
  • Remove items by clicking them in your trade offer
  • Both players must accept to proceed
Confirmation Screen:
  • Final review of both offers
  • Wealth transfer indicator shows value difference
  • Both players must accept again to complete
  • Trade executes atomically (no item duplication possible)

Anti-Scam Features

FeatureDescription
Two-Screen FlowMust accept twice (offer + confirm)
Removal WarningRed flashing exclamation when items removed
Wealth IndicatorShows if you’re gaining/losing value (green/red)
Free SlotsDisplays partner’s available inventory space
Value Warning⚠️ if wealth difference >50% of offer

Security

  • Server-authoritative state management
  • Atomic database transactions
  • Inventory locks during swap
  • Proximity validation (must be adjacent)
  • Rate limiting on requests
  • Tradeable flag enforcement
Trade requests appear as pink clickable messages in chat. Click to accept instantly.

Future Features

A Grand Exchange (automated marketplace) is planned for future updates.