Implement timed Invisible gadget and shared energy warnings

This commit is contained in:
UnixNight committed 2026-11-02 09:21:56 -05:00
1 parent 3527d33810
commit 1897dd2b90
44 files changed
+2466 -39

No files matched your search

+12 -5
View File
@@ -7,7 +7,8 @@ namespace GamePort.Application;
public sealed record DebugScene(string LevelFile, string Code, string[] Starts);
public enum DebugAction { None, Resume, Camera, SkipCutscene, RefillEnergy, GiveJetpack, ApplySceneTask, LoadScene, Reset, ForceControl, ToggleOverlay,
Noclip, NoclipSpeed, StopMotion, ShowObjective, ReturnNoclipEntry, LevelAvailability, InputOrder, ApplyJetpackState,
CameraObstruction, MuteMusic, MuteSpeech, MuteEffects, RestartMusic, StopEffects, SaveCheckpoint, LoadCheckpoint, Practice }
CameraObstruction, MuteMusic, MuteSpeech, MuteEffects, RestartMusic, StopEffects, SaveCheckpoint, LoadCheckpoint, Practice,
GiveInvisible, UnequipGadget }
public sealed record DebugMenuView(string[] Lines, int SelectedLine);
public sealed record DebugStatus(string Level, string Start, Vector3 Root, float Yaw, float Speed,
bool Grounded, float Energy, int Score, int SceneTask, string Cutscene, bool Controlled,
@@ -25,6 +26,9 @@ public sealed record DebugSystems
public float JumpHold { get; init; }
public float BurnRemaining { get; init; }
public int JetpackAvailability { get; init; }
public float InvisibleRemaining { get; init; }
public float InvisibleRecharge { get; init; }
public bool Targetable { get; init; } = true;
public int Objective { get; init; }
public float ObjectiveTime { get; init; }
public bool? CameraObstruction { get; init; }
@@ -48,7 +52,7 @@ public sealed class DebugMenu
public const int ItemCount = 12;
public const int PageCount = 3;
public int Page { get; private set; }
public int PageItems => Page switch { 1 => 10, 2 => 9, _ => ItemCount };
public int PageItems => Page switch { 1 => 12, 2 => 9, _ => ItemCount };
private static readonly float[] FlySpeeds = [300, 600, 1200, 2400];
private int flySpeedIndex = 1, jetpackStateIndex = 1;
private static readonly int[] JetpackStates = [0, 1, 4];
@@ -110,7 +114,8 @@ public sealed class DebugMenu
0 => DebugAction.Noclip, 1 => DebugAction.NoclipSpeed, 2 => DebugAction.StopMotion,
3 => DebugAction.ShowObjective, 4 => DebugAction.ReturnNoclipEntry,
5 => DebugAction.LevelAvailability, 6 => DebugAction.InputOrder,
8 => DebugAction.ApplyJetpackState, 9 => DebugAction.RefillEnergy, _ => DebugAction.None
8 => DebugAction.ApplyJetpackState, 9 => DebugAction.RefillEnergy,
10 => DebugAction.GiveInvisible, 11 => DebugAction.UnequipGadget, _ => DebugAction.None
};
if (Page == 2) return Selected switch
{
@@ -147,13 +152,15 @@ public sealed class DebugMenu
Page == 1 ? $"PENDING {V(system.PendingImpulse)}" : $"AUDIO BYTES MUSIC {system.MusicBytes} VOICE {system.SpeechBytes}",
Page == 1 ? $"JUMP {system.JumpState} HOLD {F(system.JumpHold)} BURN {F(system.BurnRemaining)}"
: $"EFFECT BYTES {system.EffectBytes} AUDIO AVAILABLE {system.AudioAvailable}",
$"OBJECTIVE {system.Objective} TIME {F(system.ObjectiveTime)} GADGET STATE {system.JetpackAvailability}", ""];
$"OBJECTIVE {system.Objective} TIME {F(system.ObjectiveTime)} GADGET STATE {system.JetpackAvailability}",
$"INVISIBLE {F(system.InvisibleRemaining)} RECHARGE {F(system.InvisibleRecharge)}/7 TARGETABLE {system.Targetable}", ""];
string[] items = Page == 1 ? [
$"NOCLIP (F3): {system.Noclip} (ENTER TOGGLE)",
$"FLY SPEED: {F(FlySpeed)} LIVE {F(system.NoclipSpeed)} (ENTER APPLIES)", "STOP MOTION / CLEAR QUEUED JUMP", "SHOW CURRENT OBJECTIVE",
"RETURN TO NOCLIP ENTRY POSITION", "APPLY THIS LEVEL'S GADGET AVAILABILITY",
$"INPUT AFTER PLAYER: {system.InputAfterPlayer} (TOGGLE)",
$"JET PACK STATE: {JetpackState} (0 NONE / 1 OWNED / 4 DISABLED)", "APPLY JET PACK STATE", "REFILL ENERGY TO 100"] : [
$"JET PACK STATE: {JetpackState} (0 NONE / 1 OWNED / 4 DISABLED)", "APPLY JET PACK STATE", "REFILL ENERGY TO 100",
"GIVE / SELECT INVISIBLE", "UNEQUIP CURRENT GADGET"] : [
$"STATIC CAMERA OBSTRUCTION: {(system.CameraObstruction?.ToString() ?? "UNAVAILABLE")}",
$"MUTE MUSIC: {system.MusicMuted}", $"MUTE SPEECH: {system.SpeechMuted}", $"MUTE EFFECTS: {system.EffectsMuted}",
"RESTART SELECTED MUSIC", "STOP ALL EFFECTS / LOOPS", "SAVE DEBUG CHECKPOINT", "LOAD DEBUG CHECKPOINT", "SHOW JET PACK PRACTICE PROMPT"];
@@ -0,0 +1,71 @@
using System.Numerics;
using System.Text.Json;
using GamePort.Assets;
using GamePort.Game;
namespace GamePort.Application;
/// <summary>Original Canv21/22 meter. Source size/tint/full-image stretch with
/// a declared logical rectangle conversion and uniform centered widescreen UI.</summary>
public sealed class InvisibleMeterOverlay
{
private readonly int offset;
private readonly uint firstIndex;
public Mesh Mesh { get; }
public InvisibleMeterOverlay(Mesh combined, string manifest)
{
var full = Path.GetFullPath(manifest);
var directory = Path.GetDirectoryName(full)!;
if (new FileInfo(full).Length > 16 * 1024) throw new InvalidDataException("Meter manifest exceeds limit");
using var document = JsonDocument.Parse(File.ReadAllBytes(full), new JsonDocumentOptions {MaxDepth=10});
var root = document.RootElement;
if (root.GetProperty("schema").GetInt32() != 1 || root.GetProperty("referenceWidth").GetInt32() != 640
|| root.GetProperty("referenceHeight").GetInt32() != 480 || root.GetProperty("textures").GetArrayLength() != 2)
throw new InvalidDataException("Unsupported Invisible meter format");
offset = combined.Vertices.Length; firstIndex = (uint)combined.Indices.Length;
var vertices = combined.Vertices.ToList(); var indices = combined.Indices.ToList();
var draws = combined.Draws.ToList(); var textures = new Dictionary<int,PngImage>(combined.Textures);
if (!combined.HasExplicitDraws && indices.Count != 0) draws.Add(new(0,(uint)indices.Count,-1));
var seen = new HashSet<int>();
foreach (var entry in root.GetProperty("textures").EnumerateArray().OrderBy(e=>e.GetProperty("id").GetInt32()))
{
var id = entry.GetProperty("id").GetInt32();
if (id is not (21 or 22) || !seen.Add(id) || entry.GetProperty("width").GetInt32()!=30
|| entry.GetProperty("height").GetInt32()!=110) throw new InvalidDataException("Invalid source meter canvas");
var path = Path.GetFullPath(Path.Combine(directory,entry.GetProperty("path").GetString()!));
if (!path.StartsWith(directory+Path.DirectorySeparatorChar,StringComparison.Ordinal)
|| new FileInfo(path).Length != 30*110*4) throw new InvalidDataException("Invalid meter pixel path/length");
var textureId = int.MinValue+15000; while(textures.ContainsKey(textureId))textureId++;
textures.Add(textureId,new(30,110,File.ReadAllBytes(path)));
var first = (uint)vertices.Count;
vertices.AddRange([new(Vector3.Zero,new(0,0),Vector3.One),new(Vector3.Zero,new(.9999f,0),Vector3.One),
new(Vector3.Zero,new(.9999f,.9999f),Vector3.One),new(Vector3.Zero,new(0,.9999f),Vector3.One)]);
indices.AddRange([first,first+1,first+2,first,first+2,first+3]);
draws.Add(new((uint)indices.Count-6,6,textureId){ScreenSpace=true,Visible=false});
}
Mesh = new(vertices.ToArray(),indices.ToArray()) {HasExplicitDraws=true,Draws=draws.ToArray(),Textures=textures,
CollisionPolygons=combined.CollisionPolygons,HasCollisionMaterialIds=combined.HasCollisionMaterialIds};
}
public void Update(Mesh destination, InvisibleGadget device, uint width, uint height)
{
var viewport = new UiViewport(width,height);
var visible = device.Equipped && device.MeterVisible;
var color = device.MeterReady ? Vector3.One : new Vector3(1,.2f,.2f);
var fillHeight = (float)(Math.Max(device.MeterPercent,0)*1.04);
Quad(0,new(320,7),new(30,110),Vector3.One);
Quad(1,new(322,114-fillHeight),new(27,fillHeight),color);
void Quad(int index, Vector2 position, Vector2 size, Vector3 tint)
{
destination.Draws.First(d=>d.ScreenSpace&&d.FirstIndex==firstIndex+(uint)index*6).Visible=visible;
var p = position+viewport.CenterOffset;
var corners = new[] {p,p+new Vector2(size.X,0),p+size,p+new Vector2(0,size.Y)};
for(var i=0;i<4;i++)
{
destination.Vertices[offset+index*4+i].Position=viewport.ToNdc(corners[i]);
destination.Vertices[offset+index*4+i].Color=tint;
}
}
}
}
@@ -0,0 +1,67 @@
using GamePort.Assets;
using GamePort.Game;
namespace GamePort.Application;
/// <summary>Accelerated port verification: full player ticks between six rendered
/// phases. No actor relocation or direct timer/material writes; not original cadence.</summary>
public sealed class InvisibleSmoke
{
private readonly LabSimulation player;
private readonly SceneInventory inventory;
private readonly bool[] checks = new bool[6];
private readonly float initialEnergy;
private int acceleratedTicks;
public InvisibleSmoke(LabSimulation player, SceneInventory inventory)
{
this.player = player; this.inventory = inventory; initialEnergy = player.Energy;
inventory.SetState(0,2,1); inventory.SelectGadget(2);
if (player.GadgetMode != 2 || !player.Invisible.Equipped)
throw new InvalidOperationException("Invisible fixture requires a connected, eligible player binding");
Advance(() => player.Invisible.Recharge == 7);
}
public void BeforeFrame(int count, Action<uint,bool> injectKey, bool headless)
{
if (count == 1 && !headless) injectKey(224,true);
if (count == 2 && !headless) injectKey(224,false);
if (count == 3) Advance(() => player.Invisible.Active && player.Invisible.Remaining <= 2.9f && player.Invisible.ConventionalBlend);
if (count == 4) Advance(() => player.Invisible.Active && !player.Invisible.ConventionalBlend);
if (count == 5) Advance(() => !player.Invisible.Active);
if (count == 6)
{
if (headless) inventory.SelectGadget(-1);
else injectKey(43,true);
}
if (count == 7 && !headless) injectKey(43,false);
}
private void Advance(Func<bool> done)
{
for(var i=0;i<1000;i++)
{
if(done())return;
player.Step(default); acceleratedTicks++;
}
throw new InvalidOperationException("Invisible fixture did not reach the requested source phase");
}
public void AfterFrame(int count, MeshDraw material)
{
var device = player.Invisible;
if(count==0)checks[0]=device.Recharge==7 && device.Targetable && material.Opacity==1 && device.MeterReady;
if(count==1)checks[1]=device.Active && device.Activations==1 && device.Remaining>3
&& material.Opacity==.7f && material.Blend==MeshBlend.Additive
&& player.Energy==(player.IgnoresGadgetEnergy ? initialEnergy : initialEnergy-2);
if(count==3)checks[2]=device.Active && material.Opacity==.7f && material.Blend==MeshBlend.Alpha;
if(count==4)checks[3]=device.Active && material.Blend==MeshBlend.Additive && device.Remaining<=3;
if(count==5)checks[4]=!device.Active && device.Targetable && material.Opacity==1 && material.Blend==MeshBlend.Opaque;
if(count==7)checks[5]=player.GadgetMode==-1 && !device.Equipped && !device.MeterVisible && device.Targetable;
}
public bool Passed => checks.All(value=>value);
public string Report => $"Invisible fixture: charged={checks[0]}, activation={checks[1]}, alpha flash={checks[2]}, additive flash={checks[3]}, expiry={checks[4]}, unequip={checks[5]}, accelerated player ticks={acceleratedTicks}, energy={player.Energy:F3}.";
public static string? StageName(int count) => count switch
{0=>"charged",1=>"active",3=>"alpha",4=>"additive",5=>"expired",7=>"unequipped",_=>null};
}
@@ -0,0 +1,16 @@
using GamePort.Assets;
using GamePort.Game;
namespace GamePort.Application;
/// <summary>Current Jimmy atlas is one linked material. Source114 alpha and
/// indexed0 FC blend changes affect that draw without changing pose/visibility.</summary>
public static class PlayerGadgetMaterial
{
public static void Apply(MeshDraw draw, InvisibleGadget invisible)
{
draw.Opacity = invisible.Opacity;
draw.Blend = !invisible.Active ? MeshBlend.Opaque
: invisible.ConventionalBlend ? MeshBlend.Alpha : MeshBlend.Additive;
}
}
+1 -1
View File
@@ -90,7 +90,7 @@ public sealed class ActorPatrol
if (!float.IsFinite(actor.Speed)) throw new InvalidOperationException("Nonfinite Goddard speed");
// EXE408023->40E050: the body consumes the *previous* velocity first.
var body = integrateBody(new(actor.Position, Velocity), dt);
var body = actor.BodyEnabled ? integrateBody(new(actor.Position, Velocity), dt) : new PatrolBodyState(actor.Position, Velocity);
if (!Finite(body.Position) || !Finite(body.Velocity))
throw new InvalidOperationException("Goddard body solver produced nonfinite state");
actor.Position = body.Position;
+87
View File
@@ -0,0 +1,87 @@
namespace GamePort.Game;
/// <summary>Jimmy424E80 timed Invisible device; material state and source
/// targetable55D are distinct from raw control and authored visibility.</summary>
public sealed class InvisibleGadget
{
public const float Duration = 7;
public bool Equipped { get; private set; }
public float Remaining { get; private set; }
public float Recharge { get; private set; }
public bool Targetable { get; private set; } = true;
public float Opacity { get; private set; } = 1;
public bool ConventionalBlend { get; private set; }
public bool MeterVisible { get; private set; }
public bool MeterReady { get; private set; }
public float MeterPercent { get; private set; }
public int Activations { get; private set; }
public bool Active => Equipped && !Targetable;
public event Action<bool>? EquippedChanged;
public bool Equip(float energy, bool energyOverride)
{
if (!float.IsFinite(energy)) throw new ArgumentOutOfRangeException(nameof(energy));
if (energy <= 0 && !energyOverride) return false;
Equipped = true; Remaining = Recharge = 0; Targetable = true;
Opacity = 1; ConventionalBlend = false; MeterReady = false; MeterVisible = true;
EquippedChanged?.Invoke(true);
return true;
}
public void Release()
{
Equipped = false; Remaining = Duration; Recharge = 0;
Targetable = true; Opacity = 1; ConventionalBlend = false;
MeterVisible = false; MeterReady = false;
EquippedChanged?.Invoke(false);
}
public void Reset()
{
Release(); Remaining = MeterPercent = 0; Activations = 0;
}
public void Step(float seconds, bool anyControlled, bool primary, bool jump,
float energy, bool energyOverride, Action<float> adjustEnergy, bool suppressed = false)
{
if (!float.IsFinite(seconds) || seconds < 0 || seconds >= 1)
throw new ArgumentOutOfRangeException(nameof(seconds));
if (!float.IsFinite(energy)) throw new ArgumentOutOfRangeException(nameof(energy));
ArgumentNullException.ThrowIfNull(adjustEnergy);
//Any controlled pointer, not necessarily Jimmy's identity. A NULL
//owner freezes timers and hides both meter sprites without cleanup.
if (!anyControlled) { MeterVisible = false; return; }
if (!Equipped) return;
MeterVisible = true;
if (primary && !jump)
{
if (suppressed) return;
if (Remaining == 0 && Recharge == Duration)
{
if (energy <= 2 && !energyOverride) return;
adjustEnergy(-2);
Remaining = Duration; Recharge = 0; Activations++;
ConventionalBlend = false; Opacity = .7f; Targetable = false;
}
}
if (Remaining == 0 && (energy > 0 || energyOverride))
{
var sum = (double)Recharge + seconds;
Recharge = (float)sum;
MeterPercent = (float)(sum * (1f / 7) * 100);
if (Recharge >= Duration) { Recharge = Duration; MeterReady = true; }
}
if (Remaining <= 0) return;
var remaining = (double)Remaining - seconds;
Remaining = (float)remaining;
MeterPercent = (float)Math.Max(remaining * (1f / 7) * 100, 0);
if (Remaining <= 0)
{
Remaining = 0; Opacity = 1; Targetable = true;
ConventionalBlend = false; MeterReady = false;
return;
}
if (Remaining <= 3)
ConventionalBlend = ((int)((double)Remaining * 5) & 1) != 0;
}
}
+28 -5
View File
@@ -19,6 +19,7 @@ public sealed class LabSimulation
private readonly Func<Vector3, Vector3, SupportHit?>? cameraRay;
private readonly Func<Vector3, Vector3, SupportHit?>? ceilingRay;
private readonly OriginalBodyPhysics? originalBody;
private readonly PlayerEnergy energy;
private readonly Vector3 sourceStart;
private readonly float startYaw, modelMinimumY, rootHeight, startFloor;
private float targetYaw, extraAirAcceleration, shadowDistance, lateralContribution;
@@ -28,13 +29,28 @@ public sealed class LabSimulation
private bool forceFall;
private Vector3 noclipEntry;
private float noclipEntryYaw;
private int gadgetMode = -1;
public bool Noclip { get; private set; }
public bool HasNoclipEntry { get; private set; }
public float NoclipSpeed { get; set; } = 600;
public Func<int>? JetpackInventoryState { get; set; }
public string LevelCode { get; set; } = "LV1B";
public int GadgetMode { get; set; } = -1;
public float Energy { get; set; } = 20;
public InvisibleGadget Invisible { get; } = new();
public int GadgetMode
{
get => gadgetMode;
set
{
if (gadgetMode == 2) Invisible.Release();
gadgetMode = -1;
if (value == 2 && !Invisible.Equip(Energy, IgnoresGadgetEnergy)) return;
gadgetMode = value;
}
}
public bool IgnoresGadgetEnergy => PlayerEnergy.IsTutorial(LevelCode);
public float Energy { get => energy.Value; set => energy.Value = value; }
public bool LowEnergyWarning => energy.LowWarning;
public event Action<int>? EnergySound;
//Source260/live15C serves both body collision and contact tests. The name
//predates source-body integration; burst100 is not an interaction-only size.
public float InteractionRadius { get; private set; } = 60;
@@ -84,12 +100,13 @@ public sealed class LabSimulation
public LabSimulation(SceneCollision collision, Mesh standingPose, Vector3 start, float yaw,
Func<Vector3, Vector3, SupportHit?>? cameraRay = null,
Func<Vector3, Vector3, SupportHit?>? ceilingRay = null,
OriginalStaticCollision? originalCollision = null)
OriginalStaticCollision? originalCollision = null, PlayerEnergy? energy = null)
{
this.collision = collision;
this.cameraRay = cameraRay;
this.ceilingRay = ceilingRay;
originalBody = originalCollision == null ? null : new OriginalBodyPhysics(originalCollision);
this.energy = energy ?? new PlayerEnergy();
sourceStart = start;
startYaw = yaw;
var bounds = standingPose.Bounds();
@@ -107,6 +124,8 @@ public sealed class LabSimulation
public void Reset()
{
if (gadgetMode == 2) gadgetMode = -1;
Invisible.Reset();
var floor = collision.GroundHeight(sourceStart, 2500)!.Value;
Position = new(sourceStart.X, floor + (UsesOriginalBody ? 0 : SceneCollision.Skin), sourceStart.Z);
Velocity = Vector3.Zero;
@@ -162,7 +181,7 @@ public sealed class LabSimulation
return ((float)Math.Sin(radians), (float)Math.Cos(radians));
}
public void Step(PlayerInput input, bool controlled = true)
public void Step(PlayerInput input, bool controlled = true, bool? anyControlled = null)
{
if (Noclip) { StepNoclip(input); return; }
//47E554 global body integration precedes473740 registry callbacks.
@@ -176,8 +195,11 @@ public sealed class LabSimulation
//424BE0..424C34 runs this wrapper before437940's ownership gate.
StepCeiling();
if (controlled) StepPlayer(input);
Invisible.Step(FixedStepClock.Step, anyControlled ?? controlled, input.Fire, input.Jump,
Energy, IgnoresGadgetEnergy, AdjustEnergy);
var effect = JetpackBurst.StepEffect(jumpState, Grounded, FixedStepClock.Step, Energy, LevelCode);
jumpState = effect.State; Energy = effect.Energy; JetpackEffectVisible = effect.Visible;
jumpState = effect.State; JetpackEffectVisible = effect.Visible;
if (effect.Visible) AdjustEnergy(-FixedStepClock.Step * JetpackBurst.EnergyPerSecond);
EffectSteps++;
if (controlled && InputAfterPlayerUpdate) StepInput(input);
Steps++;
@@ -192,6 +214,7 @@ public sealed class LabSimulation
public void StopForPrimaryFire() => Speed = 0;
public void SetShooting(bool shooting) => Shooting = shooting;
public void AdjustEnergy(float delta) => energy.Adjust(delta, LevelCode, id => EnergySound?.Invoke(id));
private void StepCeiling()
{
+50
View File
@@ -0,0 +1,50 @@
namespace GamePort.Game;
/// <summary>42A920 global energy and low-warning latch. Retained across ordinary
/// level loads; the original TSK stores the scalar, not this warning latch.</summary>
public sealed class PlayerEnergy
{
private float value = 20;
public float Value
{
get => value;
set
{
if (!float.IsFinite(value)) throw new ArgumentOutOfRangeException(nameof(value));
this.value = value;
}
}
public bool LowWarning { get; private set; }
public void Adjust(float delta, string level, Action<int>? sound = null)
{
if (!float.IsFinite(delta)) throw new ArgumentOutOfRangeException(nameof(delta));
ArgumentNullException.ThrowIfNull(level);
if (IsTutorial(level)) return;
//The first x87 sum is compared before a float store. Sound80 precedes
//the write; the helper then reloads the live global for the actual add.
if (value > 0 && (double)value + delta <= 0) sound?.Invoke(80);
var sum = (double)value + delta;
value = (float)sum;
if (sum > 100) { value = 100; LowWarning = false; return; }
if (value < 0) value = 0;
if (value < 19)
{
if (!LowWarning)
{
sound?.Invoke(182);
LowWarning = true;
}
}
else if (value > 20) LowWarning = false;
}
public static bool IsTutorial(string level)
{
ArgumentNullException.ThrowIfNull(level);
if (level.Length != 4) return false;
var code = ((uint)level[0] << 24) | ((uint)level[1] << 16)
| ((uint)level[2] << 8) | level[3];
return code is >= 0x56523031 and <= 0x56523038;
}
}
+25 -8
View File
@@ -17,14 +17,16 @@ public sealed class PlayerSceneBinding : IDisposable
this.director = director; this.player = player; this.inventory = inventory; this.tag = tag;
director.ActorPreparing += Prepare;
director.AuthoredTransformChanged += Transform;
director.GadgetReleaseRequested += Release;
inventory.GadgetSelected += Selected;
player.Invisible.EquippedChanged += InvisibleEquipped;
Selected(inventory.SelectedGadget);
}
public bool Step(PlayerInput input)
{
var acceptsInput = director.Controlled || player.Noclip;
player.Step(input, acceptsInput);
player.Step(input, acceptsInput, director.ControlledTag != null);
var rotation = director.FindActor(tag)?.Rotation ?? Vector3.Zero;
director.SyncActor(tag, player.ActorRoot, rotation with { Y = player.Yaw });
return acceptsInput;
@@ -35,17 +37,30 @@ public sealed class PlayerSceneBinding : IDisposable
if (!string.Equals(actor.Tag, tag, StringComparison.OrdinalIgnoreCase)) return;
if (action == ScriptPreparation.StopMotion) player.PrepareForScript();
else if (action == ScriptPreparation.ReleaseGadget)
{
//427FF0 has distinct cases. Only no-selection/jetpack cleanup is
//implemented; do not turn the other gadget cases into blanket resets.
if (inventory.SelectedGadget is -1 or 3)
{ inventory.SelectGadget(-1); player.GadgetMode = -1; }
else UnsupportedGadgetCleanups++;
}
Release(actor);
}
private void Release(DirectorActor actor)
{
if (!string.Equals(actor.Tag, tag, StringComparison.OrdinalIgnoreCase)) return;
//427FF0 switches raw mode, not display selection. A rejected Invisible
//equip can leave display2 with raw mode-1; cleanup does not equip it.
if (player.GadgetMode == 2 || inventory.SelectedGadget is -1 or 3)
{ inventory.SelectGadget(-1); player.GadgetMode = -1; }
else if (player.GadgetMode != -1) UnsupportedGadgetCleanups++;
}
private void Selected(int item) => player.GadgetMode = GadgetScreen.EquippedMode(item);
private void InvisibleEquipped(bool equipped)
{
if (director.FindActor("C3DGODDARD") is not { } companion) return;
//427FF0 requires Goddard complete9E8==false before showing/enabling.
//These six PostLoad levels set that flag (retained-companion.md).
if (!equipped && player.LevelCode is "LEV6" or "LEV7" or "LV1C" or "LV1D" or "LV4A" or "LV6A") return;
companion.Visible = companion.MovementEnabled = companion.BodyEnabled = !equipped;
}
private void Transform(DirectorActor actor)
{
if (string.Equals(actor.Tag, tag, StringComparison.OrdinalIgnoreCase))
@@ -56,6 +71,8 @@ public sealed class PlayerSceneBinding : IDisposable
{
director.ActorPreparing -= Prepare;
director.AuthoredTransformChanged -= Transform;
director.GadgetReleaseRequested -= Release;
inventory.GadgetSelected -= Selected;
player.Invisible.EquippedChanged -= InvisibleEquipped;
}
}
+17 -1
View File
@@ -14,6 +14,10 @@ public sealed class DirectorActor
public Vector3 Rotation { get; internal set; }
public bool Visible { get; internal set; }
public bool Active { get; internal set; }
//Source body integration and movement-enable flags are separate from AI
//activation. Only the bounded companion gadget consumer writes them here.
public bool BodyEnabled { get; internal set; } = true;
public bool MovementEnabled { get; internal set; } = true;
public string Animation { get; internal set; } = "STOP";
public int AIstate { get; internal set; }
public float Speed { get; internal set; }
@@ -93,6 +97,7 @@ public sealed class SceneDirector
public event Action? MusicRestarted;
public event Action<DirectorActor>? ActorChanged;
public event Action<DirectorActor, ScriptPreparation>? ActorPreparing;
public event Action<DirectorActor>? GadgetReleaseRequested;
public event Action<DirectorActor>? AuthoredTransformChanged;
public event Action<string, string>? Unsupported;
@@ -138,6 +143,7 @@ public sealed class SceneDirector
var initial = new DirectorActor(source, actor.Tag, actor.Kind, source.Position);
actor.Position = initial.Position; actor.Rotation = initial.Rotation;
actor.Visible = initial.Visible; actor.Active = initial.Active;
actor.BodyEnabled = initial.BodyEnabled; actor.MovementEnabled = initial.MovementEnabled;
actor.Animation = initial.Animation; actor.AIstate = initial.AIstate;
actor.Speed = initial.Speed; actor.Patrol = initial.Patrol;
actor.SpritePlaying = initial.SpritePlaying; actor.SpriteRevision++;
@@ -336,6 +342,7 @@ public sealed class SceneDirector
private void StartMulti(GamEntity entity)
{
DeactivateInvention(entity); //43129A: explicit Jimmy lookup, before first target check.
// MCA's PlayerControlled is its completion target (4311F0), not an
// activation grant. Only initial activation clears control; later shots
//use431750 without repeating431502..4315A7 preparation.
@@ -353,11 +360,12 @@ public sealed class SceneDirector
{
if (applyCommon)
{
DeactivateInvention(entity); //4165B7, distinct from raw-owner preparation.
if (Equal(entity.Text("PlayerControlled"), "NULL"))
PrepareOwner(ScriptPreparation.ReleaseGadget, ScriptPreparation.StopMotion, ScriptPreparation.FlattenOrientation);
SetControl(entity); Toggle(entity);
}
if (entity.Integer("DeactivateInv") != 0) InventoryEnabled = false;
if (entity.Integer("DeactivateInv", 1) != 0) InventoryEnabled = false;
if (skipping)
{
if (index >= 0) FinishMulti(entity);
@@ -512,6 +520,14 @@ public sealed class SceneDirector
}
}
private void DeactivateInvention(GamEntity source)
{
//Both CAM/MCA constructors default this property to true. The source
//explicitly looks up Jimmy even when a different actor owns control.
if (source.Integer("DeactivateInv", 1) != 0 && actors.TryGetValue("JIM1", out var jimmy))
GadgetReleaseRequested?.Invoke(jimmy);
}
private void SetControl(GamEntity entity, bool prepareOwner = false)
{
var control = entity.Text("PlayerControlled");
+2 -3
View File
@@ -52,12 +52,11 @@ public sealed class SceneGadgets : IDisposable
player.SetShooting(player.Grounded);
if (!loop) { Sound?.Invoke(0,true); loop = true; }
const float dt = FixedStepClock.Step;
if (!(player.LevelCode.Length == 4 && player.LevelCode.StartsWith("VR0",StringComparison.Ordinal)
&& player.LevelCode[3] is >= '1' and <= '8')) player.Energy = Math.Clamp(player.Energy - dt,0,100);
player.AdjustEnergy(-dt);
//Bridge modern signed float yaw to the source's nonnegative Euler domain.
var yaw = (player.Yaw % 360 + 360) % 360;
var hits = Ray.Fire(player.ActorRoot,yaw,dt,
Soldiers.Select(s => new ShrinkCandidate(s.Actor.Tag,s.Actor.Position,Shrunk:s.Shrunk)),
Soldiers.Select(s => new ShrinkCandidate(s.Actor.Tag,s.Actor.Position,BodyEnabled:s.Actor.BodyEnabled,Shrunk:s.Shrunk)),
(start,end) => geometry.TraceGeometry(start,end));
foreach (var tag in hits)
{
+51 -9
View File
@@ -20,9 +20,10 @@ internal static class Program
PlayerLevelState? carriedPlayer = null;
var returning = false;
var diagnostics = new DebugDiagnostics { Enabled = args.Contains("--debug-overlay") };
var energy = new PlayerEnergy();
while (true)
{
var result = Run(args, carriedSave, carriedPlayer, returning, diagnostics, presentation, out var continuation);
var result = Run(args, carriedSave, carriedPlayer, returning, diagnostics, presentation, energy, out var continuation);
if (result != 0 || continuation == null) return result;
args = continuation.Args; carriedSave = continuation.Save; returning = continuation.Returning;
carriedPlayer = continuation.Player;
@@ -43,7 +44,7 @@ internal static class Program
private sealed record SceneContinuation(string[] Args, OriginalSave Save, bool Returning, PlayerLevelState? Player);
private static int Run(string[] args, OriginalSave? carriedSave, PlayerLevelState? carriedPlayer, bool returning, DebugDiagnostics diagnostics,
RenderSession presentation, out SceneContinuation? continuation)
RenderSession presentation, PlayerEnergy energy, out SceneContinuation? continuation)
{
continuation = null;
if (args.Contains("--help"))
@@ -86,6 +87,7 @@ internal static class Program
--smoke-practice-window SDL practice pause/dismiss/resize check (12 frames)
--smoke-jetpack 300-step powered steering/jump check in VR04
--smoke-shrink-ray Fire at an actual VR04 soldier; explicit player-placement fixture
--smoke-invisible Accelerated recharge/activation/flash/expiry/unequip fixture in VR03
--gadget-menu Render original gadget panel (--skip-intro); fixture owns item3
--smoke-gadget-menu SDL menu input/pause/selection/practice/Return check (24 frames)
--smoke-jump-key NAME Replay using shift/right-shift/insert/keypad0/right-mouse
@@ -255,6 +257,7 @@ internal static class Program
var walkSmoke = args.Contains("--smoke-walk");
var jetpackSmoke = args.Contains("--smoke-jetpack");
var shrinkSmoke = args.Contains("--smoke-shrink-ray");
var invisibleSmoke = args.Contains("--smoke-invisible");
var carlSmoke = args.Contains("--smoke-carl-cutscene");
var controlPhaseSmoke = args.Contains("--smoke-control-phases");
var objectiveWindowSmoke = args.Contains("--smoke-objective-window");
@@ -275,7 +278,7 @@ internal static class Program
var defaultStory = (defaultScene || args.Contains("--walk")) && !args.Contains("--inspect") && !walkSmoke && !args.Contains("--smoke-window")
&& animationPath == null && !args.Contains("--time");
var story = defaultStory || loadedSave != null || saveOutput != null || args.Contains("--story") || args.Contains("--story-time")
|| args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || gadgetWindowSmoke || practiceWindowSmoke || practiceReturnSmoke || carlSmoke || controlPhaseSmoke || objectiveSmoke;
|| args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || gadgetWindowSmoke || practiceWindowSmoke || practiceReturnSmoke || carlSmoke || controlPhaseSmoke || objectiveSmoke;
if (story && (args.Contains("--inspect") || walkSmoke || args.Contains("--smoke-window")))
throw new ArgumentException("Story playback requires its own simulation mode.");
if (walkSmoke && args.Contains("--inspect")) throw new ArgumentException("Walk smoke cannot run in inspection mode.");
@@ -299,6 +302,7 @@ internal static class Program
SceneHud? hud = null;
GadgetScreen? gadgetScreen = null;
GadgetMenuOverlay? gadgetOverlay = null;
InvisibleMeterOverlay? invisibleMeter = null;
SceneGadgets? gadgets = null;
ShrinkRayVisuals? rayVisuals = null;
ShrinkSoldierVisuals? soldierVisuals = null;
@@ -322,6 +326,7 @@ internal static class Program
}
var characterOffset = mesh.Vertices.Length;
var characterModel = Matrix4x4.Identity;
MeshDraw? characterDraw = null;
if (animationPath != null)
{
if (scene == null || originalStart == null)
@@ -336,7 +341,7 @@ internal static class Program
simulation = new LabSimulation(new SceneCollision(world), standingPose, originalStart.Position, originalStart.Rotation.Y,
cameraRay == null ? null : (look, eye) => cameraRay.Trace(look, eye),
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end),
level.Code == "VR04" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null)
level.Code == "VR04" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null, energy)
{ LevelCode = level.Code, InputAfterPlayerUpdate = carriedSave != null };
if (carriedPlayer != null)
{
@@ -353,6 +358,7 @@ internal static class Program
var placement = PreviewCharacterPlacement.Create(mesh, standingPose, originalStart.Position, originalStart.Rotation.Y);
characterModel = placement.Model;
mesh = animations.Current.AppendTo(mesh);
characterDraw = mesh.Draws[^1];
if (walking)
Console.WriteLine("Controllable lab: arrows move/turn; Shift/Insert/right mouse jump; Enter/Ctrl/left mouse fire; Tab/Space gadgets; R reset; C inspect; F11 fullscreen; Escape quit. Collision, pivot and timing remain provisional.");
else
@@ -440,6 +446,8 @@ internal static class Program
}
hud = new SceneHud(mesh, Path.Combine(Path.GetDirectoryName(scene!)!, "../ui/ui.json"));
mesh = hud.Mesh;
invisibleMeter = new InvisibleMeterOverlay(mesh,Path.Combine(Path.GetDirectoryName(scene!)!,"../invisible-meter/meter.json"));
mesh = invisibleMeter.Mesh;
gadgetOverlay = new GadgetMenuOverlay(mesh, Path.Combine(Path.GetDirectoryName(scene!)!, "../gadgets/gadgets.json"));
mesh = gadgetOverlay.Mesh;
Console.WriteLine($"Prepared source model actors: {staticVisuals.ActorCount}.");
@@ -472,11 +480,13 @@ internal static class Program
var storyTime = double.Parse(Option(args, "--story-time") ?? "0", System.Globalization.CultureInfo.InvariantCulture);
if (!double.IsFinite(storyTime) || storyTime < 0 || storyTime > 3600 || storyTime > 0 && !headless)
throw new ArgumentException("Story time must be0..3600 seconds in headless mode.");
var frames = int.Parse(Option(args, "--frames") ?? (walkSmoke ? "240" : jetpackSmoke ? "300" : shrinkSmoke ? "90" : gadgetWindowSmoke ? "24" : objectiveWindowSmoke ? "180" : carlSmoke ? "60" : controlPhaseSmoke ? "32" : toolsSmoke ? "20" : debugSmoke ? "16" : diagnosticsSmoke ? "24" : headless ? "1" : "0"));
var frames = int.Parse(Option(args, "--frames") ?? (walkSmoke ? "240" : jetpackSmoke ? "300" : shrinkSmoke ? "90" : invisibleSmoke ? "8" : gadgetWindowSmoke ? "24" : objectiveWindowSmoke ? "180" : carlSmoke ? "60" : controlPhaseSmoke ? "32" : toolsSmoke ? "20" : debugSmoke ? "16" : diagnosticsSmoke ? "24" : headless ? "1" : "0"));
if (gadgetWindowSmoke && (headless || level?.Code != "LV1B" || loadedSave != null || frames < 24))
throw new ArgumentException("Gadget menu SDL fixture requires a fresh windowed lab and24 frames");
if (shrinkSmoke && (level?.Code != "VR04" || gadgets == null || frames < 60))
throw new ArgumentException("Shrink-ray smoke requires actual VR04 and at least60 frames");
if (invisibleSmoke && (level?.Code != "VR03" || frames < 8 || loadedSave != null))
throw new ArgumentException("Invisible smoke requires a fresh VR03 and at least8 frames");
if (controlPhaseSmoke && (level?.Code != "LV1B" || loadedSave != null || frames < 32 || director == null))
throw new ArgumentException("Control-phase fixture needs a fresh lab and at least32 frames");
if (toolsSmoke && (headless || frames < 16 || director == null || level?.Code != "LV1B" || loadedSave != null || debugMenu.Open))
@@ -509,6 +519,7 @@ internal static class Program
ShrinkSoldier? shrinkVictim = null;
var shrinkPhaseMask = 0;
var sawShrinkKey = false;
InvisibleSmoke? invisibleFixture = null;
Console.WriteLine($"Scene presentation: revision={renderer.SceneRevision}, windows={presentation.WindowCreationCount}, renderers={presentation.RendererCreationCount}, window ID={(window == 0 ? 0 : Sdl.SDL_GetWindowID(window))}, size={renderer.Width}x{renderer.Height}.");
{
using var audio = Option(args, "--audio") is { } audioFile
@@ -535,6 +546,7 @@ internal static class Program
director.MusicRestarted += sceneAudio.RestartMusic;
objectivePanel!.SoundEffect += id => { if (level!.Code == "LV1B") sceneAudio.Effect(id); };
interactions!.SoundEffect += id => sceneAudio.Effect(id);
simulation!.EnergySound += id => sceneAudio.Effect(id);
mechanisms!.Sound += (actor, id, loop) => sceneAudio.Effect(id, loop ? actor.Tag : null);
mechanisms.StopSound += actor => sceneAudio.StopLoop(actor.Tag);
sceneAudio.Music(originalStart!.Text("MusicDatabase") ?? "none", originalStart.Integer("MusicIndex", -1));
@@ -556,7 +568,7 @@ internal static class Program
Console.WriteLine($"Practice RETURN: exact saved root={restored}, root={simulation.ActorRoot}, STRT yaw={simulation.Yaw}, intro suppressed={!director.Playing}, companion restored={companionRestored}, retained player input order={simulation.InputAfterPlayerUpdate}, gadget availability={interactions.Inventory.State(0, 3)}.");
if (!restored) throw new InvalidOperationException("RETURN did not restore the live departure root without replaying STRT actions");
}
if (args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || gadgetWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke || controlPhaseSmoke) { sceneAudio?.StopSpeech(); director.Skip(); }
if (args.Contains("--skip-intro") || jetpackSmoke || shrinkSmoke || invisibleSmoke || gadgetWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke || controlPhaseSmoke) { sceneAudio?.StopSpeech(); director.Skip(); }
if (gadgetWindowSmoke) { interactions!.Inventory.SetState(0,3,1); interactions.Inventory.SelectGadget(3); }
if (controlPhaseSmoke)
{
@@ -636,6 +648,7 @@ internal static class Program
throw new InvalidOperationException("Gadget screen requires player control (--skip-intro)");
gadgetScreen.Point(new(200,380), level!.Code, storyTasks!.Get("SCENE"));
}
if (invisibleSmoke) invisibleFixture = new(simulation!,interactions!.Inventory);
if (shrinkSmoke)
{
//Explicit test placement near an ACTUAL authored soldier.
@@ -803,6 +816,12 @@ internal static class Program
debugMenu.Message = "DEBUG INPUT ORDER TOGGLED; NEW LEVEL RESTORES SOURCE POLICY"; break;
case DebugAction.ApplyJetpackState when interactions != null:
interactions.Inventory.SetState(0, 3, debugMenu.JetpackState); debugMenu.Message = "JET PACK AVAILABILITY APPLIED"; break;
case DebugAction.GiveInvisible when interactions != null:
interactions.Inventory.SetState(0,2,1); interactions.Inventory.SelectGadget(2);
debugMenu.Message = simulation?.GadgetMode == 2 ? "INVISIBLE EQUIPPED - RECHARGE 7 SECONDS, THEN FIRE"
: "INVISIBLE OWNED - ENERGY REQUIRED TO EQUIP"; break;
case DebugAction.UnequipGadget when interactions != null:
interactions.Inventory.SelectGadget(-1); debugMenu.Message = "GADGET UNEQUIPPED"; break;
case DebugAction.CameraObstruction when debugCameraRay != null:
debugCameraRay.Enabled = !debugCameraRay.Enabled; debugMenu.Message = "STATIC CAMERA QUERY TOGGLED"; break;
case DebugAction.MuteMusic or DebugAction.MuteSpeech or DebugAction.MuteEffects when sceneAudio != null:
@@ -868,6 +887,11 @@ internal static class Program
}
while (running)
{
invisibleFixture?.BeforeFrame(count,(key,down)=>
{
var e = new Sdl.Event {Type=down?Sdl.KeyDown:Sdl.KeyUp,Scancode=key,Down=down?(byte)1:(byte)0};
if(!Sdl.SDL_PushEvent(ref e)) throw new InvalidOperationException(Sdl.Error);
},headless);
if (gadgetWindowSmoke)
{
void Key(uint key,bool down) { var e=new Sdl.Event {Type=down?Sdl.KeyDown:Sdl.KeyUp,Scancode=key,Down=down?(byte)1:(byte)0};
@@ -990,7 +1014,7 @@ internal static class Program
if (e.Type == Sdl.MouseButtonUp && e.MouseButton == 3) mouseJump = false;
if (e.Type == Sdl.KeyDown)
{
if (shrinkSmoke && e.Scancode == 224) sawShrinkKey = true;
if ((shrinkSmoke || invisibleSmoke) && e.Scancode == 224) sawShrinkKey = true;
keys.Add(e.Scancode);
if (walkSmoke) sawWalkKeys |= e.Scancode == 82 ? 1 : e.Scancode == 79 ? 2 : e.Scancode == jumpScancode ? 4 : 0;
if (jetpackSmoke) sawJetpackKeys |= e.Scancode == 82 ? 1 : e.Scancode == 81 ? 2 : e.Scancode == 80 ? 4 : e.Scancode == jumpScancode ? 8 : 0;
@@ -1038,12 +1062,13 @@ internal static class Program
}
}
if (debugMenu.Open) animationStarted += elapsed;
if (simulation != null && !debugMenu.Open && !inspecting && !practice.Active && gadgetScreen?.Open != true && (active || headless || walkSmoke || jetpackSmoke || shrinkSmoke || gadgetWindowSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke))
if (simulation != null && !debugMenu.Open && !inspecting && !practice.Active && gadgetScreen?.Open != true && (active || headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || gadgetWindowSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke))
{
var steps = headless || walkSmoke || jetpackSmoke || shrinkSmoke || gadgetWindowSmoke || practiceWindowSmoke || carlSmoke || controlPhaseSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke ? 1 : stepClock.Advance(elapsed);
var steps = headless || walkSmoke || jetpackSmoke || shrinkSmoke || invisibleSmoke || gadgetWindowSmoke || practiceWindowSmoke || carlSmoke || controlPhaseSmoke || objectiveWindowSmoke || debugSmoke || diagnosticsSmoke || toolsSmoke ? 1 : stepClock.Advance(elapsed);
for (var step = 0; step < steps; step++)
{
var input = carlSmoke || controlPhaseSmoke ? new PlayerInput(true, false, true, false, true)
: invisibleSmoke && headless ? new PlayerInput(false,false,false,false,false,Fire:count==1)
: shrinkSmoke && headless ? new PlayerInput(false,false,false,false,false,Fire:true)
: jetpackSmoke && headless ? LabSimulation.JetpackSmokeInput(simulation.Steps)
: walkSmoke && headless ? LabSimulation.SmokeInput(simulation.Steps) : new PlayerInput(
@@ -1130,6 +1155,7 @@ internal static class Program
objectivePanel?.Step(0, director?.ControlledTag != null, practice.Active);
hud?.Update(mesh, interactions!.CurrentObjective, level!.Code == "LV1B" && objectivePanel!.PadVisible && gadgetScreen?.Open != true,
practice.Active, objectivePanel!.YOffset, objectivePanel.ContentVisible, renderer.Width, renderer.Height);
invisibleMeter?.Update(mesh,simulation!.Invisible,renderer.Width,renderer.Height);
if (gadgetScreen != null)
{
if (!headless) gadgetScreen.Point(Pointer(),level!.Code,storyTasks!.Get("SCENE"));
@@ -1151,6 +1177,8 @@ internal static class Program
MovementMode = simulation?.MovementMode ?? 0, InputAfterPlayer = simulation?.InputAfterPlayerUpdate ?? false,
JumpState = simulation?.JumpState ?? 0, JumpHold = simulation?.JumpHoldSeconds ?? 0,
BurnRemaining = simulation?.JetpackRemaining ?? 0, JetpackAvailability = interactions?.Inventory.State(0, 3) ?? 0,
InvisibleRemaining = simulation?.Invisible.Remaining ?? 0, InvisibleRecharge = simulation?.Invisible.Recharge ?? 0,
Targetable = simulation?.Invisible.Targetable ?? true,
Objective = interactions?.CurrentObjective ?? 0, ObjectiveTime = objectivePanel?.Elapsed ?? 0,
CameraObstruction = debugCameraRay?.Enabled, CameraPolygons = debugCameraRay?.PolygonCount ?? 0,
CameraWallPolygons = debugCameraRay?.WallPolygonCount ?? 0, CameraTests = debugCameraRay?.LastTriangleTests ?? 0,
@@ -1179,8 +1207,16 @@ internal static class Program
: fixedTime ?? (headless ? count / 60.0 : now - animationStarted),
mesh.Vertices.AsSpan(characterOffset, animations.Current.Base.Vertices.Length), characterModel);
}
if (simulation != null && characterDraw != null)
PlayerGadgetMaterial.Apply(characterDraw, simulation.Invisible);
renderer.UpdateVertices(mesh.Vertices);
renderer.Render(view * projection);
if (invisibleFixture != null)
{
invisibleFixture.AfterFrame(count,characterDraw!);
if (InvisibleSmoke.StageName(count) is { } stage && Option(args,"--screenshot") is { } capture)
renderer.SavePpm(Path.ChangeExtension(capture,$".{stage}.ppm"));
}
var presentedAt = clock.Elapsed.TotalSeconds;
diagnostics.ObserveFrame(presentedAt - lastPresentedAt);
lastPresentedAt = presentedAt;
@@ -1443,6 +1479,12 @@ internal static class Program
if (simulation.Bursts == 0 || simulation.MaximumRise <= 137.62f || !simulation.Grounded
|| poweredAirTravel <= 20 || !poweredAirTurn || !headless && (sawJetpackKeys != 15 || !didResize)) return 2;
}
if (invisibleFixture != null)
{
Console.WriteLine(invisibleFixture.Report);
if (!headless) Console.WriteLine($"Invisible SDL primary received: {sawShrinkKey}.");
if (!invisibleFixture.Passed || !headless && !sawShrinkKey) return 2;
}
if (shrinkSmoke)
{
var renderedHeight = soldierVisuals!.RenderedHeight(shrinkVictim!.Actor.Tag,mesh);