diff --git a/CLAUDE.md b/CLAUDE.md index d1e012e..f462630 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -698,14 +698,39 @@ inn door, click NPC, pick up item. Freeze list active — M1's phases are off-limits until M7 polish. Writeup at top of M1 block in `docs/plans/2026-05-12-milestones.md`. -**Currently working toward: M2 — "Kill a drudge."** Equip a sword, -walk to a drudge, swing, see damage in chat, watch the swing -animation, drudge dies and drops loot, pick up the loot, open -inventory and see it. Phases to ship: F.2 (Inventory panel), F.3 -(Combat math + damage flow), F.5a (visible-at-login dev panels — -Attributes / Skills / Equipped / Inventory list, minimal ImGui), -L.1c (combat animation wiring), L.1b (command router prereq). -~6–10 weeks from 2026-05-16. +**Currently working toward: M1.5 — "Indoor world feels right."** Opened +2026-05-20 after continued indoor testing surfaced a deep family of +physics + lighting bugs that span buildings AND dungeons. Demo +scenario: enter the Holtburg Sewer through the in-town portal, +navigate through (walls block, stairs work, items block, lighting +reads correctly), exit back to town. Phases to ship: A6 (Indoor +physics fidelity, cdb-driven) + A7 (Indoor lighting fidelity, +RenderDoc + retail-decomp driven). Issues in scope: #80, #81, #83, +#88, #90 (workaround removal), L-indoor, L-spotlight, stairs, +2nd-floor, cellar, and the `TryFindIndoorWalkablePlane` synthesis +removal. Estimated 3–5 weeks calendar work. **M2 ("Kill a drudge") +is deferred until M1.5 lands** — drudges live in dungeons and the +M2 demo target requires solid indoor navigation. Full M1.5 writeup +at the corresponding block in `docs/plans/2026-05-12-milestones.md`. + +**Today's pre-M1.5 baseline (2026-05-20).** Five surgical fixes +shipped to close the user-reported "logged in inside the inn, ran +through walls" bug: A4 (multi-cell BSP iteration, `691493e`), +#89 (sphere-overlap in CheckBuildingTransit, `7ac8f54`), +#90 (sphere-overlap stickiness in ResolveCellId, `4ca3596` — WORKAROUND, +flagged for removal in A6.P4), #91 (indoor cell shadows in +FindObjCollisions, `c0d8405`), #92 (server cell id at player-mode +entry, `23ab173`). 1147 + 8 baseline maintained throughout. Walls ++ furniture block correctly at Holtburg inn and surrounding cottages +as of visual verification 2026-05-20. M1.5 starts from this baseline. + +**M2 ("Kill a drudge") — deferred.** Equip a sword, walk to a drudge, +swing, see damage in chat, watch the swing animation, drudge dies +and drops loot, pick up the loot, open inventory and see it. Phases +to ship after M1.5: F.2 (Inventory panel), F.3 (Combat math + damage +flow), F.5a (visible-at-login dev panels — Attributes / Skills / +Equipped / Inventory list, minimal ImGui), L.1c (combat animation +wiring), L.1b (command router prereq). ~6–10 weeks once M1.5 lands. **Work-order autonomy — the meta-rule.** You decide what to work on next, always. **The user does NOT pick between phases, milestones, or diff --git a/docs/ISSUES.md b/docs/ISSUES.md index 415727c..86b8a62 100644 --- a/docs/ISSUES.md +++ b/docs/ISSUES.md @@ -203,7 +203,7 @@ matching torch-light pools. ## #80 — Camera on 2nd floor goes very dark -**Status:** OPEN +**Status:** OPEN — **M1.5 scope (A7 lighting fidelity)** **Severity:** MEDIUM **Filed:** 2026-05-19 **Component:** lighting @@ -232,7 +232,7 @@ ground floor; transition is not abrupt. ## #81 — Static building stabs don't react to atmospheric lighting changes -**Status:** OPEN +**Status:** OPEN — **M1.5 scope (A7 lighting fidelity)** **Severity:** MEDIUM **Filed:** 2026-05-19 **Component:** lighting, rendering @@ -284,8 +284,8 @@ slopes shows matching shading. ## #83 — Indoor multi-Z walking broken (cellars, 2nd floors, intermittent falling-stuck) -**Status:** OPEN — foundation work landed 2026-05-19, root-cause fix deferred to a follow-up investigation phase -**Severity:** HIGH (blocks vertical indoor traversal + degrades single-floor cases) +**Status:** OPEN — **M1.5 scope (A6 physics fidelity, primary umbrella issue)**. Foundation work landed 2026-05-19; root-cause fix scoped to A6.P1-P3 cdb-driven investigation. +**Severity:** HIGH (blocks vertical indoor traversal + degrades single-floor cases). M1.5 acceptance depends on this closing. **Filed:** 2026-05-19 **Component:** physics, movement, resolver @@ -472,7 +472,7 @@ propagates through portal connectivity data in `CEnvCell`. ## #88 — Indoor static objects vibrate (bookshelves, open furnaces) -**Status:** OPEN +**Status:** OPEN — **M1.5 scope (A6 physics — suspected sub-step state corruption family)** **Severity:** MEDIUM (visual jitter; doesn't block gameplay) **Filed:** 2026-05-19 **Component:** rendering, animation @@ -511,8 +511,8 @@ propagates through portal connectivity data in `CEnvCell`. ## #90 — Cell-id ping-pong at indoor doorway threshold -**Status:** OPEN -**Severity:** HIGH (blocks visible value of Phase A4 multi-cell BSP iteration; user-reported as "walls walk through everywhere in the inn") +**Status:** OPEN — **WORKAROUND in place (sphere-overlap stickiness, commit `4ca3596`). M1.5 scope (A6.P4) — workaround removal after underlying push-back fix.** User-visible symptom resolved 2026-05-20; root cause still to investigate. +**Severity:** HIGH (workaround unblocks indoor visibility for M1.5 baseline; M1.5 acceptance requires the proper fix) **Filed:** 2026-05-20 **Component:** physics — cell tracking @@ -534,6 +534,46 @@ Retail oracle for cell-id hysteresis: `acclient_2013_pseudo_c.txt:308742-308783` --- +## #93 — Indoor lighting broken (M1.5 lighting umbrella) + +**Status:** OPEN — **M1.5 scope (A7 lighting fidelity, primary lighting issue)** +**Severity:** HIGH (degrades indoor experience; M1.5 acceptance depends on it closing) +**Filed:** 2026-05-20 +**Component:** lighting, rendering + +**Description:** Interior cells (inn, cottages, dungeons — anywhere with `cellLow >= 0x0100`) render with lighting that doesn't match retail. Specific symptoms include #80 (2nd floor goes dark), wrong per-cell ambient, missing cell-internal light sources (torches/lanterns), and outdoor day-cycle bleeding into indoor cells. Umbrella issue covering the family; sub-issues to be filed during A7.L1 probe spike. + +**Root cause / status:** Suspected family of bugs in (a) per-cell environment-light tag parsing from the dat (we may not parse `cell.envLightInfo` correctly), (b) cell-light association (which lights belong to which cell), (c) indoor visibility culling for lights, (d) the indoor branch of `GameWindow.UpdateSunFromSky` which uses a flat ambient. Investigation deferred to A7.L1. + +**Files:** +- `src/AcDream.App/Rendering/GameWindow.cs:8330+` (`UpdateSunFromSky`, indoor branch with flat ambient) +- `src/AcDream.App/Rendering/Shaders/mesh_modern.frag` (per-pixel light evaluation) +- `references/WorldBuilder/...` (any WB lighting helpers we inherit) +- Retail oracle: grep `Render::lighting_*` in `acclient_2013_pseudo_c.txt` + +**Acceptance:** Holtburg inn interior lighting matches retail at the same character position. Holtburg Sewer dungeon torchlight reads correctly per-room. 2nd-floor cells brightness matches ground floor. + +--- + +## #94 — Held items project spotlight on walls + +**Status:** OPEN — **M1.5 scope (A7 lighting fidelity)** +**Severity:** MEDIUM (visual fidelity; doesn't block gameplay) +**Filed:** 2026-05-20 +**Component:** lighting, rendering + +**Description:** Items the player is holding (torches, light-source items) project a spotlight effect onto nearby walls. The spotlight direction is wrong — should be omnidirectional from the item, but appears to project specifically toward wall surfaces. + +**Root cause / status:** Per-entity light direction transform. `LightingHookSink` owner-tracking applies an entity-rotation transform that's probably wrong for held-light items — likely passing the entity's facing-direction as the spotlight cone direction when retail's behavior is omnidirectional point-light. + +**Files:** +- `src/AcDream.App/Rendering/Vfx/LightingHookSink.cs` (suspected — verify during A7.L1) +- `src/AcDream.App/Rendering/Shaders/mesh_modern.frag` (point-light eval branch) + +**Acceptance:** Held-item lighting illuminates nearby surfaces uniformly without directional cone artifacts. Matches retail's behavior at the same item in same scene. + +--- + **Status:** DONE diff --git a/docs/plans/2026-04-11-roadmap.md b/docs/plans/2026-04-11-roadmap.md index 9a57d3d..ebe7ce4 100644 --- a/docs/plans/2026-04-11-roadmap.md +++ b/docs/plans/2026-04-11-roadmap.md @@ -85,6 +85,99 @@ Plus polish that doesn't get its own phase number: ## Phases ahead — agreed order +### Milestone M1.5 — "Indoor world feels right" (active, opened 2026-05-20) + +The current top of the work order. Two phases (A6 + A7) inside one +milestone. M2 ("kill a drudge") is deferred until M1.5 lands — +drudges live in dungeons and the M2 demo target requires solid indoor +navigation. Full milestone block in +[`docs/plans/2026-05-12-milestones.md`](2026-05-12-milestones.md). + +**Today's pre-M1.5 baseline** (2026-05-20 — committed in this +session): A4 multi-cell BSP iteration (`691493e`), #89 sphere-overlap +in CheckBuildingTransit (`7ac8f54`), #90 sphere-overlap stickiness in +ResolveCellId (`4ca3596` — **WORKAROUND**, scheduled for removal in +A6.P4), #91 indoor cell shadows in FindObjCollisions (`c0d8405`), +#92 server cell id at player-mode entry (`23ab173`). 1147 + 8 baseline +maintained. Holtburg inn + cottage interiors visually verified +2026-05-20. + +#### Phase A6 — Indoor physics fidelity (cdb-driven) + +**Hypothesis:** Our `BSPQuery.FindCollisions` 6-path dispatcher (and +its callers) produce collision responses that systematically diverge +from retail's. Symptoms in different geometry (doorways, stairs, +multi-Z, cellars, dungeons) share one underlying mechanism — most +likely push-back distance / direction / CP synthesis. + +**Investigation methodology:** cdb-attached comparison. Toolchain +documented in CLAUDE.md's "Retail debugger toolchain" section. Used +successfully 2026-04-30 for the steep-roof case. Matching binaries +(acclient.exe v11.4186) + PDB present. + +**Sub-pieces (slices):** +- **A6.P1 — cdb probe spike** (~3 days). Build cdb scripts capturing + retail's per-tick state at 9 scenarios: + - 4 building sites: Holtburg inn doorway, inn stairs, inn 2nd floor, + cottage cellar. + - 5 dungeon sites: Holtburg Sewer entry portal, first stair descent, + inter-room portal transition, open central area, dark corridor. + Breakpoints on `set_collide`, `step_sphere_up`, `step_sphere_down`, + `transitional_insert`, `set_contact_plane`, `validate_walkable`. + Mirror with our equivalent probes (`[indoor-bsp]`, `[cp-write]`, + new `[push-back]`). +- **A6.P2 — Analysis report** (~1 day). Quantify the per-call-site + gap. Identify which BSP path(s) over- or under-correct. Output: + 1–3 specific bug findings with retail decomp anchors. +- **A6.P3 — Fix the BSP correction paths** (~3–5 days). Surgical + fixes informed by A6.P2 data. Likely touches `BSPQuery.AdjustSphereToPlane`, + `AdjustOffsetToPlane`, Path 5 / Path 6 branches, sub-step state + mutation. +- **A6.P4 — Remove workarounds** (~1 day). Revert #90 sphere-overlap + stickiness in `PhysicsEngine.ResolveCellId`. Delete + `Transition.TryFindIndoorWalkablePlane` + its caller in + `FindEnvCollisions`. Verify behavior holds without the workarounds. + +#### Phase A7 — Indoor lighting fidelity (RenderDoc + retail-decomp driven) + +**Hypothesis layers (less mapped than physics):** +- Per-cell environment-light tag association — indoor cells should + inherit only their own env lights, not outdoor day-cycle. +- Light visibility culling — what lights actually contribute to each + cell's render. +- Per-entity light direction transform — held-item-spotlight bug + (#L-spotlight) is per-entity attribution gone wrong. +- Static-stab atmospheric inheritance (#81). + +**Investigation methodology:** less existing infrastructure than +physics. Requires: +- New `[indoor-light]` probe (per-frame dump of active lights for the + player's cell + each visible entity: position, color, attenuation, + direction). +- RenderDoc frame capture at the same 9 scenarios as A6. +- Grep retail's `Render::lighting_*` family in + `acclient_2013_pseudo_c.txt` to map per-cell light selection logic. + +**Sub-pieces (slices):** +- **A7.L1 — Lighting probe spike** (~3–5 days). Build `[indoor-light]` + probe. Capture baselines at all 9 scenarios. RenderDoc captures + paired with each. Decomp study of retail's lighting selection. +- **A7.L2 — Analysis report** (~1–2 days). Likely surfaces 2–4 + distinct bugs across the lighting issues. +- **A7.L3 — Fix lighting paths** (~3–7 days). Wide variance because + the surface area is unknown. Could touch indoor env-light parsing, + `LightingHookSink`, WB rendering pipeline, shader uniforms. + +**M1.5 acceptance criterion (shared by A6 + A7):** Walk Holtburg Sewer +end-to-end. Walls block (physics). Stairs work (physics). Items +block (physics). Lighting reads correctly throughout (lighting). +Cell transitions are smooth (physics). No regressions in M1 outdoor +behavior. Estimated 17–26 days focused work, 3–5 weeks calendar. + +**Specs:** to be written 2026-05-20 (after milestone commit lands). + +--- + ### Phase A — Foundation (in progress) **Goal:** walk across 10+ landblocks without crashes, without hitches at landblock boundaries, and without framerate cratering. diff --git a/docs/plans/2026-05-12-milestones.md b/docs/plans/2026-05-12-milestones.md index a6ffc96..86c1f6f 100644 --- a/docs/plans/2026-05-12-milestones.md +++ b/docs/plans/2026-05-12-milestones.md @@ -2,7 +2,7 @@ **Status:** Living document. Created 2026-05-12. **Sits above:** [`docs/plans/2026-04-11-roadmap.md`](2026-04-11-roadmap.md) (the strategic phase index). -**Currently working toward:** **M1 — Walkable + clickable world.** +**Currently working toward:** **M1.5 — Indoor world feels right.** --- @@ -185,7 +185,79 @@ close range and the player sees "You pick up the X." in chat. --- -### M2 — "Kill a drudge" — 🔵 NEXT (~6–10 weeks after M1) +### M1.5 — "Indoor world feels right" — 🔵 NEXT (active, opened 2026-05-20) + +**Demo scenario:** Enter the Holtburg Sewer dungeon through the in-town entry +portal. Navigate to the end (5–7 rooms with stairs + a multi-Z chamber). +Exit back to town. Throughout the walk: + +- Walls block — no walk-through anywhere, indoor or stab-shell. +- Stairs work — ascend + descend without falling through or stuck-in-falling. +- Items block — sarcophagi, urns, decorations, tables, chests, fireplaces. +- Lighting reads correctly — torchlit rooms are bright, dark corridors are + dark, no spotlights projecting onto walls from held items, no upper-floor + dimming bug, static decorations participate in the day-cycle (outside) and + in per-cell environment lighting (inside). +- Cell transitions are smooth — no CellId ping-pong, no flicker. + +**Why this is its own milestone:** M1 landed walkable + clickable as a +specification (the doorways open, NPCs select, items pick up — all visible +in the demo target). But continued indoor testing surfaced a deep family of +physics + lighting bugs (BSP push-back distance probably diverges from +retail, per-frame ContactPlane synthesis is a known unfaithful stop-gap, +indoor lighting + item-spotlight bugs reported during 2026-05-21 sessions). +Three workarounds shipped today (#89 sphere-overlap CheckBuildingTransit, +#90 sphere-overlap stickiness, #92 spawn-cell-id seed) closed the visible +symptom at Holtburg inn, but #90 specifically is a CLAUDE.md-rules +workaround (explicit retail divergence) that needs a proper root-cause fix. +The umbrella indoor-physics issue (#83) has been open since 2026-05-19 with +multiple aborted fix attempts. Promoting this to milestone scope forces the +fix to be central, retail-anchored, and complete — not another whack-a-mole +patch. + +**Phases included:** + +| Phase | What it does | +|---|---| +| A6 — Indoor physics fidelity (cdb-driven) | Capture retail's per-tick BSP collision response state at 9 scenarios (4 buildings + 5 dungeon sites). Analyze the gap vs ours. Fix BSP correction paths. Remove #90 stickiness + `TryFindIndoorWalkablePlane` synthesis workarounds. | +| A7 — Indoor lighting fidelity (RenderDoc + retail-decomp) | Capture per-cell light state + per-pixel attribution at the same 9 scenarios. Analyze cell-light association, visibility culling, per-entity light direction. Fix indoor lighting + #80 (upper-floor dark) + #81 (static-stab atmospheric) + the held-item-spotlight bug. | + +**Issues in scope (M1.5):** + +- **#80** — Camera on 2nd floor goes very dark +- **#81** — Static building stabs don't react to atmospheric lighting +- **#83** — Indoor multi-Z walking broken (cellars, 2nd floors, intermittent falling-stuck) +- **#88** — Indoor static objects vibrate (suspected sub-step state corruption) +- **#90** — CellId ping-pong (workaround in place; remove during A6.P4) +- **L-indoor** — Lighting indoors broken (file as new # during M1.5 kickoff) +- **L-spotlight** — Items projecting spotlight on walls (file as new # during M1.5 kickoff) +- **Stairs walk-through** — file as new # during M1.5 kickoff +- **2nd-floor walking** — file as new # during M1.5 kickoff +- **Cellar descent** — file as new # during M1.5 kickoff +- **`TryFindIndoorWalkablePlane`** — synthesis workaround removal (Bug A's original goal, finally unblocked) + +**Frozen phases during M1.5:** all M0 + M1 phases stay frozen. Plus +specifically the recently-shipped A4 + #89 + #91 + #92 (today's work) — those +land in main as the M1.5 baseline and shouldn't be revisited except as part +of A6.P4 removal of the workarounds. + +**Estimated timeline:** 3–5 weeks calendar (17–26 days focused work). Bigger +than a normal milestone because lighting is open-ended (less existing +diagnostic infrastructure than physics). Could be shorter if the cdb +analysis surfaces a single-fix opportunity. + +**What "M1.5 lands" looks like:** the indoor world reads as solid. Players +can navigate buildings, basements, multi-floor inns, and dungeons without +encountering walls they walk through, lighting that looks wrong, or +position glitches. The two known workarounds (#90 stickiness + +TryFindIndoorWalkablePlane synthesis) are removed; the codebase no longer +has indoor-physics "duct-tape." Dungeons are usable enough to support M2's +"kill a drudge" demo target (drudges live in dungeons; this milestone +unblocks that). + +--- + +### M2 — "Kill a drudge" — ⏸ DEFERRED until M1.5 lands (was: NEXT) **Demo scenario:** Equip a sword. Walk to a drudge. Swing. See "You hit Drudge for 12 slashing damage (87%)" in chat. Watch the swing animation diff --git a/docs/research/2026-05-21-open-items-pickup-prompt.md b/docs/research/2026-05-21-open-items-pickup-prompt.md index 0033a2e..d20d4b0 100644 --- a/docs/research/2026-05-21-open-items-pickup-prompt.md +++ b/docs/research/2026-05-21-open-items-pickup-prompt.md @@ -6,17 +6,33 @@ relate, what depends on what, what order makes sense. The pasteable session-start prompt is at the bottom of this doc. -## The landscape at a glance (updated 2026-05-20) +## The landscape at a glance (updated 2026-05-20 — MILESTONE PROMOTION) -| # | Item | Domain | Depends on | M2-blocker? | +**Status as of end of 2026-05-20 session:** the original 6-item landscape +has been promoted to a milestone of its own — **M1.5 "Indoor world feels +right"** — opened today. M2 ("Kill a drudge") is deferred until M1.5 lands. +Today's session shipped a 5-fix M1.5 baseline (A4 + #89 + #90 workaround + +#91 + #92) closing the user-visible "walls walk through at Holtburg inn" +symptom; the proper root-cause fix (BSP push-back distance investigation + +synthesis removal) is the actual M1.5 work. + +| # | Item | Domain | M1.5 phase | Status | |---|---|---|---|:---:| -| **#90 ping-pong** | **NEW TOP BLOCKER** — CellId flips between outdoor `0xA9B40022` and indoor vestibule `0xA9B40164` on each wall push-back at the inn doorway; user perceives "walls walk through everywhere" | Collision — cell tracking | — | **YES** (M2) | -| A4 | ~~Walls walk-through in vestibule cells — multi-cell BSP iteration~~ | Collision | — | **CLOSED 2026-05-20** (shipped, but dormant in practice until #90 is fixed) | -| stairs | Stairs walk-through — likely same root cause as #90 (also a doorway-edge geometry issue) | Collision | #90 | YES (likely subsumed by #90) | -| A2 | PHSP inversion — `polygon_hits_sphere` early-return logically inverted vs retail | Collision math | — | Low (subtle correctness only) | -| A3 | Synthesis removal — delete `TryFindIndoorWalkablePlane`, rely on retail CP retention | Architectural | A4 + #90 + A2 | No (cleanup, retail-faithful) | -| L-indoor | Lighting indoors broken | Rendering | — | No (M7 polish) | -| L-spotlight | Items projecting spotlight on walls | Rendering | — | No (M7 polish) | +| A4 | Multi-cell BSP iteration — walls in adjacent cells too | Collision | (baseline, shipped) | ✅ CLOSED 2026-05-20 | +| #89 | Sphere-overlap in CheckBuildingTransit | Collision | (baseline, shipped) | ✅ CLOSED 2026-05-20 | +| #90 | CellId ping-pong at doorway threshold (workaround in place) | Collision — cell tracking | A6.P4 (workaround removal) | ⚠ WORKAROUND | +| #91 | Indoor cell shadows in FindObjCollisions | Collision | (baseline, shipped) | ✅ CLOSED 2026-05-20 | +| #92 | Server cell id at player-mode entry | Cell tracking | (baseline, shipped) | ✅ CLOSED 2026-05-20 | +| #83 | Indoor multi-Z walking (cellars, 2nd floors) — UMBRELLA | Physics | A6.P1-P3 | OPEN (M1.5 primary) | +| stairs | Stairs walk-through + stuck-in-falling | Physics | A6.P1-P3 (subsumed by #83) | OPEN | +| 2nd-floor / cellar | Multi-Z navigation | Physics | A6.P1-P3 (subsumed by #83) | OPEN | +| `TryFindIndoorWalkablePlane` | Per-frame CP synthesis (99.87% MISS) | Physics — synthesis removal | A6.P4 | OPEN (workaround) | +| #88 | Indoor static objects vibrate | Physics — sub-step state | A6 (suspected family) | OPEN | +| **#93** | Indoor lighting broken (UMBRELLA — new) | Lighting | A7.L1-L3 | OPEN (M1.5 primary) | +| **#94** | Held items project spotlight on walls (new) | Lighting | A7.L1-L3 | OPEN | +| #80 | Camera on 2nd floor goes dark | Lighting | A7.L1-L3 | OPEN | +| #81 | Static building stabs don't react to atmospheric lighting | Lighting | A7.L1-L3 | OPEN | +| A2 | PHSP inversion | Collision math | post-M1.5 (Low) | OPEN | ## Two domains, one critical-path chain