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,6 @@
|
||||
<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-air-reference.json" CopyToOutputDirectory="PreserveNewest"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.Numerics;
|
||||
using System.Text.Json;
|
||||
using GamePort.Game;
|
||||
using var doc=JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"original-air-reference.json")));
|
||||
int inputs=0,applies=0;
|
||||
foreach(var c in doc.RootElement.GetProperty("cases").EnumerateArray())
|
||||
{
|
||||
var p=c.GetProperty("input").EnumerateArray().Select(x=>x.GetSingle()).ToArray();
|
||||
var o=c.GetProperty("observed").EnumerateArray().Select(x=>x.GetSingle()).ToArray();string name=c.GetProperty("name").GetString()!;
|
||||
if(c.GetProperty("kind").GetString()=="INPUT")
|
||||
{
|
||||
var result=JimmyAirMotion.Input(new(p[0],p[1],p[2]!=0),new(p[3]!=0,p[4]!=0,p[5]!=0,p[6]!=0,false),p[7]!=0,p[9],p[8]);
|
||||
Near(result.Speed,o[0],name+" speed");Near(result.TurnRate,o[1],name+" turn");Check(result.KeyboardTurn==(o[2]!=0),name+" keyboard latch");inputs++;
|
||||
}
|
||||
else
|
||||
{
|
||||
var result=JimmyAirMotion.Apply(p[0],p[7],new(p[4],p[5],p[6]),new(p[1],p[2],p[3]),p[9],p[8]);
|
||||
NearV(result.Velocity,new(o[0],o[1],o[2]),name+" velocity");NearV(result.Rotation,new(o[3],o[4],o[5]),name+" Euler");Near(result.AppliedTurnRate,o[6],name+" rate");applies++;
|
||||
}
|
||||
}
|
||||
Check(inputs==22&&applies==13,"complete original observations");
|
||||
Console.WriteLine("PASS22 copied-original airborne keyboard-input observations, including supported mode1, coast boundary and latch");
|
||||
Console.WriteLine("PASS13 copied-original air velocity/Euler observations, including zero velocity, pitch, seam and original vertical preservation");
|
||||
static void Check(bool ok,string name){if(!ok)throw new Exception(name);}
|
||||
static void Near(float a,float b,string name)=>Check(float.IsFinite(a)&&Math.Abs(a-b)<.005f,$"{name}: {a} != {b}");
|
||||
static void NearV(Vector3 a,Vector3 b,string name)=>Check(float.IsFinite(a.X+a.Y+a.Z)&&Vector3.Distance(a,b)<.04f,$"{name}: {a} != {b}");
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,510 @@
|
||||
{
|
||||
"source_sha256": "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8",
|
||||
"ranges": [
|
||||
{
|
||||
"va": "0x439900",
|
||||
"file_offset": "0x39900",
|
||||
"length": 1207,
|
||||
"sha256": "e6fd687cd797d004d9584bb7b6c004def933b9c496ef17a19a607be5c05e1236"
|
||||
},
|
||||
{
|
||||
"va": "0x437f90",
|
||||
"file_offset": "0x37f90",
|
||||
"length": 410,
|
||||
"sha256": "0d65625eea1015707e9d5001196c15a945cb93b14b03cd022d98687778c9846c"
|
||||
},
|
||||
{
|
||||
"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"
|
||||
}
|
||||
],
|
||||
"relocations": [
|
||||
{
|
||||
"va": 4431078,
|
||||
"target": 4772864
|
||||
},
|
||||
{
|
||||
"va": 4431266,
|
||||
"target": 4772868
|
||||
},
|
||||
{
|
||||
"va": 4430132,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430237,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430275,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430306,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430344,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430786,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430885,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430957,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430978,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4431009,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4430443,
|
||||
"target": 4774180
|
||||
},
|
||||
{
|
||||
"va": 4430202,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430495,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430608,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430738,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430805,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430939,
|
||||
"target": 4774216
|
||||
},
|
||||
{
|
||||
"va": 4430167,
|
||||
"target": 4774220
|
||||
},
|
||||
{
|
||||
"va": 4430845,
|
||||
"target": 4774220
|
||||
},
|
||||
{
|
||||
"va": 4430257,
|
||||
"target": 4774252
|
||||
},
|
||||
{
|
||||
"va": 4430326,
|
||||
"target": 4774252
|
||||
},
|
||||
{
|
||||
"va": 4430372,
|
||||
"target": 4774252
|
||||
},
|
||||
{
|
||||
"va": 4430396,
|
||||
"target": 4774252
|
||||
},
|
||||
{
|
||||
"va": 4430713,
|
||||
"target": 4838876
|
||||
},
|
||||
{
|
||||
"va": 4430512,
|
||||
"target": 4848340
|
||||
},
|
||||
{
|
||||
"va": 4431047,
|
||||
"target": 4865656
|
||||
},
|
||||
{
|
||||
"va": 4431235,
|
||||
"target": 4914472
|
||||
},
|
||||
{
|
||||
"va": 4431115,
|
||||
"target": 4914476
|
||||
},
|
||||
{
|
||||
"va": 4431162,
|
||||
"target": 4914476
|
||||
},
|
||||
{
|
||||
"va": 4430862,
|
||||
"target": 4914480
|
||||
},
|
||||
{
|
||||
"va": 4430149,
|
||||
"target": 5281885
|
||||
},
|
||||
{
|
||||
"va": 4430471,
|
||||
"target": 5281886
|
||||
},
|
||||
{
|
||||
"va": 4430594,
|
||||
"target": 5281886
|
||||
},
|
||||
{
|
||||
"va": 4430184,
|
||||
"target": 5281887
|
||||
},
|
||||
{
|
||||
"va": 4430831,
|
||||
"target": 5281888
|
||||
},
|
||||
{
|
||||
"va": 4430161,
|
||||
"target": 5282464
|
||||
},
|
||||
{
|
||||
"va": 4430196,
|
||||
"target": 5282464
|
||||
},
|
||||
{
|
||||
"va": 4430489,
|
||||
"target": 5282468
|
||||
},
|
||||
{
|
||||
"va": 4430602,
|
||||
"target": 5282468
|
||||
},
|
||||
{
|
||||
"va": 4430839,
|
||||
"target": 5282468
|
||||
},
|
||||
{
|
||||
"va": 4423800,
|
||||
"target": 4772108
|
||||
},
|
||||
{
|
||||
"va": 4423682,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4423741,
|
||||
"target": 4774180
|
||||
},
|
||||
{
|
||||
"va": 4423789,
|
||||
"target": 4777448
|
||||
},
|
||||
{
|
||||
"va": 4423753,
|
||||
"target": 4838840
|
||||
},
|
||||
{
|
||||
"va": 4662415,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4662490,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4662565,
|
||||
"target": 4774164
|
||||
},
|
||||
{
|
||||
"va": 4662455,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4662468,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4662530,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4662543,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4662613,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4662626,
|
||||
"target": 4777412
|
||||
},
|
||||
{
|
||||
"va": 4664145,
|
||||
"target": 4772108
|
||||
},
|
||||
{
|
||||
"va": 4664108,
|
||||
"target": 4777448
|
||||
},
|
||||
{
|
||||
"va": 4664119,
|
||||
"target": 4777448
|
||||
},
|
||||
{
|
||||
"va": 4664132,
|
||||
"target": 4777448
|
||||
}
|
||||
],
|
||||
"target_range": {
|
||||
"va": "0x439db7",
|
||||
"file_offset": "0x39db7",
|
||||
"length": 124,
|
||||
"sha256": "202e8ef05e362b5745f6a501d69aa840f06bd348df4c3377d72fc64d0b0e7310"
|
||||
},
|
||||
"scope": "Copied439900 through439E33; synthetic destination writer, actor/body/input and zero mouse; no camera, facing update, physics, game entrypoint or full trajectory.",
|
||||
"cases": [
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
-40.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
10.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
1.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
-40.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
45.0,
|
||||
-1.66666675,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
45.0,
|
||||
1.66666675,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
-40.0,
|
||||
45.0,
|
||||
-1.66666675,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
1.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
10.0,
|
||||
45.0,
|
||||
1.66666675,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
1.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
10.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
700.0,
|
||||
1.0,
|
||||
-40.0,
|
||||
10.0
|
||||
],
|
||||
"observed": [
|
||||
-40.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
0.0,
|
||||
0.0
|
||||
],
|
||||
"observed": [
|
||||
0.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
},
|
||||
{
|
||||
"input": [
|
||||
0.0,
|
||||
1.0,
|
||||
0.0,
|
||||
0.0,
|
||||
300.0,
|
||||
0.0,
|
||||
-13.0,
|
||||
7.0
|
||||
],
|
||||
"observed": [
|
||||
7.0,
|
||||
45.0,
|
||||
-0.0,
|
||||
1.0
|
||||
]
|
||||
}
|
||||
],
|
||||
"files": {
|
||||
"tools/binary/jimmy_air_targets.py": "393a30df077845f55f3ba6e9f93ecbf206a73cae5a77eee9ff7ba9d0c2db8bf7",
|
||||
"tools/binary/jimmy_air_targets_probe.c": "c63d98fb4a28c0e77da15a6c49dd8cc87ae5516358f35784ebc32957a7c02471",
|
||||
"tools/binary/jimmy_air_motion_probe.c": "4f825d33dcf161d2a119d06f288db384ecb2468d36c4ae8f668fbeacbfc8eb6e",
|
||||
"tools/binary/grappler_scalar_probe.c": "c51cc1ecefaf7a90e69a40624fd0e8cd7e01500359c4e67aee6213bb36f4a810",
|
||||
"artifacts/jimmy-air-targets/jimmy_air_targets_probe.exe": "c491683ae810d9d44fb31ed0fdab319016d9a3bea6654412737ecf1db10103ae",
|
||||
"artifacts/jimmy-air-targets/probe/wine.log": "1de345403a421435211e389d2b16c5f1b8bd9914a6de7eb2e6f75f4cb7cb08a2"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user