Match Jimmy controller arithmetic and facing to original probes
This commit is contained in:
1 parent
42ea2b8cd5
commit
0e2f426d42
60 files changed
+6027
-48
No files matched your search
@@ -0,0 +1,7 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup><OutputType>Exe</OutputType><TargetFramework>net10.0</TargetFramework><ImplicitUsings>enable</ImplicitUsings><Nullable>enable</Nullable><EnableDefaultCompileItems>false</EnableDefaultCompileItems></PropertyGroup>
|
||||
<ItemGroup><Compile Include="Program.cs"/><Compile Include="../../src/GamePort/Assets/*.cs"/>
|
||||
<Compile Include="../../src/GamePort/Game/*.cs"/>
|
||||
<None Include="original-ground-reference.json" CopyToOutputDirectory="PreserveNewest"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,29 @@
|
||||
using System.Numerics;
|
||||
using System.Text.Json;
|
||||
using GamePort.Game;
|
||||
using var document=JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"original-ground-reference.json")));
|
||||
int inputs=0,applies=0;
|
||||
foreach(var c in document.RootElement.GetProperty("cases").EnumerateArray())
|
||||
{
|
||||
var p=c.GetProperty("input").EnumerateArray().Select(v=>v.GetSingle()).ToArray();
|
||||
var o=c.GetProperty("observed").EnumerateArray().Select(v=>v.GetSingle()).ToArray();string name=c.GetProperty("name").GetString()!;
|
||||
if(c.GetProperty("kind").GetString()=="INPUT")
|
||||
{
|
||||
var r=JimmyGroundMotion.Input(new(p[0],0,p[6],p[7]!=0),p[5],new(p[1]!=0,p[2]!=0,p[3]!=0,p[4]!=0,false));
|
||||
Near(r.State.Speed,o[0],name+" scalar");Near(r.Lateral,o[1],name+" side");Near(r.State.TargetYaw,o[2],name+" heading");
|
||||
Check(r.State.AutoTurning==(o[3]!=0),name+" latch");inputs++;
|
||||
}
|
||||
else
|
||||
{
|
||||
var r=JimmyGroundMotion.Apply(p[0],new(p[1],p[2],p[3]),new(p[4],p[5],p[6]),p[7],p[8],p[9]!=0,p[10]!=0,p[11]);
|
||||
Near(r.Velocity.X,o[0],name+" X");Near(r.Velocity.Y,o[1],name+" Y");Near(r.Velocity.Z,o[2],name+" Z");Near(r.Rotation.Y,o[3],name+" yaw");applies++;
|
||||
}
|
||||
}
|
||||
Check(inputs==17&&applies==8,"complete25 native observations");Console.WriteLine("PASS17 original ground-input observations and8 ground-apply observations");
|
||||
var active=JimmyGroundMotion.Input(new(100,130),90,new(true,false,false,false,false));Check(active.State.TargetYaw==90,"active forward stops previous destination-yaw drift");
|
||||
var idle=JimmyGroundMotion.Input(new(100,130),90,default);Check(idle.State.TargetYaw==130,"idle retains prior destination yaw");
|
||||
var fire=JimmyGroundMotion.Input(new(100,90),90,new(false,true,false,false,false,Fire:true),blockBackward:true);
|
||||
Check(fire.State.Speed==65&&!fire.HeadingUpdated,"source parent fire acceptance gate suppresses backward");
|
||||
Console.WriteLine("PASS heading publication and caller-owned backward/fire gate");
|
||||
static void Check(bool condition,string name){if(!condition)throw new Exception(name);}
|
||||
static void Near(float value,float expected,string name)=>Check(float.IsFinite(value)&&Math.Abs(value-expected)<.02f,$"{name}: {value} != {expected}");
|
||||
@@ -0,0 +1,584 @@
|
||||
{
|
||||
"source_sha256": "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8",
|
||||
"ranges": [
|
||||
{
|
||||
"va": "0x43915d",
|
||||
"file_offset": "0x3915d",
|
||||
"length": 1138,
|
||||
"sha256": "5d59e3d539ed3cd160bbbe5f49c03b2bd7085167fecfc9319aa1a73d98422bad"
|
||||
},
|
||||
{
|
||||
"va": "0x437c40",
|
||||
"file_offset": "0x37c40",
|
||||
"length": 831,
|
||||
"sha256": "d61d6696fe5ca9ae955fb8c4a5ed551582e709ce914b7e25e26c7fe5721630b6"
|
||||
},
|
||||
{
|
||||
"va": "0x4723f0",
|
||||
"file_offset": "0x723f0",
|
||||
"length": 48,
|
||||
"sha256": "ae10074b5ae2ff3d2d2ce8c16358476acdba2f2a166be8ad5c9f05e3f55ffc23"
|
||||
},
|
||||
{
|
||||
"va": "0x472480",
|
||||
"file_offset": "0x72480",
|
||||
"length": 240,
|
||||
"sha256": "406c3904538abe07d88ca440e39ca56c00765d0871943991ba7b792da4803c16"
|
||||
},
|
||||
{
|
||||
"va": "0x472b10",
|
||||
"file_offset": "0x72b10",
|
||||
"length": 256,
|
||||
"sha256": "ee9516aef07738fcf7da370af74185f7522686759218ad1bf4d93be46f0c28b2"
|
||||
},
|
||||
{
|
||||
"va": "0x476ff0",
|
||||
"file_offset": "0x76ff0",
|
||||
"length": 1184,
|
||||
"sha256": "fb184f561d9aace113da3a8bff9dd2d2effceb9233507aeb1018b5cbde82cb94"
|
||||
}
|
||||
],
|
||||
"scope": "Copied43915D keyboard suffix and complete437C40, synthetic actor/body/support/animations and original OMT vector/trig. No input prefix/camera/game entrypoint; back-timer values are explicit test inputs.",
|
||||
"files": {
|
||||
"tools/binary/jimmy_ground_motion.py": "24ac3673c567f3c2d1cb2010a7cffa2ec4feb600144ffc739a52e8eba9124ed1",
|
||||
"tools/binary/jimmy_ground_motion_probe.c": "9d331a791e5a52ccf03cd566abb44b211a978d47903f3a428ccd1ad44e3e55ee",
|
||||
"tools/binary/grappler_scalar_probe.c": "c51cc1ecefaf7a90e69a40624fd0e8cd7e01500359c4e67aee6213bb36f4a810",
|
||||
"artifacts/jimmy-ground-audit/jimmy_ground_motion_probe.exe": "04eb9135202420d6c6639f060fa3d1272c6e4bf4ee336de7c4a2f6d916d54f94",
|
||||
"artifacts/jimmy-ground-audit/probe/wine.log": "2f4aa1d3050629214257012e213682de585a6d7a2db82becffb276cf188ee3ad"
|
||||
},
|
||||
"cases": [
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "up",
|
||||
"input": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
30.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "left",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
-1000.0,
|
||||
110.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "right",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
1000.0,
|
||||
70.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "upleft",
|
||||
"input": [
|
||||
100.0,
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
160.0,
|
||||
-1000.0,
|
||||
100.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "upright",
|
||||
"input": [
|
||||
100.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
160.0,
|
||||
1000.0,
|
||||
80.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "bothturn",
|
||||
"input": [
|
||||
100.0,
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
160.0,
|
||||
-1000.0,
|
||||
100.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "back",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
-52.5,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "all",
|
||||
"input": [
|
||||
100.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
1.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
107.5,
|
||||
-1000.0,
|
||||
100.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "release",
|
||||
"input": [
|
||||
100.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
65.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "negative",
|
||||
"input": [
|
||||
-20.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "cross",
|
||||
"input": [
|
||||
20.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "overcap",
|
||||
"input": [
|
||||
700.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
700.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "turnovercap",
|
||||
"input": [
|
||||
700.0,
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
700.0,
|
||||
-1000.0,
|
||||
100.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "backcap",
|
||||
"input": [
|
||||
-299.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
-300.0,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "backequal",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
1.5,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
-52.5,
|
||||
0.0,
|
||||
90.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "backturn",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
90.0,
|
||||
1.50999999,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
600.0,
|
||||
0.0,
|
||||
270.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "INPUT",
|
||||
"name": "latched",
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
0.0,
|
||||
90.0,
|
||||
2.0,
|
||||
1.0
|
||||
],
|
||||
"observed": [
|
||||
600.0,
|
||||
-1000.0,
|
||||
80.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "rest",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "stationaryturn",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
20.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "side",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
-1000.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
-100.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "turn",
|
||||
"input": [
|
||||
300.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
20.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
-7.80225086,
|
||||
0.0,
|
||||
299.9104,
|
||||
2.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "tilt",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
13.0,
|
||||
1.0,
|
||||
30.0,
|
||||
45.0,
|
||||
20.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
-183.725281,
|
||||
13.0,
|
||||
183.725281,
|
||||
45.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "ground",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
13.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
1.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
-237.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "ground_nopoly",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
13.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
13.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"kind": "APPLY",
|
||||
"name": "fall",
|
||||
"input": [
|
||||
300.0,
|
||||
0.0,
|
||||
-13.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.100000001
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
-13.0,
|
||||
300.0,
|
||||
0.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"dll_sha256": "3ec41ead011adf56387a6dbd4580e5b5a9721b5f8020c8a56420f42824354943"
|
||||
}
|
||||
Reference in new issue
Block a user