Skip to main content

API Reference: March-April 2026 Updates

This document provides API reference for features added in March-April 2026.

Table of Contents

Tooltip Style Utilities

Location: packages/client/src/ui/core/tooltip/tooltipStyles.ts Added: March 27, 2026 (PR #1102) Centralized tooltip styling utilities for consistent appearance across all UI panels.

Functions

getTooltipTitleStyle(theme, accentColor?)

Returns styling for tooltip title text. Parameters:
  • theme: Theme - Current theme object
  • accentColor?: string - Optional accent color (defaults to theme.colors.accent.secondary)
Returns: React.CSSProperties Example:

getTooltipMetaStyle(theme)

Returns styling for metadata/secondary text (level requirements, quantities, etc.). Parameters:
  • theme: Theme - Current theme object
Returns: React.CSSProperties Example:

getTooltipBodyStyle(theme)

Returns styling for body content text. Parameters:
  • theme: Theme - Current theme object
Returns: React.CSSProperties Example:

getTooltipDividerStyle(theme, accentColor?)

Returns styling for section dividers within tooltips. Parameters:
  • theme: Theme - Current theme object
  • accentColor?: string - Optional accent color for border
Returns: React.CSSProperties Example:

getTooltipTagStyle(theme)

Returns styling for tag/badge elements. Parameters:
  • theme: Theme - Current theme object
Returns: React.CSSProperties Example:

getTooltipStatusStyle(theme, tone)

Returns styling for status indicators. Parameters:
  • theme: Theme - Current theme object
  • tone: 'default' | 'success' | 'danger' | 'warning' - Status tone
Returns: React.CSSProperties Example:

Usage Pattern

Tree Dissolve Animation

Location: packages/shared/src/systems/shared/world/DissolveAnimation.ts Added: March 27, 2026 (PR #1101) Shared dissolve animation state machine for tree depletion/respawn effects.

Types

Functions

startDissolve(anims, entityId, direction, instant, applyFn)

Start or instantly apply a dissolve animation. Parameters:
  • anims: Map<string, DissolveAnim> - Animation map to manage
  • entityId: string - Entity to animate
  • direction: 1 | -1 - 1 = dissolve out, -1 = appear in
  • instant: boolean - If true, skip animation and apply immediately
  • applyFn: (entityId: string, value: number) => void - Callback to apply dissolve value
Example:

tickDissolveAnims(anims, deltaTime, applyFn)

Advance all active dissolve animations by deltaTime. Parameters:
  • anims: Map<string, DissolveAnim> - Animation map to tick
  • deltaTime: number - Time elapsed since last tick (seconds)
  • applyFn: (entityId: string, value: number) => void - Callback to apply dissolve value
Example:

Configuration

Location: packages/shared/src/systems/shared/world/GPUMaterials.ts

Implementation Notes

  • Screen-Door Dithering: Uses Bayer 4×4 pattern in alphaTestNode to discard fragments
  • Opaque Render Pass: Trees stay in opaque pass with full early-Z rejection (no transparency sorting)
  • LOD Preservation: Dissolve state carries over during LOD transitions
  • Encoding:
    • InstancedMesh: instanceDissolve Float32 attribute
    • BatchedMesh: Blue channel of batch color (1.0 - dissolveVal)

Tree Collision Proxy

Location: packages/shared/src/systems/shared/world/GLBTreeInstancer.ts, GLBTreeBatchedInstancer.ts Added: March 27, 2026 (PR #1100) Functions for retrieving tree geometry for accurate collision detection.

Functions

getProxyGeometry(entityId)

Returns LOD geometries for collision proxy creation. Parameters:
  • entityId: string - Tree entity ID
Returns: { geometries: THREE.BufferGeometry[], yOffset: number } | null Important: Returned geometries are shared by the instancer pool. Callers MUST clone before mutating. Example:

clearProxyGeometryCache()

Dispose all cached proxy geometries and clear the cache. Must be called during world teardown to prevent GPU buffer leaks. Example:

Geometry Caching

Proxy geometries are cached per (sourceGeometries, scale) to avoid redundant merges:
Cache Lifecycle:
  • Created on first getProxyGeometry() call for a given model+scale
  • Reused for all trees with same model and scale
  • Cleared only on world teardown via clearProxyGeometryCache()

Equipment Panel Props

Location: packages/client/src/game/panels/EquipmentPanel.tsx Updated: March 27, 2026 (PR #1102) Extended equipment panel to support bank integration and custom actions.

Interface

Usage Examples

Standalone Equipment Panel

Bank Equipment Panel

Layout Variants

default Layout

  • Standard paperdoll grid (5 columns × 5 rows)
  • Overlay portrait (3D avatar behind slots)
  • Larger slot sizes (38px desktop, 34px mobile)
  • Footer buttons (Stats, On Death)
  • Stat bonuses display

bank Layout

  • Compact grid (4 columns × 5 rows)
  • Portrait in dedicated grid area (not overlay)
  • Smaller slot sizes (30px)
  • No footer buttons (controlled by parent)
  • Optional stat bonuses

Portrait Configuration

The equipment panel includes a live 3D VRM portrait that updates when equipment changes:
Portrait Features:
  • Live 3D rendering of equipped items
  • Automatic camera framing
  • Zoom controls (mouse wheel)
  • Rotation controls (drag)
  • Efficient caching (only re-renders on equipment change)

Dialogue System

Location: packages/client/src/game/panels/dialogue/ Added: March 26, 2026 (PR #1093) Redesigned NPC dialogue system with live 3D portraits.

Components

DialoguePopupShell

Modal shell for NPC dialogue with focus management. Props:
Example:

DialogueCharacterPortrait

Live 3D VRM portrait rendering for NPCs. Props:
Example:
Features:
  • Loads NPC VRM model from manifest
  • Live 3D rendering with WebGPU
  • Automatic camera framing
  • Efficient caching (reuses viewport across dialogues)

Service Handoff

When opening a service (bank, store, tanner) from dialogue, the dialogue properly closes:

Resource System Changes

Location: packages/shared/src/systems/shared/entities/ResourceSystem.ts Updated: March 27, 2026 (PR #1099)

Tick-Based Respawn

Resources now respawn via deterministic tick counting instead of setTimeout:

Manifest-Based Depletion

Mining and other gathering skills now read depleteChance from manifest:
Manifest Example:

Removed Constants

The following constants were removed in favor of manifest values:
  • MINING_DEPLETE_CHANCE (was 1.0)
  • MINING_REDWOOD_DEPLETE_CHANCE (was 0.091)

Tool Validation

Location: packages/shared/src/systems/shared/entities/gathering/ToolUtils.ts Updated: March 27, 2026 (PR #1098)

Functions

itemMatchesToolCategory(itemId, category)

Validate if an item matches a tool category using manifest data. Parameters:
  • itemId: string - Item ID to validate
  • category: string - Tool category (‘hatchet’, ‘pickaxe’, ‘fishing_rod’, etc.)
Returns: boolean Example:

getToolCategory(itemId)

Extract tool category from item ID. Parameters:
  • itemId: string - Item ID
Returns: string | null Example:

Manifest Integration

Tools must be defined in tools.json manifest:
Validation Flow:
  1. Primary: Lookup in tools.json manifest, compare skill field
  2. Fallback: Substring matching with cross-skill guards
  3. Warn-once logging for unmanifested tools (bounded to 50 entries)

Home Teleport System

Location: packages/client/src/game/hud/HomeTeleportButton.tsx, MinimapHomeTeleportOrb.tsx Updated: March 26, 2026 (PR #1095)

Constants

Events

HOME_TELEPORT_CAST_START

Emitted when player starts casting home teleport. Payload:

HOME_TELEPORT_FAILED

Emitted when teleport fails (cooldown, interrupted, etc.). Payload:

PLAYER_TELEPORTED

Emitted when teleport completes successfully. Payload:

Visual Effects

Portal Effect (ClientTeleportEffectsSystem.ts):
  • Channel-mode portal with terrain-aware anchoring
  • Appears at player position during cast
  • Scales up over cast duration
  • Disappears on completion or interruption
Cooldown Display:
  • Both HomeTeleportButton and MinimapHomeTeleportOrb show cooldown progress
  • Circular progress indicator
  • Remaining time display
  • Disabled state during cooldown

Death System

Location: packages/shared/src/systems/shared/combat/DeathUtils.ts Updated: March 26, 2026 (PR #1094)

Utilities

sanitizeKilledBy(killedBy)

Sanitize killer name for XSS/Unicode/injection protection. Parameters:
  • killedBy: string | undefined - Raw killer name
Returns: string Example:

splitItemsForSafeDeath(items, keepCount)

Split items into kept and dropped for OSRS-style keep-3 deaths. Parameters:
  • items: InventoryItem[] - Player’s items
  • keepCount: number - Number of items to keep (default: 3)
Returns: { keptItems: InventoryItem[], droppedItems: InventoryItem[] } Example:

validatePosition(position)

Validate and clamp position to world bounds. Parameters:
  • position: { x: number, y: number, z: number } - Position to validate
Returns: { x: number, y: number, z: number } Example:

Constants

Breaking Changes

Deprecated Event: PLAYER_DIED Use PLAYER_SET_DEAD or ENTITY_DEATH instead:

Migration Guide

Updating Tooltip Styles

Before:
After:

Updating Resource Depletion

Before:
After:

Updating Tool Validation

Before:
After:

Updating WebSocket URL

Before:
After:
Note: WebSocket port changed from 5555 to 5556 with uWebSockets.js migration (March 2026).

See Also