Realmlords — Version 4.6.3 Major Patch
## Skill Trees
**Free Tree Investment**
- Removed the 30-point single-tree commitment lock. You can now invest freely across all three trees for your class.
- Tier progression still applies: 3 points must be spent in a tier before the next tier unlocks.
**Attack Ability Rebalancing (All Classes)**
- Audited every class to ensure no single tree holds a disproportionate number of attack abilities.
- Archer: Ice Arrow moved to Marksmanship, Lightning Arrow moved to Trapper. Fire Arrow and Poison Arrow remain in Hunter.
- Wizard: Added Inferno Mine (Pyromancy), Arcane Bolt and Arcane Surge (Arcane tree).
- Warrior: Added Iron Slam and Bulwark Strike (Fortitude), Thunder Cleave (Arms).
- Paladin: Added Celestial Orbs and Divine Bolt (Aegis), Crusader's Wrath (Crusader).
- Druid: Added Primal Roar and Wild Claws (Shapeshift), Lightning Root and Earthquake (Wild).
- Bard: Added Song of Wrath (Songs), Ballistic Note (Versatility).
**Skill Color Accuracy**
- Arcane abilities now use purple/dark projectile behaviors instead of yellow lightning.
- Arcane Bolt uses a neutral blue spell behavior. Arcane Surge uses a dark purple wave.
- Bard's Ballistic Note corrected from lightning-yellow to neutral blue spell.
## Skill Icons & Hover Text
- Fixed Musical Spells ability using a broken fallback icon — now uses a dedicated musical note icon.
- Fixed DarknessSpell abilities using a broken fallback — now uses a proper darkness icon.
- Fixed ArcaneOrbital, EarthOrbital, and HolyOrbital icons using wrong or missing assets.
- Fixed ArcaneResistance displaying a wrong icon.
- Fixed VIT stat icon case-sensitivity issue on Windows.
- Wand weapon mastery icon updated to a proper staff skin.
- Added over 50 unique icon overrides to eliminate all duplicate icon groups across all 8 classes.
- All new skills added in this patch have unique icons and themed hover text.
## Inventory & Auto-Sell
- Manual sell (clicking "Sell" on an item) now always works regardless of auto-sell keeper rules.
- Equal-stat items: when two items of equal score exist, the equipped one is always kept and the unequipped one is auto-sold.
- Ring tie-breaking fixed — equipped rings are now correctly prioritized over bag rings with identical scores.
- Armor comparison logic now uses a more reliable equipped-item detection method, preventing false "keep" results.
## Multiplayer
- Fixed player index binding in co-op — players now correctly bind to their assigned lobby slot, preventing ability and stat cross-binding.
- Fixed Realm Switch boss victory not syncing to the client in co-op.
- Fixed Realm Anger level not syncing to clients.
- Fixed disconnect during an active run not returning players to the main menu.
- Removed a duplicate `getMultiplayerWrapper` definition that could cause unpredictable behavior.
- Item transfer now uses an acknowledgment system — if a recipient's inventory is full, the item is returned to the sender instead of being lost.
## Asset Loading & Level Transitions
- Ground textures are now retained until the new texture is fully loaded — floors no longer flash black when entering a new level.
- Hazard images and mineral deposit images are pre-warmed during the black-screen fade, eliminating pop-in when entering a level.
- All realm floor textures are preloaded at startup so the first realm portal never cold-loads.
- Fade-from-black on level entry now waits for the ground texture to be ready before revealing the level.
## Performance
- Fixed enemy formation logic assigning all nearby enemies to the same slot, causing clumping and wasted separation calculations.
- Replaced `Math.sqrt` in separation force, distance checks, fog fade, and spawner walkable-search with squared-distance comparisons.
- Door pathfinding (BFS) result is now cached per enemy and per dungeon — enemies no longer recalculate room graphs every frame.
- Particle burst size now scales down dynamically during mass enemy deaths to prevent frame spikes.
- `effects` array trimming replaced from O(n log n) sort+splice to an in-place compact pass.
- Player movement collision no longer allocates new hitbox objects every frame — reuses scratch objects.
- Fog of war bucket array reused per frame instead of reallocated.
- Removed a duplicate `updateFrame()` call in the audio engine that was firing on every sound played.
- `getNearestPlayer` now uses squared distance instead of `Math.hypot`.
## Audio
- Fixed all button sounds being silent due to `ButtonClick.ogg` not existing on disk — replaced with an existing UI-appropriate sound.
- Fixed AudioContext not resuming in time on the first user interaction — sounds triggered on the very first button click now play correctly after the context unlocks.
- Fixed intro menu music, gameplay music, and narration all sharing the same silent-drop bug on first gesture — all three now retry automatically after context resume.
- AudioContext unlock listeners (click, keydown, touchstart) are now persistent — audio stays unlocked even after backgrounding and refocusing the window.
## Stability
- Fixed a critical syntax error in `game.js` (corrupted JSDoc comment) that caused the entire game to fail to load with a blank screen on startup.
