fix(world): restore portal and distant use lifecycles

This commit is contained in:
Erik 2026-07-25 09:59:25 +02:00
parent c730632075
commit 1a14812c44
18 changed files with 401 additions and 196 deletions

View file

@ -446,6 +446,57 @@ state through `CPhysicsObj::set_state` `0x00514DD0`. Separately,
`CPhysicsObj::UpdatePositionInternal` `0x00512C30` skips `CPartArray::Update`
while Hidden, so ordinary animation never advances behind the portal viewport.
### Destination simulation resumes before the portal viewport exits
The retail destination has two different release edges. They must not share
one acdream gate:
```text
SmartBox::DoSetState(player, visible):
set_state(...)
waiting_for_teleport = false
SmartBox::UseTime(next frame):
if not cell_manager.blocking_for_cells:
position_update_complete = true
CObjectMaint::UseTime()
CPhysics::UseTime()
gmSmartBoxUI::UseTime:
if SmartBox::teleport_in_progress() changed from true to false:
EndTeleportAnimation()
gmSmartBoxUI::EndTeleportAnimation @ 0x004D65A0:
teleportAnimState = TAS_TUNNEL_CONTINUE
teleportTransitionStartTime = Timer::cur_time
clear temporary FOV override
gmSmartBoxUI::UseTime, at least two seconds later:
TAS_TUNNEL_CONTINUE -> TAS_TUNNEL_FADE_OUT
...
TAS_TUNNEL_FADE_OUT -> TAS_WORLD_FADE_IN
hide portal viewport
show SmartBox world viewport
```
Therefore `TAS_TUNNEL_CONTINUE` is not a continued cell-loading freeze. The
destination world is already ticking behind the private portal viewport for at
least two seconds. That hidden interval is when the player pose, queued
Hidden/UnHide PhysicsScripts, attached emitters, and destination presentation
settle. Only the later `TUNNEL_FADE_OUT -> WORLD_FADE_IN` edge changes which
viewport is drawn.
Holding acdream's world-generation quiescence until the viewport swap is a
behavioral error: the first destination physics/effect tick occurs on the
first visible world frame, producing a character pop plus leftover recall or
purple materialization effects. The faithful split is:
- end world simulation/audio quiescence when the accepted destination is
materialized and `TunnelContinue` begins;
- retain the destination streaming/resource reservation and keep drawing only
the portal viewport until the later viewport-swap edge;
- keep LoginComplete on the final one-second `WorldFadeIn -> Off` edge.
ACE schedules lifestone recall teleport after the MotionTable-reported action
length. With the installed human DATs, the boundary is about 15.06024 seconds;
floating-point conversion can leave acdream at frame 149.999998 of the