fix(portal): commit destination projection before reveal

Retail installs the destination CObjCell before hidden world simulation resumes. Rebucket the retained local-player projection inside the Place transaction so Hidden/UnHide scripts and particles settle behind the portal viewport instead of firing after reveal. Preserve the existing unloaded-cell scheduler gate and pin the ordering with a cross-landblock placement test.

Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
Erik 2026-07-25 10:32:21 +02:00
parent 1a14812c44
commit 7aa9618136
4 changed files with 173 additions and 1 deletions

View file

@ -1211,7 +1211,7 @@ Passed 2026-07-17: “Yes works.”
## #218 — Portal silhouette pose, destination reveal, and indoor observer snap
**Status:** DONE — 2026-07-21, final two-client observer gate user-confirmed
**Status:** REGRESSION FIX IMPLEMENTED 2026-07-25 — visual re-gate pending
**Severity:** HIGH
**Filed:** 2026-07-16
**Component:** portal VFX / streaming / physics / outbound movement
@ -1263,10 +1263,23 @@ SmartBox projection, matching `SmartBox::RenderNormalMode`/`GameSky::Draw`;
the old fixed 60-degree sky camera exposed the clear/fog background during the
nearly 180-degree exit warp.
A later retained-runtime regression left one half of destination placement
uncommitted: the controller, mesh transform, and authoritative `FullCellId`
advanced, but the local player's live projection remained in its old/pending
GPU bucket. Since retail `CPhysicsObj::update_object @ 0x00515D10` advances
scripts only with a non-null cell, acdream correctly paused the queued Hidden
PES—but for the wrong reason and until after viewport reveal. Connected traces
showed `0x33000331` firing only after the normal world became visible, directly
causing the opaque pop and late purple/action tail. `LocalPlayerTeleportPlacement`
now rebuckets the same retained entity to the resolved destination cell before
spatial reconciliation and before destination simulation resumes. Legitimate
unloaded-cell script pausing remains unchanged.
**Files:** `src/AcDream.Core/Physics/AnimationSequencer.cs`;
`src/AcDream.App/Rendering/GameWindow.cs`;
`src/AcDream.App/Streaming/StreamingController.cs`;
`src/AcDream.App/Streaming/GpuWorldState.cs`;
`src/AcDream.App/Streaming/LocalPlayerTeleportController.cs`;
`src/AcDream.App/Rendering/Wb/LandblockSpawnAdapter.cs`;
`src/AcDream.App/Rendering/Wb/ObjectMeshManager.cs`;
`src/AcDream.App/Rendering/Sky/SkyProjection.cs`;

View file

@ -204,6 +204,62 @@ WorldBuilder cross-check: its upload queue similarly distinguishes generated
CPU scenery from render-thread GPU publication (`GameScene.ProcessUploads`),
which confirms that worker completion alone is not draw readiness.
### 2.1. Destination placement enters the spatial cell before simulation resumes
Named retail references:
- `CPhysicsObj::change_cell` at `0x00513390`
- `CPhysicsObj::update_object` at `0x00515D10`
- `CPhysicsObj::enter_world` at `0x00516170`
- `CPhysicsObj::prepare_to_enter_world` at `0x00511FA0`
- `CPhysicsObj::set_hidden` at `0x00514C60`
Retail does not separate an accepted destination Position from the object's
live cell pointer. `enter_world` runs `SetPosition`, which installs the object
in its destination `CObjCell`, before the PartArray and MovementManager
enter-world boundaries complete. `update_object` then rejects only a parented
object, a null `cell`, or a Frozen object; Hidden is not a reason to skip the
ScriptManager/ParticleManager tail.
```text
accepted portal destination becomes ready:
player.enter_world(destination)
SetPosition(destination)
change_cell(destination CObjCell)
PartArray.HandleEnterWorld()
MovementManager.HandleEnterWorld()
destination simulation resumes behind the portal viewport
update_object()
require cell != null and not Frozen
UpdateObjectInternal()
advance ScriptManager and ParticleManager
```
acdream keeps authoritative full-cell identity and render-bucket residency as
separate facts because its world streams asynchronously. The portal arrival
transaction must therefore commit both facts before releasing destination
simulation:
```text
LocalPlayerTeleportPlacement.Place:
resolve and set controller/body position
update retained WorldEntity root transform
RebucketLiveEntity(destination full cell)
reconcile child/effect/light poses
signal materialized and release world simulation
```
A 2026-07-25 connected trace proved the missing rebucket was the cause of the
spell-recall exit regression. The local record had destination `FullCellId`,
resources, and a logical projection, but remained non-resident in its old or
pending GPU bucket. The queued Hidden PES `0x33000331` consequently stayed
paused until the normal world was already visible, then fired immediately
before UnHide stopped it. That produced both the sudden opaque character and
the late purple/recall tail. The correct fix is the missing destination spatial
commit, not a recall classifier, timer, or relaxation of the legitimate
unloaded-cell script gate.
## 3. Successful indoor transitions commit the canonical outbound Position
Named retail references: