API Reference: March-April 2026 Updates
This document provides API reference for features added in March-April 2026.Table of Contents
- Tooltip Style Utilities
- Tree Dissolve Animation
- Tree Collision Proxy
- Equipment Panel Props
- Dialogue System
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 objectaccentColor?: string- Optional accent color (defaults totheme.colors.accent.secondary)
React.CSSProperties
Example:
getTooltipMetaStyle(theme)
Returns styling for metadata/secondary text (level requirements, quantities, etc.).
Parameters:
theme: Theme- Current theme object
React.CSSProperties
Example:
getTooltipBodyStyle(theme)
Returns styling for body content text.
Parameters:
theme: Theme- Current theme object
React.CSSProperties
Example:
getTooltipDividerStyle(theme, accentColor?)
Returns styling for section dividers within tooltips.
Parameters:
theme: Theme- Current theme objectaccentColor?: string- Optional accent color for border
React.CSSProperties
Example:
getTooltipTagStyle(theme)
Returns styling for tag/badge elements.
Parameters:
theme: Theme- Current theme object
React.CSSProperties
Example:
getTooltipStatusStyle(theme, tone)
Returns styling for status indicators.
Parameters:
theme: Theme- Current theme objecttone: 'default' | 'success' | 'danger' | 'warning'- Status tone
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 manageentityId: string- Entity to animatedirection: 1 | -1- 1 = dissolve out, -1 = appear ininstant: boolean- If true, skip animation and apply immediatelyapplyFn: (entityId: string, value: number) => void- Callback to apply dissolve value
tickDissolveAnims(anims, deltaTime, applyFn)
Advance all active dissolve animations by deltaTime.
Parameters:
anims: Map<string, DissolveAnim>- Animation map to tickdeltaTime: number- Time elapsed since last tick (seconds)applyFn: (entityId: string, value: number) => void- Callback to apply dissolve value
Configuration
Location:packages/shared/src/systems/shared/world/GPUMaterials.ts
Implementation Notes
- Screen-Door Dithering: Uses Bayer 4×4 pattern in
alphaTestNodeto 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:
instanceDissolveFloat32 attribute - BatchedMesh: Blue channel of batch color (
1.0 - dissolveVal)
- InstancedMesh:
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
{ 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:
- 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:- 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:
DialogueCharacterPortrait
Live 3D VRM portrait rendering for NPCs.
Props:
- 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 ofsetTimeout:
Manifest-Based Depletion
Mining and other gathering skills now readdepleteChance from manifest:
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 validatecategory: string- Tool category (‘hatchet’, ‘pickaxe’, ‘fishing_rod’, etc.)
boolean
Example:
getToolCategory(itemId)
Extract tool category from item ID.
Parameters:
itemId: string- Item ID
string | null
Example:
Manifest Integration
Tools must be defined intools.json manifest:
- Primary: Lookup in
tools.jsonmanifest, compareskillfield - Fallback: Substring matching with cross-skill guards
- 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
- Both
HomeTeleportButtonandMinimapHomeTeleportOrbshow 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
string
Example:
splitItemsForSafeDeath(items, keepCount)
Split items into kept and dropped for OSRS-style keep-3 deaths.
Parameters:
items: InventoryItem[]- Player’s itemskeepCount: number- Number of items to keep (default: 3)
{ 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
{ 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:Updating Resource Depletion
Before:Updating Tool Validation
Before:Updating WebSocket URL
Before:See Also
- CLAUDE.md - Complete development guide
- README.md - Project overview
- packages/server/README.md - Server documentation
- packages/client/README.md - Client documentation