Route delivered HQ tracks to temporary road interception and refresh playtest packages
This commit is contained in:
@@ -117,6 +117,76 @@ class ERR_NativeHQMemoryProbe
|
||||
report.ObservedAt = now; report.Position = position; report.TravelMode = "on foot";
|
||||
return report;
|
||||
}
|
||||
// Read-only native road evidence with explicitly arranged delivered-value inputs.
|
||||
// No natural perception, real radio delivery or force movement is claimed here.
|
||||
protected bool LocalRoadPolicy()
|
||||
{
|
||||
SCR_AIWorld world = SCR_AIWorld.Cast(GetGame().GetAIWorld());
|
||||
if (!Check(world && world.GetRoadNetworkManager(), "road fixture has native Everon road manager")) return false;
|
||||
vector center = m_Mode.PrisonPosition();
|
||||
array<BaseRoad> roads = {};
|
||||
world.GetRoadNetworkManager().GetRoadsInAABB(center + "-500 -1000 -500", center + "500 1000 500", roads);
|
||||
if (!Check(!roads.IsEmpty() && roads.Count() <= 128, "road fixture native query stays within bounded road count")) return false;
|
||||
int attempts, inspected;
|
||||
for (int r = 0; r < roads.Count() && r < 16 && attempts < 8; r++)
|
||||
{
|
||||
BaseRoad road = roads[r];
|
||||
if (!road || road.GetWidth() < 4) continue;
|
||||
array<vector> points = {}; road.GetPoints(points);
|
||||
if (points.Count() < 2 || points.Count() > 1024) continue;
|
||||
for (int p = 1; p < points.Count() && attempts < 8 && inspected < 4096; p++)
|
||||
{
|
||||
inspected++;
|
||||
vector midpoint = vector.Lerp(points[p - 1], points[p], 0.5);
|
||||
vector direction = points[p] - points[p - 1]; direction[1] = 0;
|
||||
if (direction.Length() < 1 || vector.DistanceXZ(center, midpoint) > 500) continue;
|
||||
direction.Normalize(); attempts++;
|
||||
// Three metres/second produces a 60m future lead at this zero-age sample.
|
||||
ERR_HQMemory memory = new ERR_HQMemory();
|
||||
ERR_HQReport first = new ERR_HQReport();
|
||||
first.Target = m_Mode; first.MessageId = 1; first.ObservedAt = 6000;
|
||||
first.Position = midpoint - direction * 72; first.TravelMode = "on foot";
|
||||
ERR_HQReport second = first.Snapshot();
|
||||
second.MessageId = 2; second.ObservedAt = 10000; second.Position = midpoint - direction * 60;
|
||||
if (!Check(memory.Ingest(first, 6000) && memory.Ingest(second, 10000), "arranged detached road snapshots accepted by private memory")) return false;
|
||||
ERR_HQBelief belief = memory.Get(m_Mode);
|
||||
array<vector> reserved = {};
|
||||
vector chosen;
|
||||
if (!ERR_HQRoadIntercept.Select(belief, 10000, reserved, chosen)) continue;
|
||||
if (!Check(ERR_HQRoadIntercept.Ahead(belief.PredictedPosition, belief.Velocity, chosen)
|
||||
&& vector.DistanceXZ(chosen, midpoint) <= 100.1 && ERR_HQRoadIntercept.Standable(chosen),
|
||||
"native road choice is forward, nearby, dry and physically clear")) return false;
|
||||
// Independently measure the chosen point against native segment geometry.
|
||||
bool onRoad;
|
||||
int verifiedSegments;
|
||||
foreach (BaseRoad verify : roads)
|
||||
{
|
||||
if (!verify || verify.GetWidth() < 4) continue;
|
||||
array<vector> vertices = {}; verify.GetPoints(vertices);
|
||||
if (vertices.Count() < 2 || vertices.Count() > 1024) continue;
|
||||
verifiedSegments += vertices.Count() - 1;
|
||||
if (!Check(verifiedSegments <= 4096, "road membership verification stays within segment budget")) return false;
|
||||
for (int v = 1; v < vertices.Count(); v++)
|
||||
{
|
||||
vector delta = vertices[v] - vertices[v - 1]; delta[1] = 0;
|
||||
float length = delta.Length(); if (length < 0.01) continue;
|
||||
vector offset = chosen - vertices[v - 1]; offset[1] = 0;
|
||||
float fraction = Math.Clamp(vector.Dot(offset, delta) / (length * length), 0, 1);
|
||||
vector projected = vector.Lerp(vertices[v - 1], vertices[v], fraction);
|
||||
if (vector.DistanceXZ(chosen, projected) < 0.1 && Math.AbsFloat(chosen[1] - projected[1]) <= 2) { onRoad = true; break; }
|
||||
}
|
||||
if (onRoad) break;
|
||||
}
|
||||
if (!Check(onRoad, "chosen intercept lies on an actual native road segment")) return false;
|
||||
PrintFormat("ERR ROAD FIXTURE: arranged origin=%1 velocity=%2 chosen=%3 attempts=%4", belief.Position, belief.Velocity, chosen, attempts);
|
||||
memory.Tick(56000);
|
||||
if (!Check(!ERR_HQRoadIntercept.Select(memory.Get(m_Mode), 56000, reserved, chosen),
|
||||
"same arranged belief aged46seconds refuses road interception")) return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return Check(false, "bounded road fixture found no suitable native candidate; no fallback or force mutation");
|
||||
}
|
||||
protected bool LocalPolicies()
|
||||
{
|
||||
ERR_ForceLedger ledger = new ERR_ForceLedger();
|
||||
@@ -233,7 +303,7 @@ class ERR_NativeHQMemoryProbe
|
||||
{
|
||||
if (!Check(hq.ERR_MemoryFixtureRegisteredForces() == 6,
|
||||
"actual six site groups are registered once in the Core force ledger")) return -1;
|
||||
if (!LocalPolicies()) return -1;
|
||||
if (!LocalPolicies() || !LocalRoadPolicy()) return -1;
|
||||
m_ValueChecked = true;
|
||||
}
|
||||
m_FirstPosition = m_Mode.PrisonPosition() + "300 0 300";
|
||||
|
||||
Reference in New Issue
Block a user