Conversation
… cleanup Phase 1: hoist per-frame allocations (colMap, RK), convert boolean-threshold Math.hypot checks to squared-distance where the sqrt value isn't otherwise reused, replace updateDebug's scene.traverse light count with the existing _plVisN counter. Phase 2: settings sliders (resolution/bloom/exposure/volume) fired a full SAVE.persist() plus a full-scene material needsUpdate sweep on every drag tick instead of once on release, forcing a WebGPU pipeline recompile per tick. Split each into a cheap oninput (live preview only) and an onchange that does the expensive commit. Phase 3: SAVE.persist() serialized all 3 character slots from ~50 call sites with no throttling. Debounce the non-showNote path in saveProgress() by 200ms (showNote saves stay synchronous, unchanged UX), with flushSaveProgress() to commit immediately on tab close. Fixed a found-in-review regression where beforeunload only flushed when `running` was true, silently dropping the death-state save since gameOver() clears `running` before its own saveProgress(false) call. Phase 4: replace .filter()-based array reallocation with the existing _compact() idiom for status-effect ticking and monster removal (kill/flee), and extend the town-only interactables() cache to wild/dungeon zones. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Phase 5: town zone had no resident cache unlike dungeon/wild, so every enterTown() disposed and fully rebuilt+re-merged scenery even on a repeat visit to an already-built town. Thread a `group` param through the town builder helpers (previously hardcoded to townSceneryGroup) so each town id can be built once into its own sub-group, cached, and re-shown via .visible toggling on repeat visits — same pattern dungeonBiomeCache/ wildRegionCache already use. Phase 6: resolveCircles() was a brute-force scan over every dungeon-floor collider for every monster and the player, every frame, with no spatial partitioning — the largest uncached CPU cost under load since a floor's interior walls alone can add several hundred collider circles. Add a broad-phase bucket (dungeonCollidersNear) keyed on the dungeon layout's own existing room-grid cells, with incremental add/remove wired through the "waller" elite affix's temp walls. Scoped to dungeon only; monsters/ projectiles and wild/town collision are unchanged. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
killMonster double-drop: Phase 4 deferred monster removal (m.dead + end-of-frame _compact) but killMonster wasn't idempotent, so a monster killed by one source could be re-killed by another in the same frame (deathnova chain, a second volley bolt) or a next-frame AoE before compaction — re-running its full loot/gold/gem drops. Guard with an early `if (m.dead) return;`. Save-on-close: Phase 3's beforeunload flushSaveProgress() returned early when no debounce was pending (~98% of the time), losing xp/gold/kills accrued since the last 8s autosave — the old saveProgress(false) always committed fresh state. flushSaveProgress now copies live player state and persists unconditionally. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ion) Phase 5's townCache had no kit-upgrade check, unlike wild/07-wild.js. The title-screen buildTown() (16-zones.js) runs before buildings/props/cobble finish loading, so it cached the procedural box-house fallback — and rebuildZoneScenery()/the cobble hook, which call buildTown() again once assets arrive, hit the cache and only toggled .visible, freezing the early look forever. Mirror wild: tag each cached sub with a kit signature over the three monotonic async inputs (BUILDINGS_READY|PROPS_READY|_cobbleBase) and reuse the cache only while it matches; otherwise tear the sub down (meshes + its own town:<id> light bucket) and rebuild in place with the real assets. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Promotes the perf pass and follow-up fixes from
devtomaster.Changes
All 82 tests pass.
🤖 Generated with Claude Code