Cut 6b: Brokkr drop_pod.glb, petal blow-off, retro VFX/audio/juice, drop HUD/camera, and GL3 Sion captures

This commit is contained in:
Meta Vens 2026-12-05 11:45:04 +01:00
commit 5af5d87e06
15 changed files with 1847 additions and 94 deletions

View file

@ -39,6 +39,7 @@ public partial class Smoke : Node
{
_main = GD.Load<PackedScene>("res://Main.tscn").Instantiate<Main>();
_main.InitialMapKindOverride = ArenaMapKind.Desert;
_main.InitialSkipDropOverride = true;
AddChild(_main);
if (_main.Failure is { } failure)
@ -275,6 +276,7 @@ public partial class Smoke : Node
await MaybeCapturePreviewAsync(isHeadless);
await VerifyMaxLoadPaladinGarageAsync();
await VerifySionMapAsync();
await VerifyOrbitalDropSequenceAsync();
}
private async Task VerifyHudAndShadersAsync(bool isHeadless)
@ -1447,7 +1449,8 @@ public partial class Smoke : Node
var audio = _main.Audio;
audio.EnsureInitialized();
Check(audio.Bank.HavenClipCount == 25, $"Expected 25 curated Haven clips in ProceduralAudioBank, got {audio.Bank.HavenClipCount}");
Check(audio.Bank.ProceduralClipCount == 18, $"Expected 18 procedural clips in ProceduralAudioBank, got {audio.Bank.ProceduralClipCount}");
Check(audio.Bank.ProceduralClipCount == RustToDust.Core.Audio.PcmSynth.CueRegistry.Count,
$"Expected {RustToDust.Core.Audio.PcmSynth.CueRegistry.Count} procedural clips in ProceduralAudioBank, got {audio.Bank.ProceduralClipCount}");
audio.ClearAll();
audio.ResetStatsForTest();
@ -1812,7 +1815,7 @@ public partial class Smoke : Node
private async Task VerifySionMapAsync()
{
_main.Reset(42, ArenaMapKind.Sion);
_main.Reset(42, ArenaMapKind.Sion, skipInitialDrop: true);
Check(_main.Failure is null, $"Sion Reset failed: {_main.Failure}");
if (_main.Failure is not null)
{
@ -1882,6 +1885,127 @@ public partial class Smoke : Node
GD.Print($"SMOKE INFO: Sion verified (chunks={_main.SionMap.TerrainChunkCount}, tiles={_main.SionMap.BuildingTileCount}, lod1={_main.SionMap.ActiveLod1TileCount}, lod2={_main.SionMap.ActiveLod2TileCount}, disp={disp:F2}m, tint=({inBoundsTint.R:F2},{inBoundsTint.G:F2},{inBoundsTint.B:F2}))");
}
private async Task VerifyOrbitalDropSequenceAsync()
{
var podTpl = _main.Arena.AssetCache.GetOrLoadDropPod();
Check(podTpl.CoreMesh.GetSurfaceCount() == 1, $"Expected single-surface DropPod CoreMesh, got {podTpl.CoreMesh.GetSurfaceCount()}");
Check(podTpl.PetalMesh.GetSurfaceCount() == 1, $"Expected single-surface DropPod PetalMesh, got {podTpl.PetalMesh.GetSurfaceCount()}");
Check(podTpl.PetalLocalTransforms.Length == 4, $"Expected 4 DropPod petal transforms, got {podTpl.PetalLocalTransforms.Length}");
Check(podTpl.Size.Y >= 4.0f && podTpl.Size.Y <= 5.2f, $"Unexpected DropPod height {podTpl.Size.Y:F2}m");
// Verify COLOR_0 weathering exists on both CoreMesh and PetalMesh
var coreArr = podTpl.CoreMesh.SurfaceGetArrays(0);
var petalArr = podTpl.PetalMesh.SurfaceGetArrays(0);
Check(coreArr.Count > (int)Mesh.ArrayType.Color && coreArr[(int)Mesh.ArrayType.Color].VariantType == Variant.Type.PackedColorArray,
"DropPod CoreMesh missing COLOR_0 weathering array");
Check(petalArr.Count > (int)Mesh.ArrayType.Color && petalArr[(int)Mesh.ArrayType.Color].VariantType == Variant.Type.PackedColorArray,
"DropPod PetalMesh missing COLOR_0 weathering array");
int bucketsBefore = _main.Arena.PartPool.BucketCount;
_main.Reset(42, ArenaMapKind.Sion, skipInitialDrop: false);
Check(_main.Failure is null, $"Sion Orbital Reset failed: {_main.Failure}");
if (_main.Failure is not null)
{
return;
}
_main.SetPhysicsProcess(false);
await ToSignal(GetTree(), SceneTree.SignalName.ProcessFrame);
var session = _main.Session;
var player = session.LocalContender;
Check(player.Lifecycle == ContenderLifecycle.Deploying && player.IsInDropPod,
$"Expected player to start Deploying in DropPod, got {player.Lifecycle}");
Check(!player.IsGroundedActive, "Expected player IsGroundedActive == false while inside DropPod");
Check(session.ActivePods.Count >= 50, $"Expected >= 50 Wave 0 active pods (40 gear + 12 contenders), got {session.ActivePods.Count}");
var pVisDeploying = _main.Arena.GetContenderVisual(player.Id);
Check(pVisDeploying is null || !pVisDeploying.Root.Visible, "Expected ground vehicle visual hidden while inside DropPod");
_main.Arena.Sync(session, 0.1f, 1f / 60f, 1f);
int bucketsDuringDrop = _main.Arena.PartPool.BucketCount;
Check(bucketsDuringDrop <= bucketsBefore + 2,
$"Expected DropPod to add <= 2 MultiMeshPartPool buckets (Core + Petal), delta={bucketsDuringDrop - bucketsBefore}");
bool sawRetroBurn = false;
bool sawGearEarlyTouchdown = false;
int touchdownTick = -1;
int debrisAtTouchdown = 0;
_main.SetScriptedInput(new PlayerInput(
Throttle: 1f,
Steer: 0f,
AimWorldX: player.X,
AimWorldZ: player.Z + 120f,
Fire: false,
InteractPickup: false,
Brake: false));
for (int tick = 0; tick < 620; tick++)
{
var tickInp = _main.Session.LocalContender.IsInDropPod
? new PlayerInput(1f, 0f, player.X, player.Z + 120f, false, false, false)
: new PlayerInput(1f, 0f, player.X, player.Z + 60f, false, false, false);
session.SubmitLocalInput(in tickInp, isPhysicsTick: true);
_main.Arena.Sync(session, (tick + 1) / 60f, 1f / 60f, 1f);
var evs = new List<ISimEvent>(32);
session.DrainSimEvents(evs);
_main.Arena.ConsumeEvents(session, evs, Array.Empty<FootstepPulse>(), 1f / 60f, _main.SampleCurrentMapGroundTint);
_main.CameraJuice.ConsumeEvents(evs, session.LocalContenderId, new System.Numerics.Vector3(player.X, player.Y, player.Z), session);
_main.Audio.UpdateFrame(session, evs, Array.Empty<FootstepPulse>(), _main.Camera.GlobalPosition, 1f / 60f, 1f);
_main.Hud.Sync(session);
if (tick == 270) // t = 4.5s: gear pods should have landed while player is still falling
{
sawGearEarlyTouchdown = session.ViewState.GroundDrops.Count >= 35 && player.IsInDropPod;
}
if (player.IsInDropPod)
{
foreach (var pod in session.ActivePods)
{
if (pod.PodKind == OrbitalPodKind.Contender && pod.ContenderId == player.Id && pod.Phase == OrbitalPodPhase.RetroBurn)
{
sawRetroBurn = true;
break;
}
}
}
else if (touchdownTick < 0 && player.IsGroundedActive)
{
touchdownTick = tick;
debrisAtTouchdown = _main.Arena.Debris.ActiveCount;
break;
}
}
Check(sawGearEarlyTouchdown, $"Expected >= 35 Wave 0 gear drops on ground at t=4.5s while player still in pod (drops={session.ViewState.GroundDrops.Count}, inPod={player.IsInDropPod})");
Check(sawRetroBurn, "Expected local player pod to enter RetroBurn phase");
Check(touchdownTick > 240 && touchdownTick < 620, $"Expected player pod touchdown in (240, 620) ticks, got {touchdownTick}");
Check(debrisAtTouchdown >= 4, $"Expected >= 4 blown-off petals in DebrisSystem on touchdown, got {debrisAtTouchdown}");
Check(VehicleVisualInstance.PerfMaterialDupCount == 0, $"Expected 0 material duplicates during orbital drop, got {VehicleVisualInstance.PerfMaterialDupCount}");
var pVisLanded = _main.Arena.GetContenderVisual(player.Id);
Check(pVisLanded is not null && pVisLanded.Root.Visible, "Expected player ground chassis visual visible immediately on touchdown");
// Verify post-touchdown ground driving works cleanly
float landX = player.X;
float landZ = player.Z;
for (int t = 0; t < 30; t++)
{
var driveInp = new PlayerInput(1f, 0f, player.X, player.Z + 60f, false, false, false);
session.SubmitLocalInput(in driveInp, isPhysicsTick: true);
}
float postDisp = MathF.Sqrt((player.X - landX) * (player.X - landX) + (player.Z - landZ) * (player.Z - landZ));
Check(postDisp > 1.5f, $"Expected post-touchdown driving displacement > 1.5m over 30 ticks, got {postDisp:F2}m");
_main.SetScriptedInput(null);
_main.SetPhysicsProcess(true);
GD.Print($"SMOKE INFO: Cut 6b OrbitalDrop verified (touchdownTick={touchdownTick}, debris={debrisAtTouchdown}, postDisp={postDisp:F2}m, bucketsDelta={bucketsDuringDrop - bucketsBefore}, matDups={VehicleVisualInstance.PerfMaterialDupCount})");
}
private static int CountPremulViolations(Image img, float tolerance)
{
int count = 0;