Minimap System
The minimap provides real-time navigation and entity tracking with RS3/OSRS-accurate dot colors and location icons.Minimap code lives in
packages/client/src/game/hud/Minimap.tsx and renders entities, locations, and the destination marker on a 2D canvas overlay.Entity Dot Colors
The minimap uses RS3/OSRS standard color scheme:RS3/OSRS Accuracy: The color scheme matches RuneScape 3 and Old School RuneScape conventions. White for players, yellow for NPCs, red for items.
Local Player Marker
The local player renders as a white square instead of a circle:Destination Marker
When you click to move, a red flag appears at the destination:Location Icons
Key locations display custom icons instead of generic dots:Bank Icon ($)
Shop Icon (Bag)
Prayer Altar Icon (Cross)
Runecrafting Altar Icon (Purple R)
Anvil Icon
Furnace Icon (Flame)
Cooking Range Icon (Steam)
Fishing Spot Icon (Fish)
Mining Rock Icon (Pickaxe)
Tree Icon (Green Circle)
Quest NPC Icon (?)
Icon Detection
The minimap automatically detects entity subtypes to assign the correct icon:Station Type Detection
NPC Service Detection
NPCs with services (bank, shop, quest) display the appropriate icon:Resource Type Detection
Resources (trees, rocks, fishing spots) display skill-specific icons:Size Hierarchy
Icons use a size hierarchy for visual clarity:Rendering Pipeline
The minimap uses a multi-pass rendering approach:- Clear canvas - Transparent background
- Draw terrain - Optional terrain overlay (future feature)
- Draw entity dots - Players, mobs, items
- Draw location icons - Banks, shops, altars, resources
- Draw destination marker - Red flag for movement target
- Draw compass - Optional compass overlay
Icon Drawing Function
ThedrawMinimapIcon() function handles all location icon rendering:
trueif icon was drawn (skip default dot rendering)falseif no icon exists for this subtype (fall back to colored dot)
Entity Pip Structure
Each entity on the minimap is represented by anEntityPip:
Performance Optimizations
The minimap uses several optimizations for smooth rendering:Entity Caching
Cleanup
Entities that no longer exist are removed from the cache:Minimap Controls
The minimap supports several user interactions:- Click to move - Click anywhere on the minimap to pathfind to that location
- Zoom - Scroll wheel to zoom in/out
- Drag - Drag the minimap window to reposition (edit mode)
- Resize - Resize the minimap window (edit mode)