From 7d8da99f79493c45cbc80fc710a8a76434d535bb Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 14 Jun 2026 10:06:17 +0200 Subject: [PATCH] fix(G.3): collapse dungeon streaming at the snap, not after landblock finalize (#133) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dungeon-streaming gate read SeenOutside from the render registry (_cellVisibility.TryGetCell), which only succeeds AFTER the landblock FINALIZES — ~tens of seconds for a 205-cell dungeon. So the collapse fired late and the full 25x25 neighbor window churned in first ("~30s to stabilize at high FPS"). EnvCell extends ObjCell, which already carries SeenOutside (set from the EnvCell dat flags at construction), so CurrCell.SeenOutside is available the moment the player is placed (the snap). Read it directly instead of the registry. Collapse now engages ~3s in (snap) instead of ~30s (finalize); residual is the ~24 neighbors the bootstrap loads before the snap, which then unload. Also simplifies the predicate. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/AcDream.App/Rendering/GameWindow.cs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/AcDream.App/Rendering/GameWindow.cs b/src/AcDream.App/Rendering/GameWindow.cs index a2531674..a42ba321 100644 --- a/src/AcDream.App/Rendering/GameWindow.cs +++ b/src/AcDream.App/Rendering/GameWindow.cs @@ -6890,12 +6890,16 @@ public sealed class GameWindow : IDisposable // window otherwise pulls in ~129 unrelated ocean-grid dungeons. Building // interiors (cottage/inn) have SeenOutside cells, so they are NOT gated // and keep their surrounding terrain. - // Mirrors the playerInsideCell computation below (CurrCell → registry - // LoadedCell.SeenOutside): true only for a sealed indoor cell. + // True only for a sealed indoor cell. Read the physics CurrCell's own + // SeenOutside (ObjCell.SeenOutside, set from the EnvCell dat flags) rather + // than the render registry: the registry lookup only succeeds AFTER the + // landblock FINALIZES (~tens of seconds for a 205-cell dungeon), which + // delayed the collapse and let the full 25×25 neighbor window churn in + // first (the "~30s to stabilize" report). CurrCell.SeenOutside is set the + // moment the player is placed, so the collapse now engages at the snap. bool insideDungeon = false; if (_physicsEngine.DataCache?.CellGraph.CurrCell is AcDream.Core.World.Cells.EnvCell pcEnv - && _cellVisibility.TryGetCell(pcEnv.Id, out var pcReg) - && pcReg is { SeenOutside: false }) + && !pcEnv.SeenOutside) { insideDungeon = true; // Pin the collapse to the cell's OWN landblock (cell id high 16 bits),