ZN V1: overlay AOI canonico + ENT_SPAWN keyframe [Change-Set: AOI-VIS-2026-06-12]
Lado CLIENTE ZMMO (par com o commit de mesmo Change-Set no repo ZeusServerEngine -- devem ir juntos, o wire do ENT_SPAWN mudou). - UZeusAOIComponent: migrado do transporte legacy (SendDebugAoiRequest/OnDebugAoiInfo, desativado no V1) pro canonico (EmitDebugAoiRequest 6160 / OnDebugAoiInfo 6161). Esfera de debug 32 -> 48 segments + clamp visual de 500m (resolve "zona sem limite / poucas linhas"). - ZeusWorldSubsystem::OnNetEntitySpawned: recebe vel + grounded + serverTimeMs (delegate FZeusV1OnEntitySpawned 4 -> 7 params) e semeia o proxy recem-criado via HandlePlayerStateUpdate -> ancora o relogio de interpolacao + a vel inicial -> proxy nasce ja' animando no re-spawn (sai/volta do raio AOI segurando W), sem Idle deslizando. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -56,7 +56,10 @@ void UZeusWorldSubsystem::OnWorldBeginPlay(UWorld& InWorld)
|
||||
Net->ForEachRemoteEntity(
|
||||
[this, &ReplayCount](int64 EntityId, FVector PosCm, float YawDeg)
|
||||
{
|
||||
OnNetEntitySpawned(EntityId, /*Kind=*/1 /*Player*/, PosCm, YawDeg);
|
||||
// Catch-up local: ForEachRemoteEntity nao expoe vel/serverTimeMs ->
|
||||
// ZeroVector + grounded + ts=0 (seed nao roda; o 1o delta ancora o relogio).
|
||||
OnNetEntitySpawned(EntityId, /*Kind=*/1 /*Player*/, PosCm, YawDeg,
|
||||
FVector::ZeroVector, /*bGrounded=*/true, /*ServerTimeMs=*/0);
|
||||
++ReplayCount;
|
||||
});
|
||||
if (ReplayCount > 0)
|
||||
@@ -450,13 +453,24 @@ void UZeusWorldSubsystem::HandlePlayerStateUpdate(const int64 EntityId, const in
|
||||
AsEntity->ApplyEntitySnapshot(Snapshot);
|
||||
}
|
||||
|
||||
void UZeusWorldSubsystem::OnNetEntitySpawned(int64 EntityId, int32 /*Kind*/, FVector PosCm, float YawDeg)
|
||||
void UZeusWorldSubsystem::OnNetEntitySpawned(int64 EntityId, int32 /*Kind*/, FVector PosCm, float YawDeg,
|
||||
FVector VelCmS, bool bGrounded, int64 ServerTimeMs)
|
||||
{
|
||||
// O sistema novo nao manda bIsLocal: derivamos do LocalEntityId (setado por
|
||||
// ENT_SELF). Se ainda for 0 e este ENT_SPAWN for do proprio char, o
|
||||
// OnNetSelfEntityAssigned destruira o fantasma quando o ENT_SELF chegar.
|
||||
const bool bIsLocal = (LocalEntityId != 0 && EntityId == LocalEntityId);
|
||||
HandlePlayerSpawned(EntityId, bIsLocal, PosCm, YawDeg, /*ServerTimeMs=*/0);
|
||||
HandlePlayerSpawned(EntityId, bIsLocal, PosCm, YawDeg, ServerTimeMs);
|
||||
|
||||
// V1-SPAWN-KEYFRAME(-TS): o ENT_SPAWN carrega vel + grounded + serverTimeMs. Aplica
|
||||
// esse keyframe INICIAL no proxy recem-criado pelo mesmo caminho do delta (semeia o
|
||||
// SnapshotBuffer + ANCORA o ServerClockOffsetMs com o tempo CERTO). Antes o seed usava
|
||||
// ServerTimeMs=0 -> bootstrap do relogio de interpolacao errado -> proxy preso/flutuando
|
||||
// ate' o EMA convergir. Agora com o serverTimeMs real o proxy interpola desde o frame 1.
|
||||
if (!bIsLocal && ServerTimeMs > 0)
|
||||
{
|
||||
HandlePlayerStateUpdate(EntityId, /*InputSeq=*/0, PosCm, VelCmS, bGrounded, ServerTimeMs);
|
||||
}
|
||||
}
|
||||
|
||||
void UZeusWorldSubsystem::OnNetEntityDespawned(int64 EntityId, int32 /*Reason*/)
|
||||
|
||||
Reference in New Issue
Block a user