From c2193e2e80c5df8649254b9216e8cf9e44cea872 Mon Sep 17 00:00:00 2001 From: Joe DiPrima Date: Fri, 14 Aug 2026 16:21:44 -0500 Subject: [PATCH] #49 FIXED + OPERATOR-VERIFIED: the radar draws the static world again -- walls, buttes, hills, ridges, buildings, trees. Root cause (radar/map drift audit, 3-agent, receipts in scratchpad/night17/radar_audit_*.txt): the original filed every pip-bearing Terrain-GRAPH entity into the gauge staticEntities grid via the interest feed (@004cbfa0: pip gate, Mover->moving / Terrain->static; the derivation graph parents UnscalableTerrain 0x2A + CulturalIcon 0x5E + Landmark 0x56 onto Terrain [T0 TERRAIN.cpp:183]), and MapDisplay::DrawStatic (@004c25b4) drew each entity's AUTHORED vector-outline pip (110 type-0x12 GIMs ship: wall1-3, aw01-05 arena walls, buttea-e, hillg/dhillg, sr1e/n/s/w polar ridges, trees, buildings) world-rotated and metre-scaled. The port's RebuildEntityGrid (the shim replacing the dropped interest feed) iterated DYNAMIC entities only -- the 1008 statically-registered UnscalableTerrain instances never reached the grid, so the scope showed no world at all. Fix: a third pass files non-dynamic Terrain-graph entities from HostManager::AllEntityIterator; pipless entities (floors, sky, the wall10k outer fence -- authentically invisible on the shipped radar too) no-op at the pip lookup exactly as on the machine. Receipts: [map-grid] worldStatics census + a capped per-static [map] dump (cls/rid/pip/dsq) symmetric to DrawMoving's. Benched: grass files cls=42 hill rid=2190 pip=1 drawing at 466m beside 313 trees; arena1 files 126 world statics with the aw wall sections (rid 1918/1915) pip=1 drawing and the unpipped walkway/banner props correctly skipped (authored omissions preserved). Operator-verified live on arena1: 'muuuuch better'. Co-Authored-By: Claude Fable 5 Claude-Session: https://claude.ai/code/session_016bw71WVsccjwW7uKRg4aWD --- engine/MUNGA/GAUGREND.cpp | 43 ++++++++++++++++++++++++++++++++++ game/reconstructed/btl4rdr.cpp | 14 +++++++++++ 2 files changed, 57 insertions(+) diff --git a/engine/MUNGA/GAUGREND.cpp b/engine/MUNGA/GAUGREND.cpp index bc507bc..e1bbdab 100644 --- a/engine/MUNGA/GAUGREND.cpp +++ b/engine/MUNGA/GAUGREND.cpp @@ -3675,6 +3675,49 @@ void staticEntities.Add(entity); } } + + // (BT411 #49, 2026-08-14) THE STATIC WORLD FEED -- the missing half of the + // dropped interest feed. The original filed every pip-bearing + // Terrain-GRAPH entity into staticEntities via NotifyOfNewInterestingEntity + // (@004cbfa0: pip-resource gate, then Mover -> moving / Terrain -> static); + // the derivation graph parents UnscalableTerrain (0x2A), CulturalIcon + // (0x5E) and Landmark (0x56) onto Terrain [T0 TERRAIN.cpp:183, + // CULTURAL.cpp:27], so the map streams' walls / arena wall sections / + // buttes / hills / perimeter ridges / buildings / trees (1008 + // UnscalableTerrain + 789 CulturalIcon instances across the shipped maps) + // were all radar-visible as authored vector-outline pips (110 type-0x12 + // GIMs ship). The dynamic iterators above never see statically-registered + // entities (Host::AddEntity files them into allEntitySocket only), so the + // port's scope drew NO static world at all -- the #49 walls and the field's + // 'map items not showing'. File non-dynamic Terrain-graph entities here; + // pipless ones (floors, sky, the wall10k outer fence -- authentically + // invisible on the shipped radar too) no-op at DrawStatic's pip lookup + // exactly as they did on the machine. + int world_statics = 0; + { + HostManager::AllEntityIterator all_iterator(host_manager); + all_iterator.First(); + Entity *entity; + while ((entity = all_iterator.ReadAndNext()) != NULL) + { + if (entity->IsDynamic()) // dynamics already sorted above + continue; + if (entity->IsDerivedFrom(*Terrain::GetClassDerivations())) + { + staticEntities.Add(entity); + ++world_statics; + } + } + } + // census receipt (#49 bench): an empty static scope must be + // distinguishable from a culled one. ~1 Hz under BT_MAP_LOG. + if (getenv("BT_MAP_LOG")) + { + static int s_census = 0; + if ((s_census++ % 60) == 0) + DEBUG_STREAM << "[map-grid] worldStatics=" << world_statics + << "\n" << std::flush; + } Check_Fpu(); } diff --git a/game/reconstructed/btl4rdr.cpp b/game/reconstructed/btl4rdr.cpp index ac061d9..d9fcc12 100644 --- a/game/reconstructed/btl4rdr.cpp +++ b/game/reconstructed/btl4rdr.cpp @@ -867,6 +867,20 @@ void Pip *pip = (pips != NULL) ? pips->LookUpPip(entity->GetResourceID()) // FUN_004688ce(pips+0x58,entity+0x1bc,0) : NULL; + // (#49 bench receipt) per-static dump, symmetric to DrawMoving's -- + // answers "is the list empty, the pip lookup missing, or the cull + // eating it" straight from a field log. Capped; BT_MAP_LOG. + if (getenv("BT_MAP_LOG")) + { + static int s_sd = 0; + if (s_sd++ < 400) + DEBUG_STREAM << "[map] static ent=" << (void *)entity + << " cls=" << (int)entity->GetClassID() + << " rid=" << entity->GetResourceID() + << " pip=" << (pip != NULL ? 1 : 0) + << " dsq=" << (float)(delta.x*delta.x + delta.z*delta.z) + << ((s_sd == 400) ? " (cap)" : "") << "\n" << std::flush; + } if (pip != NULL) { AffineMatrix blipXform;