fix(streaming): retire stale portal-region entities
Port retail's 25-second leave-visibility lifetime over canonical live records, retaining spatially resident and owned entities while using the conservative ACE visibility envelope for nonresident records. Route expiry through the normal generation-safe F747 teardown so animations, effects, physics, and render owners unwind symmetrically. Replace the append-only modern mesh buffer with coalescing vertex/index ranges and upload each mesh's vertices once instead of once per material. Released zero-reference meshes can now reuse GPU ranges after portal and cache churn. A connected five-region round trip returned animation ownership to baseline, recreated the starting region on revisit, and held normal FPS. Release build succeeds and all 5,927 tests pass with five intentional skips. Co-authored-by: OpenAI Codex <codex@openai.com>
This commit is contained in:
parent
2cbf34a668
commit
3971997689
13 changed files with 918 additions and 117 deletions
|
|
@ -460,6 +460,7 @@ public sealed class GameWindow : IDisposable
|
|||
/// <see cref="OnLiveEntityDeleted"/>.
|
||||
/// </summary>
|
||||
private AcDream.App.World.LiveEntityRuntime? _liveEntities;
|
||||
private AcDream.App.World.LiveEntityLivenessController? _liveEntityLiveness;
|
||||
|
||||
/// <summary>
|
||||
/// Per-remote-entity physics + motion stack — verbatim application of
|
||||
|
|
@ -2535,6 +2536,10 @@ public sealed class GameWindow : IDisposable
|
|||
if (record.WorldEntity is { } entity)
|
||||
_particleSink!.SetEntityPresentationVisible(entity.Id, visible);
|
||||
};
|
||||
_liveEntityLiveness = new AcDream.App.World.LiveEntityLivenessController(
|
||||
_liveEntities,
|
||||
() => _playerServerGuid,
|
||||
OnLiveEntityPruned);
|
||||
_projectileController = new AcDream.App.Physics.ProjectileController(
|
||||
_liveEntities,
|
||||
_physicsEngine,
|
||||
|
|
@ -2879,6 +2884,7 @@ public sealed class GameWindow : IDisposable
|
|||
_particleVisibility.Reset();
|
||||
try
|
||||
{
|
||||
_liveEntityLiveness?.Clear();
|
||||
_liveEntities?.Clear();
|
||||
}
|
||||
finally
|
||||
|
|
@ -4376,6 +4382,17 @@ public sealed class GameWindow : IDisposable
|
|||
}
|
||||
}
|
||||
|
||||
private void OnLiveEntityPruned(AcDream.App.World.LiveEntityPruneCandidate candidate)
|
||||
{
|
||||
// ACE retains KnownObjects across normal teleports and consequently
|
||||
// does not issue an F747 when an old region leaves client visibility.
|
||||
// Route the 25-second client liveness expiry through the exact same
|
||||
// generation gate and symmetric teardown as a wire ObjectDelete.
|
||||
OnLiveEntityDeleted(new AcDream.Core.Net.Messages.DeleteObject.Parsed(
|
||||
candidate.ServerGuid,
|
||||
candidate.Generation));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Server broadcast a <c>0xF625 ObjDescEvent</c> — a creature/player's
|
||||
/// appearance changed (equip / unequip / tailoring / recipe result /
|
||||
|
|
@ -9142,6 +9159,7 @@ public sealed class GameWindow : IDisposable
|
|||
// the recall action retires before ACE's Hidden SetState freezes its
|
||||
// PartArray at the teleport boundary.
|
||||
_liveFrameCoordinator.Tick(frameDelta);
|
||||
_liveEntityLiveness?.Tick(ClientTimerNow());
|
||||
|
||||
// Usually F751 activates immediately. This no-op convergence check
|
||||
// covers the session edge where the canonical player exists before
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue