acdream/src/AcDream.Core/World
Erik e651cb6dd1 fix(#190): interior entity id counter overflowed past its 8-bit budget, aliasing into the next landblock
Found while investigating #189 (missing fountain/candle particles):
reverting the A7.L1 light-carrier hydration fix (9ebb2060) made the
Town Network fountain's water-spray particle work again, which didn't
fit the earlier dat-truth finding that the fountain's own entity was
never touched by that fix. Traced with ACDREAM_DUMP_ENTITY: the
fountain's hydrated entity.Id shifted between reverted (0x400007F8)
and fixed (0x40000815) builds — a 29-id delta matching the extra
mesh-less light carriers the A7.L1 fix now keeps alive earlier in the
same landblock's hydration pass.

Root cause: GameWindow's interior-entity id scheme
(interiorIdBase + localCounter, "0x40XXYY##") reserves only 8 bits
(256 values) for a landblock's ENTIRE interior static population — a
residual explicitly flagged in the #119 fix's own comment ("counter
overflow past 0xFF still bleeds into the lbY byte"). The Town Network
hub (205 cells, one landblock) already sat at 248 before A7.L1; the
light fix pushed it to 277, past the boundary. 0x40000815 decodes as
landblock Y=0x08 — NOT this dungeon's true Y=0x07 — the exact #119
cross-landblock aliasing bug, reincarnated by entity count instead of
a computation bug. EntityScriptActivator keys particle-script
instances by entity.Id directly (no landblock-hint disambiguation
unlike the #119 batch cache), so the aliased id silently broke the
fountain's script tracking.

Fix: AcDream.Core.World.InteriorEntityIdAllocator widens the counter
8->12 bits (256->4096) by shrinking the fixed class prefix from a
full byte (0x40) to its top nibble (0x4_) — verified safe against
every entity.Id classification check in GameWindow (none decode X/Y
back out, they only check thresholds/prefixes). Added a loud
one-time [id-overflow] log if a landblock ever exceeds the new
budget, so this class of bug can never hide silently again.

Core 2675+2skip / App 741+2skip / UI 425 / Net 385 green.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-07-09 12:21:57 +02:00
..
Cells docs: correct stale UCG CellGraph comments — the graph is active, not inert 2026-06-13 18:35:58 +02:00
DerethDateTime.cs fix(time): retail-canonical month enum + absolute Portal Year + title-bar calendar 2026-04-27 14:43:49 +02:00
InteriorEntityIdAllocator.cs fix(#190): interior entity id counter overflowed past its 8-bit budget, aliasing into the next landblock 2026-07-09 12:21:57 +02:00
LandblockLoader.cs feat(render): Phase A8 — indoor visibility + streaming fixes batch 2026-05-29 10:14:50 +02:00
LoadedLandblock.cs feat(streaming): PhysicsDatBundle on LoadedLandblock (datLock fix scaffold) 2026-06-23 09:31:26 +02:00
MeshRef.cs feat(net+app): TextureChanges applied via Surface→OrigTex resolution (Phase 5a) 2026-04-11 16:22:23 +02:00
PaletteOverride.cs feat(net+app): SubPalette overlays applied to palette-indexed textures (Phase 5b) 2026-04-11 16:30:08 +02:00
PhysicsDatBundle.cs feat(streaming): PhysicsDatBundle on LoadedLandblock (datLock fix scaffold) 2026-06-23 09:31:26 +02:00
SceneryGenerator.cs feat(O-T2): extract pure stateless helpers to AcDream.Core.Rendering.Wb 2026-05-21 15:13:26 +02:00
SkyDescLoader.cs feat(vfx): Phase C.1 — PES particle renderer + post-review fixes 2026-04-28 22:47:11 +02:00
SkyState.cs fix(sky): A7 — correct sun-vector magnitude (ambient + sun were ~32% too bright) 2026-06-18 15:08:52 +02:00
TeleportAnimSequencer.cs refactor(teleport): Slice 1 review cleanup — drop vestigial pending fields; comment the worldReady min-continue gate 2026-06-21 20:07:50 +02:00
WbSceneryAdapter.cs feat(O-T2): extract pure stateless helpers to AcDream.Core.Rendering.Wb 2026-05-21 15:13:26 +02:00
WeatherState.cs weather(phase-7): gut WeatherSystem.Snapshot — passthrough keyframe fog 2026-04-24 12:55:19 +02:00
WorldEntity.cs #119: entity bounds from dat vertex data - works for every case, not just multi-part 2026-06-11 22:39:05 +02:00
WorldView.cs feat(core): add WorldView with 3x3 neighbor landblock computation 2026-04-10 18:02:41 +02:00