Fix all 7 Cut 5d Soul findings: GL3 Sion perf >=57fps, PVS death gating, crater dedupe, hit-marker filter, loadout baseline, remote dust yaw/speed, distance-gated death trauma

This commit is contained in:
Meta Vens 2026-12-05 10:48:54 +01:00
commit fcb91edb0d
16 changed files with 574 additions and 143 deletions

View file

@ -1266,7 +1266,7 @@ public partial class Smoke : Node
Check(particles.ActiveParticleCount == afterFirst,
$"Expected duplicate ShotFiredEvent #{tracerId} across dt=0 frames to spawn once, got {afterFirst} -> {particles.ActiveParticleCount}");
// OmniLight3D[4] pool strictly capped at <= 4 active lights even under 12 simultaneous flashes
// OmniLight3D[2] pool strictly capped at <= 2 active lights even under 12 simultaneous flashes
particles.ClearAll();
for (int f = 0; f < 12; f++)
{
@ -1279,8 +1279,8 @@ public partial class Smoke : Node
priority: f);
}
particles.AdvanceAndCommit(0f);
Check(particles.FlashLightPoolSize == 4 && particles.ActiveFlashLightCount <= 4 && particles.PeakFlashLightCount <= 4,
$"Expected OmniLight3D pool capped at <= 4, got active={particles.ActiveFlashLightCount} peak={particles.PeakFlashLightCount}");
Check(particles.FlashLightPoolSize == 2 && particles.ActiveFlashLightCount <= 2 && particles.PeakFlashLightCount <= 2,
$"Expected OmniLight3D pool capped at <= 2, got active={particles.ActiveFlashLightCount} peak={particles.PeakFlashLightCount}");
// Far walker footstep pulse (>70m static LOD, <=110m) still emits terrain-tinted dust in ParticlePool
particles.ClearAll();
@ -1302,7 +1302,7 @@ public partial class Smoke : Node
juice.Reset();
Check(juice.IsIdle, "Expected CameraJuiceState idle after Reset");
var (aimIdleX, aimIdleY, aimIdleZ) = _main.ProbeCenterScreenAim();
juice.ConsumeEvents(simBatch, _main.Session.LocalContenderId, new System.Numerics.Vector3(pPos.X, pPos.Y, pPos.Z));
juice.ConsumeEvents(simBatch, _main.Session.LocalContenderId, new System.Numerics.Vector3(pPos.X, pPos.Y, pPos.Z), _main.Session);
juice.Update(0.016f, 0f, false);
Check(!juice.IsIdle && juice.RecoilPitchRad > 0f, "Expected CameraJuiceState recoil after local recoilless shot");
var (aimJuiceX, aimJuiceY, aimJuiceZ) = _main.ProbeCenterScreenAim();
@ -1330,6 +1330,44 @@ public partial class Smoke : Node
_main.Hud.ConsumeEvents(new ISimEvent[] { aiHit }, _main.Session.LocalContenderId, 1.0f, 0.2f);
Check(!_main.Hud.HasActiveHitMarker, "Expected AI/other shooter hit NOT to trigger local reticle hit-marker");
// Local shooter hitting Terrain / StaticCover / Airburst must produce ZERO reticle hit-marker flash
var missTerrainHit = new HitImpactEvent
{
EventId = 8810,
ShooterId = _main.Session.LocalContenderId,
IsContenderShooter = true,
TargetKind = (byte)HitTargetKind.Terrain,
TargetId = -1,
ArmorDamage = 0f,
CoreDamage = 0f,
Killed = false
};
var missCoverHit = new HitImpactEvent
{
EventId = 8811,
ShooterId = _main.Session.LocalContenderId,
IsContenderShooter = true,
TargetKind = (byte)HitTargetKind.StaticCover,
TargetId = 0,
ArmorDamage = 0f,
CoreDamage = 0f,
Killed = false
};
var missAirburstHit = new HitImpactEvent
{
EventId = 8812,
ShooterId = _main.Session.LocalContenderId,
IsContenderShooter = true,
TargetKind = (byte)HitTargetKind.StaticCover,
TargetId = -1,
IsAirburst = true,
ArmorDamage = 0f,
CoreDamage = 0f,
Killed = false
};
_main.Hud.ConsumeEvents(new ISimEvent[] { missTerrainHit, missCoverHit, missAirburstHit }, _main.Session.LocalContenderId, 1.0f, 0.2f);
Check(!_main.Hud.HasActiveHitMarker, "Expected Terrain/StaticCover/Airburst miss NOT to trigger local reticle hit-marker");
// Local armor hit -> Armor X-flash
var localArmorHit = new HitImpactEvent
{
@ -1511,6 +1549,63 @@ public partial class Smoke : Node
Check(kestrelPitch.HasValue && bastionPitch.HasValue && bastionPitch.Value < kestrelPitch.Value,
$"Expected Bastion pitch ({bastionPitch}) < Kestrel pitch ({kestrelPitch})");
// Finding 4: TerrainStampEvent(Crater) + ContenderEliminatedEvent in same batch plays impact_explosion EXACTLY ONCE
audio.ClearAll();
var victim = _main.Session.ViewState.Contenders[1];
var killEvents = new ISimEvent[]
{
new TerrainStampEvent
{
Kind = (byte)TerrainStampKind.Crater,
X = victim.X,
Z = victim.Z,
Radius = 4.2f,
Depth = 0.3f
},
new ContenderEliminatedEvent
{
VictimId = victim.Id,
KillerId = _main.Session.LocalContenderId,
IsSpectatorKiller = false
}
};
audio.ConsumeSimEvents(_main.Session, killEvents, listener);
int expCount = audio.CountActiveVoicesForClip("impact_explosion");
int ejectCount = audio.CountActiveVoicesForClip("mech_eject");
Check(expCount == 1 && ejectCount == 1,
$"Expected kill crater+eliminated batch to play impact_explosion=1 & mech_eject=1, got exp={expCount} eject={ejectCount}");
// Finding 5: ResetForSession seeds loadout baselines so first equip (1 -> 2) plays mech_quick_bolt
audio.ResetForSession(_main.Session);
var equipEv = new ContenderLoadoutEvent
{
ContenderId = localC.Id,
ChassisId = localC.Grid.Spec.Id,
LoadoutVersion = localC.LoadoutVersion + 1
};
audio.ConsumeSimEvents(_main.Session, new ISimEvent[] { equipEv }, listener);
Check(audio.CountActiveUiVoicesForClip("mech_quick_bolt") == 1,
$"Expected first ContenderLoadoutEvent (1 -> 2) after ResetForSession to play mech_quick_bolt, got {audio.CountActiveUiVoicesForClip("mech_quick_bolt")}");
// Finding 3: Out-of-PVS deaths spawn zero phantom particles, lights, or audio
audio.ResetForSession(_main.Session);
var particles3 = _main.Arena.Particles;
particles3.ClearAll();
var hiddenSession = new HiddenRemoteDeathsSession(_main.Session);
var spec0 = _main.Session.ViewState.Spectators.Spectators[0];
var hiddenDeaths = new ISimEvent[]
{
new ContenderEliminatedEvent { VictimId = victim.Id, KillerId = localC.Id, IsSpectatorKiller = false },
new SpectatorDestroyedEvent { SpectatorId = spec0.Id, KillerContenderId = localC.Id }
};
particles3.ConsumeEvents(hiddenSession, hiddenDeaths, listener, hasCam: true, _main.SampleCurrentMapGroundTint);
particles3.AdvanceAndCommit(0f);
audio.ConsumeSimEvents(hiddenSession, hiddenDeaths, listener);
Check(particles3.ActiveParticleCount == 0 && particles3.ActiveFlashLightCount == 0 && audio.ActiveOneShotVoiceCount == 0,
$"Expected out-of-PVS deaths to spawn 0 VFX/SFX, got particles={particles3.ActiveParticleCount} lights={particles3.ActiveFlashLightCount} voices={audio.ActiveOneShotVoiceCount}");
particles3.ClearAll();
GD.Print($"SMOKE INFO: Audio verified (haven={audio.Bank.HavenClipCount}, proc={audio.Bank.ProceduralClipCount}, dummy={audio.IsDummyAudio}, kestrelPitch={kestrelPitch:F3}, bastionPitch={bastionPitch:F3})");
}
@ -1859,4 +1954,30 @@ public partial class Smoke : Node
GD.Print(_failures.Count == 0 ? "SMOKE PASS" : $"SMOKE FAILED ({_failures.Count})");
GetTree().Quit(_failures.Count == 0 ? 0 : 1);
}
private sealed class HiddenRemoteDeathsSession : IClientArenaSession
{
private readonly IClientArenaSession _inner;
public HiddenRemoteDeathsSession(IClientArenaSession inner) => _inner = inner;
public MatchState ViewState => _inner.ViewState;
public int LocalContenderId => _inner.LocalContenderId;
public ContenderState LocalContender => _inner.LocalContender;
public ClientMatchOutcome LocalOutcome => _inner.LocalOutcome;
public int LocalDetectedByCount => _inner.LocalDetectedByCount;
public IReadOnlyDictionary<int, PlayerContactMemory> LocalContenderContacts => _inner.LocalContenderContacts;
public IReadOnlyDictionary<int, PlayerContactMemory> LocalSpectatorContacts => _inner.LocalSpectatorContacts;
public NetworkStatusSnapshot ConnectionStatus => _inner.ConnectionStatus;
public bool IsContenderVisible(int contenderId) => contenderId == _inner.LocalContenderId;
public bool IsSpectatorVisible(int spectatorId) => false;
public void BeginRenderFrame(double dt, float physicsAlpha) => _inner.BeginRenderFrame(dt, physicsAlpha);
public void SubmitLocalInput(in PlayerInput input, bool isPhysicsTick) => _inner.SubmitLocalInput(in input, isPhysicsTick);
public void DrainSimEvents(List<ISimEvent> dest) => _inner.DrainSimEvents(dest);
public bool RequestEquipCargo(int cargoIndex, string hardpointId) => _inner.RequestEquipCargo(cargoIndex, hardpointId);
public void RequestNewMatch(int seed, ArenaMapKind mapKind) => _inner.RequestNewMatch(seed, mapKind);
public (System.Numerics.Vector3 Pos, System.Numerics.Quaternion Rot, System.Numerics.Vector3 Vel) GetInterpolatedContenderPose(int contenderId, float alpha) => _inner.GetInterpolatedContenderPose(contenderId, alpha);
public (System.Numerics.Vector3 Pos, System.Numerics.Quaternion Rot, System.Numerics.Vector3 Vel) GetInterpolatedSpectatorPose(int spectatorId, float alpha) => _inner.GetInterpolatedSpectatorPose(spectatorId, alpha);
public bool TrySampleInterpolatedWalkerPose(bool isContender, int id, float alpha, out WalkerVisualSnapshot snap) => _inner.TrySampleInterpolatedWalkerPose(isContender, id, alpha, out snap);
public ClientRayHit CastWorldRayClosest(System.Numerics.Vector3 origin, System.Numerics.Vector3 translation) => _inner.CastWorldRayClosest(origin, translation);
public void Dispose() { }
}
}