Preserve retained Jimmy update order on initial story entry

This commit is contained in:
UnixNight committed 2026-11-06 17:08:59 -05:00
1 parent 4cd62d3627
commit ea04210f52
24 files changed
+1209 -22

No files matched your search

@@ -0,0 +1,32 @@
using GamePort.Game;
namespace GamePort.Application;
/// <summary>Exercise grounded neutral input after skipping the real Carl chain.
/// Kept separate from the held-input check, which cannot detect stale bank.</summary>
internal static class CutsceneIdleSmoke
{
public static void LandWhileLocked(PlayerSceneBinding binding, SceneDirector director, LabSimulation player)
{
for (var tick = 0; tick < 180; tick++) binding.Step(default);
if (director.Controlled || !player.Grounded || player.MovementMode != 1 || player.TurnRate == 0)
throw new InvalidOperationException("Carl idle fixture did not retain airborne mode/turn through an uncontrolled landing");
}
public static void VerifyReturn(PlayerSceneBinding binding, SceneDirector director, LabSimulation player)
{
var yaw = player.Yaw;
for (var tick = 0; tick < 300; tick++)
{
binding.Step(default);
if (!director.Controlled || player.MovementMode != 0 || player.TurnRate != 0
|| MathF.Abs(MathF.IEEERemainder(player.Pitch, 360)) > .001f
|| MathF.Abs(MathF.IEEERemainder(player.Roll, 360)) > .001f
|| MathF.Abs(MathF.IEEERemainder(player.Yaw - yaw, 360)) > .001f
|| MathF.Abs(player.FacingTarget.X) > .001f || MathF.Abs(player.FacingTarget.Z) > .001f)
throw new InvalidOperationException($"Carl neutral return republished airborne bank on tick{tick}: "
+ $"inputAfterPlayer={player.InputAfterPlayerUpdate}, Euler={player.Rotation}, target={player.FacingTarget}, mode={player.MovementMode}, turn={player.TurnRate}");
}
Console.WriteLine("Carl neutral return: upright on first resumed input and300 idle ticks; heading preserved.");
}
}
+10 -1
View File
@@ -362,7 +362,10 @@ internal static class Program
cameraRay == null ? null : (look, eye) => cameraRay.Trace(look, eye),
cameraRay == null ? null : (start, end) => cameraRay.TraceGeometry(start, end),
level.Code is "VR01" or "VR02" or "VR04" or "VR07" or "VR08" ? OriginalStaticCollision.FromRouteScene(world,level.Code) : null, energy)
{ LevelCode = level.Code, InputAfterPlayerUpdate = carriedSave != null };
//Successful TSK entry reuses the menu-background Jimmy, whose
//node precedes the new level game. Direct scene inspection
//still has fresh game-before-player order. See main-menu-player-lifetime.md.
{ LevelCode = level.Code, InputAfterPlayerUpdate = story || carriedSave != null };
if(level.Code=="VR08")simulation.EnableGrappler(world,grapplerMemory);
if (carriedPlayer != null)
{
@@ -1502,6 +1505,8 @@ internal static class Program
count++;
if (controlPhaseSmoke && (count == 1 || count == 15) && Option(args, "--screenshot") is { } phaseCapture)
renderer.SavePpm(Path.ChangeExtension(phaseCapture, count == 1 ? ".locked-start.ppm" : ".locked-fall.ppm"));
if (controlPhaseSmoke && count == 16 && Option(args, "--screenshot") is { } returnCapture)
renderer.SavePpm(Path.ChangeExtension(returnCapture, ".returned.ppm"));
if (controlPhaseSmoke && count == 15)
{
phasesLocked = director is { Controlled: false, Playing: true }
@@ -1511,7 +1516,11 @@ internal static class Program
&& simulation.Rotation == controlRotation && simulation.FacingTarget == controlRotation && !simulation.FacingDirty
&& simulation.ActorRoot.Y < controlEntry.Y && simulation.JetpackRemaining is > 0 and < 6.125f
&& simulation.Energy < 20 && Vector2.Distance(new(simulation.ActorRoot.X, simulation.ActorRoot.Z), new(controlEntry.X, controlEntry.Z)) < .001f;
CutsceneIdleSmoke.LandWhileLocked(playerBinding!, director!, simulation!);
sceneAudio?.StopSpeech();
director!.Skip();
CutsceneIdleSmoke.VerifyReturn(playerBinding!, director, simulation!);
controlControllers = simulation!.ControllerSteps;
}
if (controlPhaseSmoke && count == 30)
phasesResumed = director!.Controlled && simulation!.ControllerSteps == controlControllers + 15 && simulation.Travel > 1;