Prepare independent successor playtest with spawn recovery and casualty feedback

This commit is contained in:
2026-09-19 22:12:52 +02:00
parent 61e165ef5b
commit 6cf989a060
266 changed files with 134064 additions and 154 deletions
@@ -1,12 +1,11 @@
// Unqualified 100m field-route prototype. No allocation, HQ dispatch or service
// integration. The shared base registry/bridge remains the sole input owner.
// Unqualified 100m field-route prototype, admitted by the typed service only.
// No allocation or HQ dispatch; the shared registry/bridge owns native inputs.
class ERR_AircraftFieldFlight : ERR_AircraftFlight
{
protected ref ERR_AircraftFieldEnvelope m_Field;
protected int m_FieldPhase; // 0 startup, 1 cruise, 2 braking, 3 slow settling
protected vector m_FieldReference;
protected vector m_FieldIntegral;
protected float m_FieldBrakeSpeed;
protected vector m_FieldLandingPoint;
protected bool m_FieldStopFrozen;
protected bool m_FieldArrived;
@@ -55,6 +54,7 @@ class ERR_AircraftFieldFlight : ERR_AircraftFlight
{
if (m_FieldStopFrozen) return true;
if (!Owns() || !m_Field || !Healthy()) { Fail("field braking ownership or capability unavailable"); return false; }
if (m_Simulation.HasAnyGroundContact()) { Fail("field airborne braking refused ground contact"); return false; }
vector point = m_Field.Destination();
if (m_Cancelled)
{
@@ -70,9 +70,9 @@ class ERR_AircraftFieldFlight : ERR_AircraftFlight
m_Controller.SetAutohoverEnabled(true);
if (!m_Controller.GetAutohoverEnabled()) { Fail("native field braking autohover enable refused"); return false; }
m_FieldLandingPoint = point; m_FieldStopFrozen = true;
// Begin reducing the reference at entry, before the modeled reserve boundary.
// This one frozen ceiling cannot increase on another cancellation or tick.
m_FieldBrakeSpeed = m_FieldReference.Length() * 0.9;
// Remove cruise integral once; retain the bounded vector slew toward rest.
// Repeated cancellation must not reset this state or the frozen deadline.
m_FieldIntegral = "0 0 0";
m_FieldPhase = 2; m_State = ERR_AircraftFlightState.TRANSLATING;
m_FieldLowSince = -1; m_Stable = -1;
// Includes braking, two low-speed seconds and five seconds of final hold.
@@ -112,6 +112,7 @@ class ERR_AircraftFieldFlight : ERR_AircraftFlight
float now = Now();
if (now < 0 || now >= m_Deadline || now >= m_StageDeadline) { Fail("bounded field stage expired"); return false; }
if (!Healthy() || !m_Readback) { Fail("field capability or native input readback lost"); return false; }
if (m_FieldPhase == 2 && m_Simulation.HasAnyGroundContact()) { Fail("field ground contact during airborne braking"); return false; }
vector transform[4]; m_Aircraft.GetWorldTransform(transform);
if (!FieldContains(transform[3], transform[1][1]) || !ERR_AircraftFieldRules.SpeedAllowed(m_Simulation.GetVelocity())) { Fail("qualified field position, attitude or speed exceeded"); return false; }
return true;
@@ -121,10 +122,12 @@ class ERR_AircraftFieldFlight : ERR_AircraftFlight
vector target = m_Field.Destination(); if (m_FieldStopFrozen) target = m_FieldLandingPoint;
if (m_FieldPhase == 3 || m_State == ERR_AircraftFlightState.LANDING) return ERR_AircraftTranslationRules.Demand(target, position, velocity);
vector direction = target - position; direction[1] = 0;
float remaining = direction.Length(); float targetSpeed = 2;
if (m_FieldPhase == 2) targetSpeed = ERR_AircraftFieldRules.ApproachSpeed(remaining, Math.Min(m_FieldReference.Length(), m_FieldBrakeSpeed));
vector desired;
if (remaining > 0.001) desired = direction * (targetSpeed / remaining);
float remaining = direction.Length();
vector desired = "0 0 0";
// Braking targets rest immediately, independently of distance or bearing.
// A lagging native airframe can still accelerate while the reference slews;
// only native measurements can qualify the declared actual-speed reserve.
if (m_FieldPhase != 2 && remaining > 0.001) desired = direction * (2 / remaining);
m_FieldReference = ERR_AircraftFieldRules.RampReference(m_FieldReference, desired, dt);
vector nextIntegral;
vector demand = ERR_AircraftFieldRules.VelocityDemand(m_FieldReference, velocity, m_FieldIntegral, dt, nextIntegral);
@@ -173,9 +176,10 @@ class ERR_AircraftFieldFlight : ERR_AircraftFlight
}
if (m_FieldPhase == 2)
{
if (m_Simulation.HasAnyGroundContact()) { Fail("field ground contact during airborne braking"); return; }
if (!(horizontal < 0.25)) m_FieldLowSince = -1;
else if (m_FieldLowSince < 0) m_FieldLowSince = now;
if (!ERR_AircraftFieldRules.LowSpeedHeld(horizontal, m_FieldLowSince, now)) return;
if (!ERR_AircraftFieldRules.LowSpeedHeld(horizontal, m_FieldLowSince, now) || !(m_FieldReference.Length() <= 0.01)) return;
m_FieldPhase = 3; m_FieldReference = "0 0 0"; m_FieldIntegral = "0 0 0"; m_Stable = -1;
// No new deadline: slow positioning/hold belongs to the same braking budget.
}