Capture current mission, AI, map and administration development
Include the current addon, terrain integrations, tools, regression tests and recorded development evidence.
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"path": "addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeRandomRadiusTrace.c",
|
||||
"working_exists": false,
|
||||
"indexed": false
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"kind": "WORKBENCH-only opt-in diagnostic, not a gameplay correction",
|
||||
"flag": "errTraceRandomRadius=1 cached once on first hook",
|
||||
"cap": "one shared static count, at most16 log lines and16 Debug.DumpStack calls",
|
||||
"sdk_methods": {
|
||||
"SCR_AIGetRandomPoint": "EOnTaskSimulate(AIAgent owner,float dt): post-superSUCCESS actualupdated m_ExclusionRadius/m_Radius both0",
|
||||
"SCR_AIGetRandomLookPosition": "EOnTaskSimulate(AIAgent owner,float dt): pre-super, read ownerentity and InPos exactly as native, trace distance*m_fTangent==0",
|
||||
"SCR_AICalculateNextCombatMovePos": "protected RandomizeDestinationPos(float distance,vector centerPos): pre-super trace0.1*distance==0",
|
||||
"SCR_AIGetRandomPointWithExclude": "protected FindPosition2D(out randomPos,randomSphereOrigin,randomSphereRadius,excludeSphereOrigin=vector.Zero,excludeRadius=0,iterationCount=50): exact native directbranch withbothradii0, or iterativebranch withiterations>0 andouter0.",
|
||||
"SCR_RecoilCameraShakeParams": "protected RandomVectorSphere(vector min,vector max,bool uniform=true): pre-super only min.Length()==0&&max.Length()==0"
|
||||
},
|
||||
"preservation": "One superclass call per wrapper with originalargs; exactreturn, nativeoutputs and RNGsequence untouched. Disabled/capped noextra owner/input/world reads. No callbacks/orders/spawns/clamps.",
|
||||
"limitations": [
|
||||
"RandomPoint trace requires superclass SUCCESS after nativecall; absence doesnotexclude aborting/native-othercallers.",
|
||||
"Look trace adds opt-in read-only port/owner/position reads before nativecall.",
|
||||
"No native qualification yet; peers own independent source/test review."
|
||||
],
|
||||
"source_review": "Firstthreewrappers SDK reviewclean; finalfivewrapper independentreview/tests pending.",
|
||||
"target_edits": false,
|
||||
"compiler_run_by_author": false,
|
||||
"native_run": false,
|
||||
"attribution": "All four AI wrappers pass Node this; helper calls native GetCallstackStr only for an enabled actual trace under shared16cap. Recoil logs parameters and scriptstack, no invented AI owner."
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
--- /dev/null
|
||||
+++ b/addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeRandomRadiusTrace.c
|
||||
@@ -0,0 +1,108 @@
|
||||
+// Explicit Workbench diagnostic only. Preserve every native superclass result,
|
||||
+// output and random draw; this observes zero-radius callers without correcting them.
|
||||
+#ifdef WORKBENCH
|
||||
+class ERR_NativeRandomRadiusTrace
|
||||
+{
|
||||
+ protected static bool s_Checked;
|
||||
+ protected static bool s_Enabled;
|
||||
+ protected static int s_Count;
|
||||
+ static bool CanTrace()
|
||||
+ {
|
||||
+ if (!s_Checked)
|
||||
+ {
|
||||
+ s_Checked = true;
|
||||
+ string value;
|
||||
+ s_Enabled = System.GetCLIParam("errTraceRandomRadius", value) && value == "1";
|
||||
+ }
|
||||
+ return s_Enabled && s_Count < 16;
|
||||
+ }
|
||||
+ static void Log(string context, AIAgent owner, float inner, float outer, string details, Node node = null)
|
||||
+ {
|
||||
+ if (!CanTrace()) return;
|
||||
+ s_Count++;
|
||||
+ string nodeStack;
|
||||
+ if (node) node.GetCallstackStr(nodeStack);
|
||||
+ PrintFormat("ERR ZERO RADIUS TRACE: sample=%1/16 class=%2 owner=%3 inner=%4 outer=%5 %6 nodeStack=%7", s_Count, context, owner, inner, outer, details, nodeStack);
|
||||
+ Debug.DumpStack();
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+modded class SCR_AIGetRandomPoint
|
||||
+{
|
||||
+ override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
|
||||
+ {
|
||||
+ ENodeResult result = super.EOnTaskSimulate(owner, dt);
|
||||
+ // The superclass updates these fields from the actual waypoint/input ports.
|
||||
+ if (ERR_NativeRandomRadiusTrace.CanTrace() && result == ENodeResult.SUCCESS && m_ExclusionRadius == 0 && m_Radius == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_AIGetRandomPoint", owner, m_ExclusionRadius, m_Radius, string.Format("phase=after-success node=%1", this), this);
|
||||
+ return result;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+modded class SCR_AIGetRandomLookPosition
|
||||
+{
|
||||
+ override ENodeResult EOnTaskSimulate(AIAgent owner, float dt)
|
||||
+ {
|
||||
+ if (ERR_NativeRandomRadiusTrace.CanTrace() && owner)
|
||||
+ {
|
||||
+ IEntity controlledEntity = owner.GetControlledEntity();
|
||||
+ vector inPos;
|
||||
+ if (controlledEntity && GetVariableIn(PORT_IN_POS, inPos))
|
||||
+ {
|
||||
+ float distance = vector.Distance(controlledEntity.GetOrigin(), inPos);
|
||||
+ float radius = distance * m_fTangent;
|
||||
+ if (radius == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_AIGetRandomLookPosition", owner, 0, radius, string.Format("phase=before-super node=%1 entity=%2 inPos=%3 distance=%4 tangent=%5", this, controlledEntity, inPos, distance, m_fTangent), this);
|
||||
+ }
|
||||
+ }
|
||||
+ return super.EOnTaskSimulate(owner, dt);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+modded class SCR_AICalculateNextCombatMovePos
|
||||
+{
|
||||
+ override protected vector RandomizeDestinationPos(float distance, vector centerPos)
|
||||
+ {
|
||||
+ if (ERR_NativeRandomRadiusTrace.CanTrace())
|
||||
+ {
|
||||
+ float radius = 0.1 * distance;
|
||||
+ if (radius == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_AICalculateNextCombatMovePos", null, 0, radius, string.Format("phase=before-super node=%1 center=%2 distance=%3 scale=0.1", this, centerPos, distance), this);
|
||||
+ }
|
||||
+ return super.RandomizeDestinationPos(distance, centerPos);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+modded class SCR_AIGetRandomPointWithExclude
|
||||
+{
|
||||
+ override protected bool FindPosition2D(out vector randomPos, vector randomSphereOrigin, float randomSphereRadius, vector excludeSphereOrigin = vector.Zero, float excludeRadius = 0, int iterationCount = 50)
|
||||
+ {
|
||||
+ if (ERR_NativeRandomRadiusTrace.CanTrace())
|
||||
+ {
|
||||
+ if (randomSphereOrigin == excludeSphereOrigin || excludeRadius < 1.0e-8)
|
||||
+ {
|
||||
+ if (excludeRadius == 0 && randomSphereRadius == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_AIGetRandomPointWithExclude", null, excludeRadius, randomSphereRadius, string.Format("phase=before-super branch=direct node=%1 origin=%2 excludedOrigin=%3 excludeRadius=%4 iterations=%5", this, randomSphereOrigin, excludeSphereOrigin, excludeRadius, iterationCount), this);
|
||||
+ }
|
||||
+ else if (iterationCount > 0 && randomSphereRadius == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_AIGetRandomPointWithExclude", null, 0, randomSphereRadius, string.Format("phase=before-super branch=iterative node=%1 origin=%2 excludedOrigin=%3 excludeRadius=%4 iterations=%5", this, randomSphereOrigin, excludeSphereOrigin, excludeRadius, iterationCount), this);
|
||||
+ }
|
||||
+ return super.FindPosition2D(randomPos, randomSphereOrigin, randomSphereRadius, excludeSphereOrigin, excludeRadius, iterationCount);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+modded class SCR_RecoilCameraShakeParams
|
||||
+{
|
||||
+ override protected vector RandomVectorSphere(vector min, vector max, bool uniform = true)
|
||||
+ {
|
||||
+ if (ERR_NativeRandomRadiusTrace.CanTrace())
|
||||
+ {
|
||||
+ float inner = min.Length();
|
||||
+ float outer = max.Length();
|
||||
+ if (inner == 0 && outer == 0)
|
||||
+ ERR_NativeRandomRadiusTrace.Log("SCR_RecoilCameraShakeParams", null, inner, outer, string.Format("phase=before-super params=%1 min=%2 max=%3 uniform=%4", this, min, max, uniform));
|
||||
+ }
|
||||
+ return super.RandomVectorSphere(min, max, uniform);
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
@@ -0,0 +1,22 @@
|
||||
{
|
||||
"verdict": "approved",
|
||||
"review_kind": "Independent read-only source/test inspection; test not executed and no compiler/native invoked.",
|
||||
"files": {
|
||||
"/home/jakub/devel/escapistsrereintroduced/tools/headless_workbench.py": "75a08fe705044a4ce6707933f9d20b7fe4b852c97bbd8447e455346b9d2a696b",
|
||||
"/tmp/erri-gameplay-root-0504/tools/headless_workbench.py": "aa971eb48206042315aa7632625d04d44ec9db82ea568a071b977118cb63361f",
|
||||
"/tmp/erri-gameplay-root-0504/tests/test_native_random_radius_runner.py": "aa75c700906d55b098731715503ce52725a944d47b7195fcd47d222756345c75"
|
||||
},
|
||||
"findings": [
|
||||
"Exactly three added runner lines: store_true opt-in declaration, early admission guard and conditional two-token native flag emission. Removing those lines reproduces target runner byte-for-byte.",
|
||||
"Flag defaults false. Enabled requests require normal-escape-route, Chat, one round and timeout>=420. Refusal occurs immediately after argument parsing before path resolution, prefix locks, profile creation and launch. Existing upper timeout and all other validation remain unchanged.",
|
||||
"Disabled invocation keeps exact existing command/default flags. Enabled invocation appends only -errTraceRandomRadius 1. No Gamescope/display/audio/prefix/cleanup/provenance modifications.",
|
||||
"Test extracts actual parser declarations, actual guard and actual emission through AST; checks defaultoff, exact emission, wrongfixture/project/rounds/timeout refusal and guard ordering. It does not launch native or execute the complete runner."
|
||||
],
|
||||
"limitations": [
|
||||
"Test guard-order assertion compares with first path-resolution assignment; byte-for-byte runner comparison additionally establishes no earlier new side effects.",
|
||||
"No native behavior or script hook pass-through qualification is claimed by runner review."
|
||||
],
|
||||
"target_edits": false,
|
||||
"native_run": false,
|
||||
"test_run": false
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
{
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/AI/ScriptedNodes/Utils/SCR_AIGetRandomPoint.c": {
|
||||
"sha256": "696899cc8e1d53e4f6a4107c933c1fa2bb836f27a1a357e4909036983a669c3e"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/AI/ScriptedNodes/Utils/SCR_AIGetRandomLookPosition.c": {
|
||||
"sha256": "cd2e0a6871ba32541b28aae2f17b5d1139e2c29b0ea25ccadd022838a1c490f5"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/AI/Movement/SCR_AICalculateNextCombatMovePos.c": {
|
||||
"sha256": "636fbef514e676d8bf45be87646bfb1ef38ddbf0e30c5fea0377bc696d5c5476"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/UI/Components/WidgetLibrary/SCR_ScriptedWidgetComponent.c": {
|
||||
"sha256": "e40552f9bf619e008a3796920c6e7ecbc8db68a5f914ab1988780a7ba90ea417"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/AI/ScriptedNodes/Utils/SCR_AIGetRandomPointWithExclude.c": {
|
||||
"sha256": "978eda9adc1721978ab9d952cd24f458ae213661216d9b541c3439d5322c65d0"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/Camera/Shake/SCR_RecoilCameraShakeParams.c": {
|
||||
"sha256": "81c78fd6de3e3d1f4031b589918b002fd0d4ef1673a6287ad7249b2c236aef8c"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/generated/AI/Node.c": {
|
||||
"sha256": "d5d3eea4e72d8a8978257009f8b3408628c26c0dd7c406a1fe86fafdaaedc789"
|
||||
},
|
||||
"/tmp/erri-vanilla-stock/scripts/Game/AI/Utils/NodeError.c": {
|
||||
"sha256": "75a2aade91d8216d7038279d0ac384a7ecd494bb29a2de36f62214368feed22c"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"addons/core/Scripts/Game/ERR/40_Chat/ERR_NativeRandomRadiusTrace.c": "7e946406067092e30b6b75cc6ef0c56db7f866249e02bd13648156933ee578d9",
|
||||
"fix.patch": "8563593edc554c61e5fc8b3921344780ed3769f8f8dc0c3ab5bb53e8806e7e9b"
|
||||
}
|
||||
Reference in New Issue
Block a user