Match Jimmy controller arithmetic and facing to original probes

This commit is contained in:
UnixNight committed 2026-11-05 09:47:28 -05:00
1 parent 42ea2b8cd5
commit 0e2f426d42
60 files changed
+6027 -48

No files matched your search

+13 -4
View File
@@ -35,10 +35,19 @@ other agents' active changes. Keep updates concise, save detailed evidence to di
Use bounded endian-aware parsers, portable paths, clear C#, deterministic tests,
and explicit unmanaged ownership. Build frequently. Update `docs/progress.md`,
`docs/tasks.md`, `docs/decisions.md`, and compatibility evidence before transitions.
Current mode is user-requested gameplay/gadget implementation. On2026-10-27 the
user parked collision recovery and requested gadgets. This overrides the earlier
feature-expansion pause; retain evidence before gameplay assumptions. Preserve
the35a2a66 body milestone/0272f7b release notes and remaining C4/C5 gates for return.
Current priority (2026-11-05): user pauses gadget expansion and returns to Jimmy
movement stabilization. Preserve current movement as baseline; do not substitute
JN-Engine native/Godot movement. Use its original decompiler index only as leads,
verified with REA/authoritative originals. See docs/gameplay/jimmy-movement-stabilization.md.
The prior collision work is resumed where needed for movement; preserve the
35a2a66/0272f7b checkpoints and their source gates before broader body admission.
Controller checkpoint integrates108 native ground/air/facing/jump comparisons;
13 Jimmy source guards,26 movement/20 body groups and all five native SDL jump
aliases pass. Source pressure requires a real support polygon; lab/outside keep
capsule compatibility. Next: ordinary air destination Euler plus the actor-root
render bridge, then special/root-changing/dynamic contracts.27 contact-dispatch
and12 air-target observations are evidence, not live implementation claims.
No Remote/new-gadget implementation until this movement priority is handled.
The initial architecture checkpoint is documented in docs/checkpoint/review.md; use the playable
69d0187 baseline as a comparison tool. Read
docs/checkpoint/README.md, coverage.md and implementation-plan.md before gameplay
+5 -1
View File
@@ -5,7 +5,11 @@ using C#/.NET 10, Silk.NET.Vulkan (Vulkan 1.3), and SDL3. Original files remain
untouched in `../Original`. Work is local; no remote operations or runtime online
services are used.
**Current direction: gameplay gadgets; collision recovery is parked.** The
**Current direction: stabilize Jimmy movement before more gadgets.** Keep our
playable movement baseline; JN-Engine's original decompiler index supplies leads,
verified with REA and authoritative component probes. The
[movement checkpoint](docs/gameplay/jimmy-movement-stabilization.md) records
controller/facing/jump corrections and remaining render/body gates. The
[checkpoint review](docs/checkpoint/review.md), [coverage map](docs/checkpoint/coverage.md)
and [implementation plan](docs/checkpoint/implementation-plan.md) compare source
owners, update order and lifecycles with the port. Clean69d0187 and its packages
+9
View File
@@ -113,6 +113,15 @@ speed/yaw/impulse/airborne/camera formulas. `FixedStepClock` supplies a delibera
unverified. SDL events feed held keyboard/mouse state; focus/minimize clear input
and pause simulation, while C pauses for inspection and R resets the start area.
The Jimmy movement checkpoint uses `JimmyGroundMotion`/`JimmyAirMotion` for
source input and velocity publication, `JimmyOrientation` in the base phase
before control gating, and `JetpackBurst` for the controller/effect state tables.
Keyboard-turn latch and destination Euler are retained independently of current
Euler. Ground pressure requires a real source-body support polygon; the capsule
does not manufacture one. Ordinary air destination pitch and the complete
actor-root render bridge remain a paired implementation gate. See
[movement stabilization](gameplay/jimmy-movement-stabilization.md).
`SceneCollision` sweeps/slides a vertical capsule against retained original scene
triangles, including invisible proxies, and clips the chase camera with a sphere
sweep. Solver/masks/radius/pivot are explicit approximations. The physical position
+8
View File
@@ -10,6 +10,14 @@ Address details/PE offsets and source-byte extractors are in the linked reports.
**M**=managed port regression, **R**=port runtime. No row has full original-game
runtime comparison. Coverage does not mean implementation completeness.
2026-11-05 movement continuation: [Jimmy stabilization](../gameplay/jimmy-movement-stabilization.md)
supersedes MOVE/JET arithmetic details below. Ground, air and control-independent
full-axis facing now have108 native component comparisons including the jump
suffix. COLL keeps its admission gate: real support polygon pressure is live in
the source body, while lab/outside retain capsule compatibility.27 special
contact dispatch and12 air-target observations expose remaining gates; they do
not certify special callbacks or the ordinary air-pitch visual bridge.
| ID / system | Recovered contract / anchors | Port implementation | Evidence / remaining gap | Next bounded action |
|---|---|---|---|---|
| LOOP | Viewport47E4F0 physics before registry473740, including input44DF80; second sync473770; construction order and selective retained-character/new-game ordering. Separate engine morph clock. | Player now integrates prior body state, then fresh input/player/fire or retained player/fire/input. Uncontrolled body/fire now continue while movement/input are gated. Other systems remain grouped; fixed60Hz policy. | S/M/R. Controlled player partial order implemented; bounded raw-owner preparation implemented; full wrapper/registry/cadence open. | C3 continue other callbacks and morph/control phases; C4 support/response remains separate. |
+130
View File
@@ -0,0 +1,130 @@
# Jimmy special contacts: movement-stability audit
2026-11-04. Static recovery plus27 isolated original-dispatch observations; no
runtime solver change. Current playable fccc0b9 remains the baseline. The user
returned priority to Jimmy movement and explicitly allowed JN-Engine as a guide.
JN-Engine's prototype movement is not imported or treated as an oracle.
## Result and immediate implementation boundary
The lab/outside capsule bypasses material callbacks entirely: SceneCollision's
private triangles retain geometric positions/normals but no linked material ID,
and LabSimulation.StepPhysics receives only grounded/wall/ceiling flags. This is
a concrete missing interaction layer, not evidence that changing walk constants
or adding universal wall reflection will fix collision fidelity.
**Do not globally admit lab/outside to OriginalBodyPhysics yet.** Besides dynamic
pairs, three directly evidenced contracts are missing: material-driven hazard/
climb actions, world-response1D0 state during special animation, and contact-owned
root publication. The existing ordinary sphere composition assumes no
root-changing callbacks. Its wallContact hook alone does not establish the
source's fresh previous/live Vec4 equality or special-animation lifecycle.
For example, it currently adds the old falling displacement.Y after the hook
returns a root, whereas the original can skip that entire candidate publication
when the contact changed live/previous root. A root-changing callback cannot be
made faithful simply by returning a different OrdinaryBodyState.Position.
The smallest safe movement implementation chunk is ordinary ground/air arithmetic
and phase stability while preserving the current route solver. For collision:
first preserve/report actual contacted shape/polygon/3DMa identity in a diagnostic
path; next implement the state-owning callbacks and source body modes with
regressions; only then enable a bounded real lab/outside source-body route. Do not
silently classify a special contact as ordinary to make scene admission succeed.
## Original identity and source map
Neutron.exe SHA256:
f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8.
Every code VA below maps to raw offset VA−400000, independently checked by PE.
`tools/binary/jimmy_special_contact.py` records five bounded spans with hashes,
raw offsets and four live virtual bindings. Existing material loader/source
coverage is in collision-contact-callbacks.md and its guarded helper.
| Code VA / raw offset | Observed contract |
|---|---|
|43AA40 /3AA40|Player contact handler takes **game interface** (Jimmy complete+C0), supplied Vec4 normal and polygon. First requires elapsed game774>3; missing polygon/material/chunk yields no special policy. Reads signed archive3DMa ID through polygon+4→material+C→chunk+8.|
|43AA7E..43AAD5 /3AA7E..3AAD5|IDs120..129 call **complete virtual160**, IDs110..119 call **complete164**. These dispatches precede the movement-mode check and therefore still occur in nonzero modes.160/164 are slot offsets, not material IDs.|
|43AAD5..43AAF9 /3AAD5..3AAF9|Fence IDs60..69 and ladder180 require mode game704==0. Other metadata returns without generic reflection/projection. The handler contains no raw controlled-pointer gate.|
|43AB17..43ABBF /3AB17..3ABBF|Ladder first requires game338→472570 retained support polygon pointer (live234), then a47C210 probe. This is not the same predicate as current grounded218. A missing retained polygon prevents even the ray attempt.|
|43ACD4..43AE19 /3ACD4..3AE19|Fence requires first probe to miss and subsequent side probes to hit. Miss-only synthetic probes make exactly two calls then reject. Different ray outcome sequences are not equivalent to a single wall hit.|
|43AC29..43ACC5 /3AC29..3ACC5;43AF54..43AFDB /3AF54..3AFDB|Successful branches derive yaw from negative supplied normal through original angles, set destination/live orientation, transform local offsets, publish root314 and request LADDER/FENCE through complete150. Full successful-ray traces remain unexecuted.|
|42A7E0 /2A7E0|Jimmy complete160 requires splat cooldown1E60<=0 and !1DED latch. Requests SPLAT via150, sets latch, clears impact clock1DE8 and controller scalar complete6C8/game608, stores supplied normal at1DF0..1DFC, requests−5 energy/score through42A920/42ADC0, and SFX37. Those helpers retain their own tutorial/global policies.|
|42A8D0 /2A8D0|Jimmy complete164 requires !1DEC latch and raw gadget4F0588!=0 (Bubble0 immunity). Sets latch, clears1DE8, requests−5 energy/score, calls complete1E0→425120 (mode1 jump/effect cancellation). It does not share160's cooldown gate.|
|437953..43796A /37953..3796A|Increment game774 elapsed **before** base40E050 and later raw ownership gate. Physics contact reads the preceding phase's elapsed. Omitting this timer would permanently suppress source policies; gating it only on Jimmy input is also wrong.|
|43B408..43B4B4 /3B408..3B4B4;43B4BE..43B58A /3B4BE..3B58A|FENCE/LADDER animation entry owns saved destination Vec4 complete838..844/game778..784. Respective local offsets(0,320,150)/(0,800,150), velocity0, gameA8(false), action helper148, global busy4F83E0=true, duration complete888=4/6, fallback timer868=5, elapsed834=0, nonloop animation and SFX146/143.|
|43A900 /3A900|AnimEnded handler returns FENCE/LADDER to STOP, clears busy/duration, calls Jimmy game410→42AFC0, clears action flag complete6E4/game624 and controller speed complete6C8/game608, restores saved full Vec4 root314, then gameA8(true). SPLAT/HIT branches differ.|
|437988..437A15 /37988..37A15|Fallback timer game7A8 is decremented before input ownership gate. Expiry while busy can restore the saved root/response state too. Source duration4/6 and fallback5 are distinct; do not invent one universal fixed climb timer.|
|47A123..47A1C4 /7A123..7A1C4|Body publication rereads previous2F8/live310 and compares all four components. A contact-owned root change skips candidate clamp/publication. Vector3-only stale equality is not this boundary.|
Bindings independently checked: Jimmy complete4A3BDC+160→42A7E0,+164→42A8D0;
Jimmy game4A373C+374→42A660→Player43AA40; Player game4AF6C4+374→43AA40.
Game338→472570 returns retained polygon234, not a boolean grounded query.
GameA8→470FD0 changes **world-response** getter1D0/live13C. It does not disable
integration210, support1C8, raw control118 or global geometry4F69E5. Consequently
`geometryEnabled=false` in the current managed body is not an implementation of
this transition: that parameter follows global geometry-off gravity cancellation.
The pose setter's exact callback acceptance, source morph/event cadence, impact
latch/impulse updater4255C0, successful ladder/fence ray offsets/filters and reset
interactions need component/runtime closure before actual mechanics are enabled.
The stored impact normal is consumed later; immediate arbitrary velocity reflection
would replace that state machine with a different behavior.
## REA and JN-Engine evidence
JN-Engine docs/decomp/C3DPlayer.md, C3DJimmy.md and original decompiler bodies
in docs/decomp/evidence/c3dplayer_movement_target3.md/c3djimmy_target6.md supplied
function/field leads. Shared EXE identity is verified; its prototype movement and
its different declared OMT2.dll build are not numeric/runtime authorities here.
Class reports mix game and complete bases in places; the offsets above follow
authoritative instructions and the independently established+C0 interface.
Configured REA/Ghidra12.1.4 batch at artifacts/jimmy-special-contact/rea used the
existing generated target copy and exported Evidence/closed snapshot:
- 42A7E0: ev_801bbf1e21eb341f126f5e57e3efbfca42bb1c799680b2429c7f05dfdda3d625.
- 42A8D0: ev_889e1c63d50f8e6da7e451ba0b821396f884fb7d7961dcdede3c4f3ca0e54af3.
- 43A900: ev_0c030c12f6beb0790a6be2c53d3c4ac6591c8c2bd6552e8ea888f8de13455c7f.
43AFF0 returned an explicit procedure-recognition error; retained reply03.json
is not successful decompilation and the unchanged selector was not repeated.
Its supporting instruction extract is saved as special-animation.asm; the JN
body is only a lead. Reused43AA40 Evidence:
ev_4f2a6aa666451db831efd46f5c587573e22d8072315626b8bc2f844f9c6f0cae
under artifacts/collision-integration/contacts/rea-callbacks. REA x87/return-address
aliases are imperfect; reviewed call signatures/bytes settle the normal payload.
## Isolated original execution and tests
The new generated probe executes copied43AA40 with synthetic game/complete
vtables, linked polygon/material/chunk records, no-op160/164 callbacks and a
miss-only ray stub. It **does not** execute real damage, successful climb,
animation, body integration, collision traversal or the original game entrypoint.
An initialized local Wine32 prefix runs the copied code in the project's separate
network/filesystem sandbox; Wine exit0 and JIMMY_SPECIAL_CONTACT_COMPLETE are
retained in artifacts/jimmy-special-contact/probe/{wine.log,capture.json}.
27 observations cover signed metadata and all dispatch boundaries, strict elapsed
3/above3, nonzero movement modes, null polygon/material/chunk, missing retained
support polygon, and both hazard dispatch/fence ray attempts with raw controlNULL.
Normal Vec4 reaches160 unchanged. Miss-only fence performs two probes; ladder one
when support pointer exists. These are branch/gate observations, not terrain
success or original end-to-end movement traces.
`tests/test_jimmy_special_contact.py` commits the observations, original source
span/binding identity and generator/harness/executable/log hashes. Four Python
groups pass: source/offset/bindings, all27 native dispatch cases, provenance, and
output/original/symlink isolation. Originals remain untouched. No runtime source
or existing tests/docs were modified by this investigator; no commit was made.
## Proposed continuation gates
1. Keep source-backed controller/air/jump fixes and current playable route solver
independent; preserve fccc0b9 and subsequent tested movement checkpoints.
2. Expose contact metadata/root-ownership diagnostics; recover4255C0 impact latch
and impulse completion, then implement material120..129's bounded hazard flow.
3. Recover/verify successful climb rays, full animation-end/fallback ownership and
independent world-response mode before adopting fence/ladder callbacks.
4. Complete dynamic pair eligibility/shared context and Vec4 publication, then
run input-only lab/tutorial/RETURN/outside cases with known special contacts.
General floor/step/wall fidelity is not established by these27 leaf probes.
+12
View File
@@ -1,5 +1,17 @@
# Compatibility and validation
Jimmy movement (2026-11-05):108 copied-original ground/air/facing/jump observations
match managed components.26 integrated movement/20 body groups pass; lab and
two-way underground routes retain the user's baseline. Native Linux walking and
VR04 powered input replays pass all five jump aliases and resize, with identical
readbacks across aliases and zero Vulkan validation errors. Carl control lock,
control-independent body/fire and Grappler native replays pass. Source pressure
is restricted to real source support; the lab/outside capsule keeps compatibility
behavior. Ordinary air pitch/full root rendering and special/dynamic contacts
remain open, as do complete original and native Windows comparison. Details and
provenance: [Jimmy stabilization](gameplay/jimmy-movement-stabilization.md).
Scooter feedback follow-up (2026-11-04): missing Goddard follow pitch/roll leveling
and source positional engine-frequency correction are implemented.13 Scooter/2
ScooterAudio/10 Patrol groups,24 targeted Python checks, route/audio regressions
+11
View File
@@ -308,3 +308,14 @@
then apply recovered47D9D0 positional frequency/history and DX bounds.
Use shared listener state for mounted/parked/script cameras; global audio
cadence and attenuation remain separate. See the focused gameplay reports.
48. **Stabilize Jimmy from authoritative components while preserving the playable baseline.**
Use JN's original decompiler index as leads only. Integrate source ground/air
input, velocity, full-axis base facing and precise jump hold/gravity after
copied-original comparison. Preserve retained targets and keyboard-turn latch;
facing runs without raw input ownership. Require real support polygon338 for
downward ground pressure; do not translate capsule Grounded into that state.
The failed stair route and successful compatibility rerun are retained evidence.
Keep ordinary air pitch/actor-root visual bridge together as the next chunk,
and special/root-changing/dynamic body behavior behind independent gates.
See gameplay/jimmy-movement-stabilization.md.
+131
View File
@@ -0,0 +1,131 @@
# Jimmy ordinary airborne movement audit
2026-11-04. User prioritizes stable Jimmy movement and explicitly preserves the
current GamePort feel over JN-Engine's replacement movement. JN-Engine's saved
original decompiler output was used only to locate/interpret original routines;
its C/Godot movement was not used as a behavioral reference. Authoritative source
is the immutable project EXE SHA256
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
## Recovered contracts and concrete mismatches
Addresses below are original EXE VAs; independently mapped file offsets equal
VA−400000. `tools/binary/jimmy_air_motion.py` guards source identity, five complete
bounded ranges and decoded absolute relocation operands. Source instruction
extracts are retained in artifacts/jimmy-air-audit/{input,apply}.asm.
| Original VA / offset | Original behavior | Prior port mismatch / bounded correction |
|---|---|---|
|439900..439A69 /39900..39A69|Mode1 keyboard Left precedes Right, changes stored turn by100dt; no-key return toward0 occurs only when complete6E6 keyboard-turn latch is set. Key turning sets latch; mouse turning clears it.|AirSteering always applied return, without storing the latch. JimmyAirMotion.Input owns explicit latch state; caller must retain it and share it with other input modes.|
|439AE6..439B69 /39AE6..39B69|Up adds30 only when scalar<maximum, then clamps. Existing overspeed is preserved.|RecoveredMotion.AddSpeed clamped overspeed down to maximum. New helper preserves it. Ground correction is investigated separately.|
|439B69..439BA2 /39B69..39BA2|Without throttle, coast only above maximum*float.909090936; compare uses the unrounded x87 product. Coast subtracts17.5 per callback.|Float-rounded C# comparison misses a representable threshold case. At max600, speed545.45459 must coast to527.95459. New helper uses double intermediate for the comparison.|
|439BA2..439BED /39BA2..39BED|Independently test body218 support, even with stored air mode1. Supported positive scalar subtracts17.5 with no crossing clamp; nonpositive scalar resets0.|Old AirSteering had no support argument. Supported speed300+Up ends312.5; speed5 with no keys ends−12.5. These affect landing/rejump and retained input phases.|
|439C1D..439CB2 /39C1D..39CB2|Down after throttle/coast/support subtracts35 supported or17.5 airborne, clamps positive scalar to0; negative scalar adds35 toward0.|Old helper used17.5 for positive scalar regardless support. No reverse-flight initiation is added.|
|439D81..439DB7 /39D81..39DB7|Ordinary mode1 turn caps±30, distinct from Bubble's±50.|Existing cap is correct and retained.|
|437FD0..438011 /37FD0..38011|Read incoming live velocity. Exact zero magnitude skips independent yaw AND lateral computation. It still publishes forward scalar afterward.|LabSimulation gated yaw but computed side unconditionally. Zero incoming velocity/scalar300/turn30 produces(0,0,300), not a lateral launch.|
|438011..438062 /38011..38062|For nonzero velocity, call334 AddEuler(0,turn*dt,0), then side=turn*float(1/55)*(1−friction)*scalar, without dt on side.|Existing side formula is generally right but ungated. Plain yaw modulo omitted full-axis AddEuler normalization. New helper reuses original-leaf-compatible RocketOrientation.Add.|
|438062..4380E6 /38062..380E6|Rotate the lateral contribution around current yaw using original OMT table values.|Retain yaw-only lateral contribution. No invented normalization or clamp.|
|4380E6..438124 /380E6..38124|game38C rotates local(0,0,scalar) by full Euler. Sum its X/Z with lateral contribution and preserve incoming Vy, discarding rotated forwardY.|Old port used flat yaw only. Nonzero pitch must scale horizontal forward; roll does not alter this local-forward vector. Use original-compatible rotate/lookup helper.|
The probe complete-object fields are6C8 scalar,6D4 turn,6D8 applied turn,
6BC acceleration step30,6C0 decay35,6C4 maximum600,6E4/6E5 throttle/backward,
6E6 keyboard-turn latch,7C4 movement mode1. Its game interface is complete+C0.
Game Euler is224/228/22C; getVelocity2BC/setVelocity2C4, friction248, support218,
getEuler328, AddEuler334, local-vector transform38C are separate calls. Synthetic
probe binds the last three to original4723F0/472480/472B10. Real class wrapper
334 may add gameplay gates; source publication/controller ownership remain caller
responsibilities and are not reconstructed by this isolated component.
Keyboard steering and scalar increments retain current signs, precedence, source
per-callback30/17.5/35 values and mode1 turn cap. Existing ordinary flat-air
movement with nonzero incoming velocity is preserved. None of these corrections
adopts JN-Engine's tuned jump650/gravity1600 or instant tank movement.
## Native observations and REA
`tests/GamePort.JimmyAirTests/original-air-reference.json` commits35 copied-original
observations and source/generator/shared-map-helper/probe-EXE/output-log hashes:
22 mode1 keyboard input cases and13 velocity-prefix cases. Coverage includes
Up/Down combinations, overspeed, exact coast boundary, supported positive/negative
crossings, turn cap/precedence/latch/return crossing,60Hz, zero/rising/falling live
velocity, slope pitch, roll, Euler seam/negative angle normalization, friction0,
reverse scalar, zero scalar and ordinary60Hz output.
Probe executes copied439900 through439DB7 (before orientation/camera work) and
complete-entry437F90 through438124 (before jump suffix). It supplies synthetic
actor/body/friction/mouse callbacks and uses the copied project's original OMT
trig global plus original Euler helpers. Zero mouse/controller input is explicit.
439900's continuation is replaced by a stack-correct return, and437F90's suffix
is replaced by its original4387A1 epilogue. No original game entrypoint, physics,
collision, camera, animation or audio is executed. Source jump suffix438148 and
effect421FB0 are independent parent investigations.
The isolated Wine32 run exits0 and prints JIMMY_AIR_MOTION_COMPLETE; capture.json
and wine.log are retained in artifacts/jimmy-air-audit/probe. Thirty-five saved
outputs match two managed conformance groups. Two Python groups guard source,
relocations, PE offsets, complete fixture counts and generator provenance. This
is original component execution, not whole-original or native Windows gameplay.
REA/Ghidra12.1.4 was invoked through the configured local scripts/rea.sh on the
generated target copy. The default profile did not recognize439900 as a procedure;
the complete explicit mapped-selector failure, export and closed snapshot are
retained under artifacts/jimmy-air-audit/rea-input. No pseudocode success or
Evidence ID is attributed to that failure, and the unchanged selector was not
repeated. Earlier Bubble movement attempts had provider startup failures and do
not establish successful decompilation either. Supporting source instructions,
whole-source identity and new native observations establish the bounded arithmetic.
JN's docs/decomp/evidence/c3dplayer_movement_target3.md supplied an original-code
reading lead, independently checked against these project originals.
## Integration API and remaining limits
New `JimmyAirMotion` is an isolated source-backed implementation. Parent owns live
integration and existing AirSteering/LabSimulation files:
1. Pass Input(new(Speed,TurnRate,keyboardTurnLatch),input,Grounded,dt,MaximumSpeed).
Retain returned scalar, rate and latch. Complete6E6 is shared with ground and
Bubble input: update it when those source paths set it; do not reset each frame.
2. Call Apply(Speed,TurnRate,new(Pitch,Yaw,Roll),Velocity,dt,friction) in the ordinary
air branch, after existing facing/mode selection and before438148 jump suffix.
Publish returned full Euler and velocity. The incoming velocity gate must use
prior live velocity, not a newly fabricated forward vector.
3. Keep body-first/fresh-vs-retained order, ordinary landing/reset, jump/jetpack
state/effect, raw/effective control and special modes in their existing owners.
This does not implement mouse/controller axes, general camera/pose targets,
reverse-run helper states, complete full-Euler/render root behavior, original
cadence, dynamic/special contacts or the jump state suffix. Fixed60Hz and source
body vs capsule admission remain existing port policies. Ordinary input requires
0<dt<1 because the original divides mouse deltas by dt. Native Windows and
whole-original movement/trajectory comparison remain unverified.
## Destination-Euler follow-up (2026-11-05)
REA's complete retained objdump Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`
adds the next target write. 439DB7..439E33 (offset39DB7;
range end39E33) reads accepted forward6E4 before backward6E5, writes pitch7EC
or7F0, yaw=currentEulerY and roll=−turn. Neutral pitch is0. Constructor437445/
43744F (offset37445/3744F) initializes7EC=−40,7F0=10; ordinary437FBC/437FC6
reasserts those values. Bubble43880A/438814 substitutes−10/10. These are
retained controller fields, separate from current Euler and destination Euler.
`tools/binary/jimmy_air_targets.py` extends the previous input probe through
439E33, supplying a synthetic36C destination writer. Twelve native observations
are retained in `tests/GamePort.JimmyAirTests/original-air-targets-reference.json`,
including both arrows (Up wins), turn signs, supported zero/overspeed, zero and
custom pitch seeds. Isolated capture exits0 with JIMMY_AIR_TARGETS_COMPLETE;
source range, generator, executable and output hashes are recorded. No camera,
facing interpolation, body or original whole-game entrypoint ran. A Python guard
checks source/provenance and saved writes; this is recovery evidence, not a
managed/runtime implementation claim.
Live ordinary-air pitch targets are deliberately still the baseline simplification.
The source-backed input/velocity helper is integrated, but enabling this target
requires the full Euler/actor-root visual bridge and retained mode-field ownership
to move together. Otherwise horizontal velocity would gain pitch attenuation
while the ordinary rendered Jimmy remains upright. Follow-up must retain source
7EC/7F0 across Bubble→ordinary and fresh/retained callback order, then verify
model pivot, takeoff, turning, landing and route returns. This is an identified
original mismatch, not a recovered behavior that is already live.
+99
View File
@@ -0,0 +1,99 @@
# Jimmy ordinary ground movement audit
2026-11-04. User paused gadget expansion to stabilize Jimmy. Preserve the current
playable fccc0b9 baseline. This report isolates original keyboard ground input
and ground velocity apply; it does not replace collision, timing or animation.
The supplied JN-Engine C3DPlayer report/target3 decompiler dump supplied function
names/field leads only. Its tuned/native gameplay is not used as an oracle.
## Original evidence and ownership
EXE SHA256 `f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`;
OMT2.dll `3ec41ead011adf56387a6dbd4580e5b5a9721b5f8020c8a56420f42824354943`.
`jimmy_ground_motion.py` validates both identities and six bounded ranges, with
PE-mapped offsets and hashes. The listed EXE text offsets are VA−400000.
REA/GNU objdump produced source observation
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`.
Complete Evidence is under artifacts/jimmy-ground-audit/rea-disassembly.json;
summary projection `ev_eeefcf5542ee0c3151932829c0e898696754a264ac7fccb208fa26cceb36f0c0`
is in rea-summary.json. The command completed, output was not truncated, and
pre/post source digests match. The provider's executable-version/format metadata
is unknown; the independent PE reader establishes the image mapping. This is
static instruction evidence, not successful Ghidra pseudocode or target execution.
Previously failed unchanged procedure selectors were not repeated.
| Source VA / offset | Owner and contract |
|---|---|
|438BC0 /38BC0;438CE3 /38CE3|Ground input clears complete6E4 accepted forward/back flag. Mouse/side-camera/idle prefix is outside the pure keyboard suffix.|
|43915D..43928D /3915D..3928D|Clear870 keyboard lateral bias. Left precedes Right. Left adds20 yaw delta and−1000 lateral, Right−20/+1000. Set6E6 keyboard-turn latch. Add30 to6C8 only when below6C4 cap, then clamp an actual crossing.|
|43928D..439318 /3928D..39318|Up halves nonzero keyboard yaw delta and applies a second below-cap30 increment. Sets6E4. Up+turn can therefore increment twice. Existing overspeed is preserved, not clamped down.|
|438F66..438FE3 /38F66..38FE3|Earlier backward-acceptance gate uses Down/analog/side qualifications. In raw−1/3, true primary predicate15C suppresses accepted backward. Flags864/828 also qualify acceptance. This prefix is caller-owned, not part of the suffix probe.|
|439318..439416 /39318..39416|Accepted backward850 sets6E4; ordinary subtract35*1.5 and clamp−cap*.5. If seeded830 is strictly>double1.5, set latch828, speed=cap, stored target710=currentYaw+180, keyboard yaw delta0. Already latched backward keeps cap. Releasing acceptance clears830 and latch. The830 clock's increment owner remains unresolved.|
|439416..439490 /39416..39490|Without Up or accepted backward, release positive/negative scalar toward0 by35. Left-only still receives this decay after its acceleration. Keyboard side bias can move while scalar remains0.|
|43951E..4395CF /3951E..395CF|Accepted active input publishes destination yaw even with zero turn: ordinary currentYaw+delta; latched with delta uses currentYaw−delta*.5, otherwise stored710. No active input retains the previous destination.|
|437C40..437DF6 /37C40..37DF6|Read current live velocity; special global4F83E0 returns unchanged. Only nonzero incoming velocity OR nonzero keyboard lateral admits yaw addition and side computation. That gate does not suppress the later base forward rewrite. Side=(turn*(1−friction)*speed*float(1/45)+bias)*dt. Read full Euler via328, add yaw via334 and use full-Euler38C(0,0,speed). Publish its X/Z plus side, preserving incoming Y.|
|437E10..437F4B /37E10..37F4B|Only supported218 and nonnull support polygon338 reaches the support suffix. It subtracts float250 at4A3E58 from current live Vy. The rest of the normal/angle calculation does not project X/Z onto a slope or publish a new actor Euler here.|
|437C22..437C2D /37C22..37C2D|Controlled wrapper publishes complete6C8 controller scalar into body160 afterward. This is separate from live velocity and body friction state.|
Complete/game interface displacement isC0. Complete6BC acceleration30,6C0 decay35,
6C4 current cap600,6C8 controller scalar,6D4 turn rate,6D8 applied turn,6E4 accepted
forward/back,6E6 keyboard-turn latch,710 stored backward heading,828 auto-turn latch,
830 clock,850 accepted-backward and870 lateral bias. Live Euler is game224/228/22C;
destination is game274/278/27C. Ground only sets6E6 on turns; neutral/up/back do
not clear it. The source's air handler owns later keyboard-turn return behavior.
## Confirmed differences from the pre-audit port
1. RecoveredMotion.AddSpeed's unconditional Min(speed+30,cap) reduces existing
overspeed; the original only adds while below cap. This affects ground/air use
of that helper; changing the shared helper requires checking its other callers.
2. Active forward/backward input without turn must publish current yaw as the new
destination. LabSimulation only changed targetYaw for a nonzero turn delta,
allowing residual destination-yaw drift after releasing turn while keeping Up.
3. Ground direction uses full Euler X/Z, not yaw alone. A pitch30/yaw45/roll20
native case projects speed300 to X/Z≈−183.725/+183.725, not±212.132. This matters
during tilt restoration after gadgets/script placement; no new slope tilt is
invented by the helper.
4. Live support with a real polygon supplies downward Vy−250 pressure. The port
preserved Y unchanged. Supported/no-polygon and unsupported cases retain Y.
5. Side computation shares the incoming-motion/bias gate. The existing simplified
apply computes side outside it. Most ordinary landings reset turn0, but the
mathematical distinction is explicit and tested.
6. Primary/backward acceptance and the latent auto-turn state are not modeled by
the old simplified input. Do not enable a fabricated1.5-second timer: its live
clock owner must be recovered first. The pure helper permits explicit source
state inputs so the seeded branches can be compared without claiming live use.
## Implementation, tests and integration
`JimmyGroundMotion.Input` returns state, keyboard lateral and heading-update flag.
Callers resolve backward acceptance (ordinary raw−1/3 primary blocks it), retain
shared6E6 on neutral ground input and set it on Left/Right. BackSeconds defaults0;
leave auto-turn live admission gated until its clock owner is established.
`Apply` accepts full live Euler, source turn/bias, actual support and actual support
polygon presence. It returns velocity and Euler. Body integration, input/apply
order, ordinary/gadget mode dispatch, collision and published-speed copy stay
with the caller. In particular, do not derive a support polygon merely from a
provisional capsule's Grounded flag or apply this ground suffix during air mode.
Twenty-five copied-original observations execute successfully in isolated Wine32:
17 keyboard suffix cases (combinations, release/crossing, cap/overspeed, backward
cap and seeded exact/over1.5/latch branches), eight complete437C40 cases (rest,
stationary turn, lateral-only, turn, full tilt, supported polygon, missing polygon,
unsupported). Synthetic actor/root/support/animation methods surround the copied
routines; original OMT vector/trig methods execute from a copied DLL. No original
game entrypoint, camera prefix, general dynamic body or complete Jimmy executes.
The initial missing OMT export qualifier was corrected before the final run;
only the final exit0/JIMMY_GROUND_COMPLETE output establishes observations.
The committed original-ground-reference.json records both source identities,
bounded spans, generator/shared harness/executable/log hashes and all25 cases.
Two managed groups compare every case and check active-versus-idle heading and
caller-owned primary/backward suppression. Two Python groups validate identity,
provenance, ranges/offsets and complete observed counts. Logs and final capture
metadata are under artifacts/jimmy-ground-audit/. Parent owns live integration,
route/render/platform checks and root status documents; this agent made no shared
runtime edits or commits. Whole-original/native Windows movement parity remains
unverified. Mouse/analog, camera side timers, generic clock registration, full
standing/pose/climb branches and engine cadence remain separate evidence gates.
+58
View File
@@ -0,0 +1,58 @@
# Jimmy jump and powered hold conformance
2026-11-05. Authoritative EXE SHA256
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
This extends the existing [jetpack recovery](../analysis/jetpack.md); the playable
550 impulse, −800 gravity and existing state0..5 behavior remain the baseline.
JN-Engine's tuned movement is not used.
## Evidence and corrections
REA inspect-with-objdump Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`
retains the complete original disassembly in
artifacts/jimmy-movement-audit/rea-original-disassembly.json. This is static
instruction evidence. The complete437F90..4387D8 range, including both jump
tables, maps to file37F90..387D8. Euler helpers4723F0/472480/472B10 map to
723F0/72480/72B10. The generator guards identity, offsets and each range's hash.
`tools/binary/jimmy_jump_motion.py` extends the air harness without its early
suffix return. It executes full copied437F90 with synthetic actor/body, support,
energy/inventory, level, animation and effect callbacks, plus original OMT trig
and original Euler leaves. The game entrypoint, collision/body integration,
effect countdown421FB0 and real animation/audio are not executed. Absolute
strings and jump-table entries are separately relocated; operands outside the
mapped image are rejected so disassembled table bytes cannot corrupt relocation.
Initial harness attempts required correcting those relocations and the synthetic
509948 owner pointer. Only the final successful32-case run is used as evidence.
The isolated Wine32 run exits0 and prints JIMMY_JUMP_MOTION_COMPLETE. Fixture
`tests/GamePort.JimmyJumpTests/original-jump-reference.json` records32 observations,
source ranges, relocations, generator/shared setup/probe executable/output hashes.
Generated source, capture.json and wine.log remain in artifacts/jimmy-jump-audit.
The managed suite compares jump state, hold/effect timers, pending impulse,
vertical/extra acceleration, pose requests, effect calls and radius writes.
Two directly evidenced precision mismatches are corrected in `JetpackBurst`:
- Before powered state3, gravity correction retains the wide intermediate:
`(float)((double)gravityY * 1.33f - gravityY)`. With−800 this is−264.000031,
rather than the old staged float−264.
- 438407 stores hold as float but43840D compares the unrounded x87 sum against
float.4. Stored `.3f + .1f` and `23f/60 + 1f/60` both become.400000006,
but only the first starts the burst. The port now compares the wide sum before
returning. Testing the stored float cannot distinguish those observations.
Coverage includes states0..5, held/released branches, takeoff/landing, null effect,
expiry, exact/adjacent hold thresholds, inventory/energy/gadget/level gates,
VR04 immunity and both sides of the500-height acceleration threshold. The outer
437940 grounded/released bypass remains a caller phase and is not certified by
invoking437F90 alone. Physics consumes pending impulse on the following pass;
source effect421FB0, input registration and raw control retain their own owners.
## Remaining limits
This proves bounded original component outputs and managed conformance, not a
whole-original trajectory. Fixed60Hz, the capsule in lab/outside, render root,
complete animation completion, sound and native Windows feel remain separate.
Live route and SDL tests are recorded in [movement stabilization](jimmy-movement-stabilization.md).
@@ -0,0 +1,99 @@
# Jimmy movement stabilization
2026-11-04. User pauses gadget expansion and prioritizes solid Jimmy movement.
Current C# movement is the playable baseline; runtime packages fccc0b9 and source
42ea2b8 remain preserved. JN-Engine's native/Godot movement is explicitly not the
behavior oracle. Its saved original decompiler/class index is a navigation aid;
REA, authoritative bytes and copied-original observations verify corrections.
## Working checkpoints
1. Compare ordinary ground/air input, velocity and facing with copied-original
cases; preserve current acceleration/jump/gravity values unless contradicted.
2. Verify jump/hold/release/landing, jetpack acceleration/expiry, queued impulse
and physics-before-input ownership, including fresh/retained scene order.
3. Recover lab/outside contact metadata, root publication and animation-owned
response sufficiently to replace the provisional capsule safely. Preserve
scene/actor state ownership; do not enable unsupported special contacts.
4. Verify the combined input/physics/control/animation behavior on lab → VR04 →
lab → outside, including all jump aliases, stairs/slopes/walls/ceilings,
cutscenes, reset, RETURN and stable presentation-rate behavior.
## Evidence boundary on entry
Current ordinary body is source-backed in bounded tutorials; lab/outside still
use the modern capsule. Controller input and apply are simplified in LabSimulation,
with source-based Jump550/gravity800 plus jump acceleration correction, fixed60Hz
as a modern policy, and a sole/root render bridge. Previous numeric/route/native
verification remains valuable; it does not certify complete movement fidelity.
Ground/air/math corrections are separate from admitting special/dynamic physics.
New independent reports: jimmy-ground-motion.md, jimmy-air-motion.md,
jimmy-orientation.md and ../checkpoint/jimmy-special-contact.md. Parent owns
integration/jump/route verification; investigators own their named new files only.
Findings/tests and implementation status are updated here as chunks finish.
## Controller checkpoint, 2026-11-05
Integrated `JimmyGroundMotion`, `JimmyAirMotion` and `JimmyOrientation` into
LabSimulation. Ground Up/accepted Down publishes current heading even without
turn input, clearing the old turn destination; neutral retains it. Acceleration
preserves existing overspeed. Ground backward acceptance honors raw−1/3 primary
fire. Air input retains the shared keyboard-turn latch, performs its independent
supported subtraction/brake and compares coast with the wide product. Full-Euler
apply preserves incoming Vy and correctly gates lateral/yaw on incoming velocity.
Facing uses original shortest arcs/full-axis angle normalization and runs in the
base phase even without raw control. Published speed, pending impulse, effect
clock and fresh/retained ordering remain separate. [Jump conformance](jimmy-jump-motion.md)
adds the exact wide hold comparison and gravity intermediate.
108 saved native observations compare against managed components:25 ground,
35 air,16 facing and32 jump.27 additional native special-contact dispatch cases
establish callback eligibility only.12 air destination writes establish missing
pitch/roll target behavior, which remains a deliberate implementation gate; see
[jimmy-air-motion.md](jimmy-air-motion.md). These are copied-original component
observations, not observed original whole-game play.
### Collision compatibility boundary
The original supported ground apply subtracts250 from live Vy only when actual
support polygon338 is non-null. This is live with the source body and its real
SupportHit. A capsule Grounded flag or floor-height query does not stand in for338.
An attempted mapping from capsule support introduced a repeatable lab stair block
(artifacts/jimmy-movement-audit/lab-route.log, leg1 root4307.62/15.13/351.25).
Removing that mapping restores the entire input-only route
(lab-route-compatible.log), and the two-way underground route also passes. The
capsule retains baseline landing Vy0. This is an explicit compatibility gate,
not an original-body result or a replacement friction/step tuning fix.
### Next coherent implementation chunks
1. Implement source destination-Euler pitch/roll with retained7EC/7F0, the full
actor-root visual bridge and mode/registration order together. Verify ordinary
jump, powered turning, Bubble cleanup, landing and RETURN. Baseline ordinary
air currently stays visually upright; the recovered−40/+10 targets are not live.
2. Finish Vec4 previous/live-root publication after callbacks; separate body
integration210 from world-response1D0. Verify successful fence/ladder entry,
animation-end/fallback completion and4255C0 hazard/impulse ownership before
broader Jimmy body admission. The incomplete success-probe experiment is
preserved under ignored artifacts/jimmy-special-contact/success; it is not
conformance evidence or part of the committed dispatcher tool.
3. Recover dynamic pair eligibility/shared context and original support metadata;
replace the lab/outside capsule in an independently verified route chunk.
4. Complete animation/camera/retained helper/cadence comparison on a working
original installation and native Windows. The user's preserved movement
baseline remains authoritative among unverified port alternatives.
### Cross-system regression interpretation
Original AddEuler stores small negative pitch near360; Bubble's test/smoke checks
now compare signed angular direction rather than requiring a negative stored
number. Its fire/throttle and source target sign stay unchanged. Source-supported
Grappler attachment also exposes phase composition: fresh input writes Vy100,
then the ordinary ground controller subtracts250, producing−150; retained late
input writes100 after that publication. The existing ground native positive-Vy
case proves this subtraction. Managed attachment checks now distinguish those
orders. Control loss still runs the body, but a supported root need not move;
its regression checks the physics count/support/ownership instead of inventing
an airborne displacement. Grappler completion/other callbacks are not inferred
from these tests.
+72
View File
@@ -0,0 +1,72 @@
# Jimmy facing interpolation and full Euler seams
2026-11-04. This source-backed helper closes an integration dependency of the
ordinary movement audit. The current playable port remains the baseline. No
JN-Engine native movement/controller constants were adopted.
## Recovered original contract
Authoritative EXE SHA256
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
Code VAs below have independently mapped file offset VA−400000. New extractor
jimmy_orientation.py records three bounded ranges, hashes and two double factors.
| VA / file offset | Contract |
|---|---|
|43A420..43A5CF /3A420..3A5CF|Jimmy game-interface3D8 facing.475CA0 gameplay gate, +5 enabled, +A dirty control execution. Clear dirty, read current224/228/22C and retained target274/278/27C. Unequal axes reassert dirty; current/target remain distinct state.|
|43A4A4..43A58C /3A4A4..3A58C|For each target−current difference, wrap strictly>180 by−360 and strictly<−180 by+360 once. ±180 retain sign. Pitch/yaw deltas have explicit float stack stores; roll's difference remains on x87 until final argument publication.|
|43A58C..43A5C2 /3A58C..3A5C2|Multiply differences by supplied float dt, then double4.5 for pitch/roll (4AFD38), double3.7 for yaw (4AFCF0), store each resulting delta as float parameter and invoke334. There is no small-step snap or gain clamp.|
|458F90..458FB6 /58F90..58FB6|Jimmy334 wrapper repeats gameplay gate, then forwards XYZ float parameters to472480.|
|472480..472570 /72480..72570|Add angles and preserve original asymmetric negative truncation and strict>360 single wrap. Existing RocketOrientation.Add models this leaf; zero steps can normalize negative angles.|
|473240→47328D /73240→7328D|Shared base updater invokes game3D8→43A420.43796A calls40E050 before437A1B raw-owner identity check. Facing is thus a base phase independent of movement input acceptance. Body/registry/callback ordering still belongs to caller.|
Jimmy vtable4A373C+334 binds458F90 and+3D8 binds43A420. The probe uses these
original wrapper/leaf bodies with a synthetic game-interface object and active
475CA0. No global game entrypoint or actor/controller/body path executes.
## Why this matters for live integration
LabSimulation previously interpolated raw targetPitch−Pitch and targetRoll−Roll
with float4.5, while yaw used IEEERemainder and float3.7. Source AddEuler used by
movement canonicalizes all axes, so a recovered pitch/roll338 must approach0
through360. A raw difference would instead rotate338 toward0 the long way.
This can create an artificial spin after a slope/vehicle/Bubble tilt. Source
native338→0 at60Hz produces339.65 on both pitch/roll, preserving the short arc.
New JimmyOrientation.Step(current,target,dt,enabled=true,dirty=true) returns the
new full Euler and leaves destination state untouched. It supports ordinary
movement and existing Bubble facing; no targets are invented/reset by the helper.
X/Y delta rounding, factor widths and AddEuler parameter publication are preserved
with double intermediates and explicit float argument casts. Disabled/clean gates
return current unchanged. Caller owns actual enabled/dirty fields and scheduling;
this pure API does not infer either from input ownership.
Parent owns LabSimulation integration: apply this once in the recovered base
phase, after fresh input and before ordinary controlled apply, while retained
input remains after player/fire. Remove duplicate naive interpolation. Exact
base-wrapper/dirty flag state and unsupported class modes remain separate gates.
## Evidence and verification
Parent's retained REA inspect_with_objdump Evidence
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`
contains the complete original disassembly. Bundle:
artifacts/jimmy-movement-audit/rea-original-disassembly.json. The focused source
instructions/caller are retained under artifacts/jimmy-orientation-audit. The
same routine may not be recognized as a Ghidra procedure under the default profile;
no unchanged failed pseudocode selector was repeated. This evidence establishes
bytes/instructions, not original gameplay runtime.
The isolated copied-original probe executes43A420/458F90/472480 and records16
cases: ordinary axes,338→0 leveling, both359/1 seams, negative angles, exact±180,
>180, canonical360, fractional input/double arithmetic, small-angle/no-snap,
120-tick settling, upright and enabled/dirty/zero-dt gates. Wine32 exits0 with
JIMMY_ORIENTATION_COMPLETE. Source/generator/shared-map-helper/generated EXE/log
hashes are committed in original-orientation-reference.json. Native outputs and
capture metadata are under artifacts/jimmy-orientation-audit/probe.
Two managed groups compare all16 observations and verify retained target state.
Two Python groups guard identity, ranges/offsets, double factors, complete fixture
and provenance/gates. This is component execution plus managed conformance, not
whole-original/native Windows gameplay, full animation/visual-root parity or a
complete scene registry/cadence implementation. Parent records live verification.
+29 -1
View File
@@ -1,4 +1,32 @@
# Progress — 2026-11-04
# Progress — 2026-11-05
## Jimmy controller conformance checkpoint
User pauses gadget expansion and prioritizes Jimmy movement, preserving our
playable baseline over JN-Engine's tuned movement. Integrated recovered ground/
air input and velocity, shared keyboard-turn latch, full-axis base facing before
control gating, exact jetpack hold comparison and gravity intermediate.108 saved
original component outputs match managed checks:25 ground,35 air,16 facing,
32 jump. REA retained complete original instructions; native component runs are
separate from whole-original gameplay.27 special-contact dispatch and12 missing
air-target observations are documented, with explicit implementation gates.
26 integrated movement groups,20 body groups and13 Jimmy evidence guards pass.
Input-only lab and two-way underground routes pass. A pressure/capsule stair
regression was caught and its evidence retained: source−250 Vy requires an actual
support polygon and remains disabled in the lab/outside capsule. Native Linux
1920×1080 SDL walking and powered flight pass all five jump aliases, with resize,
received-key checks, identical final readbacks per replay and zero validation
errors. Native Carl/control-phase and9-stage Grappler replays also pass. Source
angle normalization required signed-direction Bubble assertions; supported
Grappler tests now distinguish fresh−150 versus late100 velocity publication.
Continuation/coverage: [Jimmy movement](gameplay/jimmy-movement-stabilization.md).
Next: ordinary-air destination Euler plus actor-root render bridge, followed by
root-changing/special/dynamic contacts before broader source-body admission.
The incomplete successful-climb probe is preserved in ignored artifacts, not
claimed as verified. All investigator file ownership has returned to primary.
No new gadget work, broad body replacement or complete movement parity is claimed.
## Scooter pitch and dismount follow-up
+8
View File
@@ -5,6 +5,14 @@ offsets, virtual addresses, API symbols or observed behavior. Decompiled output
evidence, not original source. Original gameplay has not yet been observed successfully; isolated original DLL
probes and modern runtime checks are recorded separately.
- [Jimmy movement stabilization](gameplay/jimmy-movement-stabilization.md):
current priority, preserving our playable controller over JN's tuned replacement.
Ground/air/facing/jump reports record108 native component observations matched
by managed implementations,27 special-contact eligibility observations and12
recovered air destination writes. The last two are investigation evidence;
special-body and ordinary air-pitch/render integration remain open. REA's
complete original instruction Evidence and offsets are linked in those reports.
- `gameplay/grappler-live.md`: boundedVR08 integration/coverage and runtime
evidence. `grappler-body.md` records shared sphere context and41 native cases;
`grappler-camera.md`, `grappler-resources.md`, `grappler-lifecycle.md` record
+17
View File
@@ -46,6 +46,23 @@ compile, runtime and original-fidelity verification are separate.
## Immediate continuation
- [ ] Current priority: stabilize Jimmy's ground/air input, facing, jump/landing,
body/contact response and route/control transitions before more gadgets. Keep
our movement baseline; JN-Engine is an original-code index, not a movement model.
See gameplay/jimmy-movement-stabilization.md for bounded evidence/verification gates.
- [x] Jimmy controller arithmetic/facing checkpoint: source ground/air components,
shared keyboard latch, control-independent full-axis facing, exact jump hold and
gravity intermediates.108 saved original component observations match managed
checks. Capsule compatibility remains explicit; broad collision is not complete.
- [ ] Next Jimmy chunk: source ordinary-air destination pitch/roll and retained
mode fields together with the actor-root visual bridge.12 original target writes
are recorded; do not silently enable physics tilt without matching presentation.
- [ ] Then verify root-changing contact publication, world-response/integration
flags, successful fence/ladder completion, hazard/impulse and dynamic eligibility
before replacing the lab/outside capsule.27 dispatch cases establish eligibility
only; the unfinished successful-climb harness remains ignored investigation work.
- [x] Scooter feedback: Goddard gradually levels pitch/roll after tilted dismount;
engine uses missing source positional frequency/history correction.13 Scooter,
2 audio,10 Patrol and24 Python groups plus native input replays pass. See
+4
View File
@@ -6,6 +6,10 @@ python3 tools/extractors/prepare.py --all-scenes --audio sounds musicsecretlab
dotnet run --project tests/GamePort.DataTests -- ../Original
dotnet run --project tests/GamePort.CollisionTests -- ../Original
dotnet run --project tests/GamePort.MovementTests -- ../Original
dotnet run --project tests/GamePort.JimmyGroundTests
dotnet run --project tests/GamePort.JimmyAirTests
dotnet run --project tests/GamePort.JimmyOrientationTests
dotnet run --project tests/GamePort.JimmyJumpTests
dotnet run --project tests/GamePort.DirectorTests -- ../Original
dotnet run --project tests/GamePort.PatrolTests -- ../Original
dotnet run --project tests/GamePort.SupportTests -- ../Original
+1 -1
View File
@@ -106,7 +106,7 @@ public sealed class BubbleSmoke
if (count == 1) checks[1] = effect.Active && !effect.Expanding && effect.Visible
&& effect.Width == 240 && effect.Height >= 210 && effect.Height <= 270;
if (count == 2) checks[2] = player.GadgetMode == 0 && player.MovementMode == 2
&& player.Speed > 0 && player.TurnRate > 0 && player.Pitch < 0 && !player.Shooting;
&& player.Speed > 0 && player.TurnRate > 0 && MathF.IEEERemainder(player.Pitch,360) < 0 && !player.Shooting;
if (count == 3) checks[3] = player.BubbleBounces > bouncesBeforeHeld
&& MathF.Abs(player.Velocity.Y - 900) < .001f && boingSounds > soundsBeforeHeld;
if (count == 4) checks[4] = player.GadgetMode == 0 && effect.Active && !player.Shooting;
+3 -2
View File
@@ -2,8 +2,9 @@ namespace GamePort.Game;
public readonly record struct AirSteeringResult(float Speed, float TurnRate);
/// <summary>Keyboard subset of normal airborne input439900 (mode1).
/// Modes1/2 share the handler; special flight mode2 and mouse/analog are separate.
/// <summary>Legacy stateless compatibility helper and shared steering constants.
/// Live ordinary input uses JimmyAirMotion, which retains the keyboard latch,
/// supported mode1 braking and original coast comparison precision.
/// </summary>
public static class AirSteering
{
+6 -3
View File
@@ -66,7 +66,7 @@ public static class JetpackBurst
}
if (state.JumpState < 3)
extra = input.GravityY * 1.33f - input.GravityY;
extra = (float)((double)input.GravityY * 1.33f - input.GravityY);
else
{
if (input.EffectAvailable && state.EffectRemaining <= 0 && state.JumpState is 3 or 4)
@@ -109,8 +109,11 @@ public static class JetpackBurst
EffectRemaining = input.EffectAvailable ? 0 : state.EffectRemaining };
return Result(impulse: JumpImpulse, pose: JetpackPose.Jump);
case 1:
state = state with { HoldSeconds = state.HoldSeconds + input.DeltaSeconds };
if (state.HoldSeconds <= HoldThreshold) return Result();
//438407 storesfloat but keeps the unrounded sum on x87 for
//43840D's comparison. Different sums can store the samefloat.
double hold=(double)state.HoldSeconds+input.DeltaSeconds;
state = state with { HoldSeconds = (float)hold };
if (hold <= HoldThreshold) return Result();
break;
case 2:
break;
+58
View File
@@ -0,0 +1,58 @@
using System.Numerics;
namespace GamePort.Game;
public readonly record struct JimmyAirInputState(float Speed,float TurnRate,bool KeyboardTurn);
public readonly record struct JimmyAirApply(Vector3 Velocity,Vector3 Rotation,float AppliedTurnRate);
/// <summary>Ordinary mode1 keyboard input439900 and437F90 velocity prefix.
/// Body integration, facing interpolation, jump suffix and input ownership are
/// caller phases. Source constraints and observations: jimmy-air-motion.md.</summary>
public static class JimmyAirMotion
{
public static JimmyAirInputState Input(JimmyAirInputState state,PlayerInput input,bool supported,
float seconds,float maximumSpeed=600)
{
if(!float.IsFinite(state.Speed)||!float.IsFinite(state.TurnRate)||!float.IsFinite(seconds)
||seconds<=0||seconds>=1||!float.IsFinite(maximumSpeed)||maximumSpeed<=0)
throw new ArgumentOutOfRangeException(nameof(seconds));
float turn=state.TurnRate;bool keyboard=state.KeyboardTurn;float turnStep=100*seconds;
if(input.Left){turn+=turnStep;keyboard=true;}
else if(input.Right){turn-=turnStep;keyboard=true;}
else if(keyboard)turn=turn<0?MathF.Min(0,turn+turnStep):MathF.Max(0,turn-turnStep);
float speed=state.Speed;
if(input.Forward)
{
if(speed<maximumSpeed)speed=MathF.Min(maximumSpeed,speed+30);
}
//439B77 compares the unrounded x87 product against stored speed.
else if(speed>(double)maximumSpeed*.9090909361839294f)speed-=17.5f;
//A stored air mode may still receive input while body218 is supported.
//This independent subtraction intentionally has no crossing clamp.
if(supported)speed=speed>0?speed-17.5f:0;
if(input.Backward)
{
if(speed>0)speed=MathF.Max(0,speed-(supported?35:17.5f));
else if(speed<0)speed=MathF.Min(0,speed+35);
}
return new(speed,Math.Clamp(turn,-30,30),keyboard);
}
public static JimmyAirApply Apply(float speed,float turn,Vector3 rotation,Vector3 velocity,
float seconds,float friction=.8f)
{
if(!float.IsFinite(speed)||!float.IsFinite(turn)||!float.IsFinite(seconds)||seconds<0||seconds>=1
||!float.IsFinite(friction)||!float.IsFinite(velocity.X)||!float.IsFinite(velocity.Y)||!float.IsFinite(velocity.Z))
throw new ArgumentOutOfRangeException(nameof(seconds));
float side=0,applied=0;
if(velocity!=Vector3.Zero)
{
applied=turn;
rotation=RocketOrientation.Add(rotation,new(0,turn*seconds,0));
side=(float)((double)turn*.0181818176060915f*(1.0-friction)*speed);
}
var forward=RocketOrientation.Rotate(new(0,0,speed),rotation);
var(sin,cos)=RocketOrientation.Trig(rotation.Y);
return new(new((float)(forward.X+(double)cos*side),velocity.Y,
(float)(forward.Z+(double)sin*side)),rotation,applied);
}
}
+64
View File
@@ -0,0 +1,64 @@
using System.Numerics;
namespace GamePort.Game;
public readonly record struct JimmyGroundState(float Speed,float TargetYaw,
float BackSeconds=0,bool AutoTurning=false,float BackYaw=0);
public readonly record struct JimmyGroundInput(JimmyGroundState State,float Lateral,bool HeadingUpdated);
public readonly record struct JimmyGroundApply(Vector3 Velocity,Vector3 Rotation);
/// <summary>43915D..4395CF keyboard ground suffix and437C40 ground apply.
/// Body, phase gates, backward acceptance and the830 clock owner remain caller-owned.
/// See docs/gameplay/jimmy-ground-motion.md for copied-original references/limits.</summary>
public static class JimmyGroundMotion
{
public static JimmyGroundInput Input(JimmyGroundState state,float yaw,PlayerInput input,
float maximumSpeed=600,bool blockBackward=false)
{
Finite(state.Speed);Finite(state.TargetYaw);Finite(state.BackSeconds);Finite(state.BackYaw);Finite(yaw);Finite(maximumSpeed);
if(maximumSpeed<=0)throw new ArgumentOutOfRangeException(nameof(maximumSpeed));
float speed=state.Speed,angle=0,lateral=0,backTime=state.BackSeconds,backYaw=state.BackYaw;
bool active=false,back=input.Backward&&!blockBackward,auto=state.AutoTurning;
float Accelerate(float value)=>value<maximumSpeed?MathF.Min(value+30,maximumSpeed):value;
if(input.Left){angle+=20;lateral=-1000;active=true;speed=Accelerate(speed);}
else if(input.Right){angle-=20;lateral=1000;active=true;speed=Accelerate(speed);}
if(input.Forward){angle*=.5f;active=true;speed=Accelerate(speed);}
if(back)
{
active=true;
if(!auto)
{
speed=MathF.Max(speed-52.5f,-maximumSpeed*.5f);
if((double)backTime>1.5){speed=maximumSpeed;auto=true;backYaw=yaw+180;angle=0;}
}
else speed=maximumSpeed;
}
else {backTime=0;auto=false;}
if(!input.Forward&&!back)
{if(speed>0)speed=MathF.Max(0,speed-35);if(speed<0)speed=MathF.Min(0,speed+35);}
float target=state.TargetYaw;
if(active)target=auto?(angle!=0?yaw-angle*.5f:backYaw):yaw+angle;
return new(new(speed,target,backTime,auto,backYaw),lateral,active);
}
public static JimmyGroundApply Apply(float speed,Vector3 velocity,Vector3 rotation,float turnRate,
float lateral,bool supported,bool hasSupportPolygon,float seconds,float friction=.8f,bool specialLocked=false)
{
Finite(speed);Finite(turnRate);Finite(lateral);Finite(seconds);Finite(friction);
Finite(velocity.X);Finite(velocity.Y);Finite(velocity.Z);
Finite(rotation.X);Finite(rotation.Y);Finite(rotation.Z);
if(seconds<=0||seconds>=1)throw new ArgumentOutOfRangeException(nameof(seconds));
if(specialLocked)return new(velocity,rotation);
float side=0;
if(velocity!=Vector3.Zero||lateral!=0)
{
rotation=RocketOrientation.Add(rotation,new(0,turnRate*seconds,0));
side=(float)(((double)turnRate*.02222222276031971f*(1.0-friction)*speed+lateral)*seconds);
}
var forward=RocketOrientation.Rotate(new(0,0,speed),rotation);
var(sine,cosine)=RocketOrientation.Trig(rotation.Y);
var result=new Vector3(forward.X+cosine*side,velocity.Y,forward.Z+sine*side);
if(supported&&hasSupportPolygon)result.Y-=250;
return new(result,rotation);
}
private static void Finite(float value){if(!float.IsFinite(value))throw new ArgumentOutOfRangeException(nameof(value));}
}
+25
View File
@@ -0,0 +1,25 @@
using System.Numerics;
namespace GamePort.Game;
/// <summary>43A420 active Jimmy facing, followed by334→458F90→472480.
/// Targets are retained caller state; all three axes take the shortest arc.
/// Source4.5/3.7 constants are doubles and delta parameters publish as floats.</summary>
public static class JimmyOrientation
{
public static Vector3 Step(Vector3 current,Vector3 target,float seconds,bool enabled=true,bool dirty=true)
{
if(!float.IsFinite(current.X)||!float.IsFinite(current.Y)||!float.IsFinite(current.Z)
||!float.IsFinite(target.X)||!float.IsFinite(target.Y)||!float.IsFinite(target.Z)
||!float.IsFinite(seconds)||seconds<0||seconds>=1)
throw new ArgumentOutOfRangeException(nameof(seconds));
if(!enabled||!dirty)return current;
static float Arc(float value)=>value>180?value-360:value< -180?value+360:value;
static double WideArc(double value)=>value>180?value-360:value< -180?value+360:value;
var x=Arc(target.X-current.X);var y=Arc(target.Y-current.Y);
//X/Y differences have explicit float stack stores. The Z difference
//remains on x87 until its final float argument publication.
var z=WideArc((double)target.Z-current.Z);
var delta=new Vector3((float)((double)x*seconds*4.5),(float)((double)y*seconds*3.7),(float)(z*seconds*4.5));
return RocketOrientation.Add(current,delta);
}
}
+37 -27
View File
@@ -10,7 +10,7 @@ public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot, Swing }
/// <summary>
/// Walking, airborne steering and jetpack checkpoint. Recovered arithmetic is described in
/// movement-checkpoint.md. Legacy capsule, floor-derived pivot and60Hz are port policies;
/// jimmy-movement-stabilization.md. Legacy capsule, floor-derived pivot and60Hz are port policies;
/// original collision, intro, object interactions and animation timing remain open.
/// </summary>
public sealed class LabSimulation
@@ -32,6 +32,7 @@ public sealed class LabSimulation
private int movementMode;
private JetpackBurstState jumpState;
private bool forceFall;
private bool keyboardTurn, hasSupportPolygon;
private Vector3 noclipEntry;
private float noclipEntryYaw;
private int gadgetMode = -1;
@@ -189,6 +190,7 @@ public sealed class LabSimulation
Yaw = targetYaw = startYaw;
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = shadowDistance = 0;
lateralContribution = 0; pendingImpulse = Vector3.Zero; movementMode = 0;
keyboardTurn=false;hasSupportPolygon=false;
jumpState = default;
forceFall = JetpackEffectVisible = false;
Shooting = false;
@@ -262,6 +264,7 @@ public sealed class LabSimulation
//424BE0..424C34 runs this wrapper before437940's ownership gate.
StepCeiling();
StepFloorPolicy(); //437940's base40E050, before the input-identity gate.
StepFacing(); //40E050→473240→43A420 also runs without input ownership.
if (controlled) StepPlayer(input);
Invisible.Step(FixedStepClock.Step, anyControlled ?? controlled, input.Fire, input.Jump,
Energy, IgnoresGadgetEnergy, AdjustEnergy);
@@ -444,26 +447,26 @@ public sealed class LabSimulation
//438A60 dispatches by stored movement mode, not current support.
if (movementMode == 0)
{
if (TracksBubbleOrientation && (input.Forward || input.Left || input.Right
|| input.Backward && !(GadgetMode is -1 or 3 && input.Fire))) targetPitch=targetRoll=0;
float yawDelta = 0;
if (input.Left) { yawDelta += 20; lateralContribution = -1000; Speed = RecoveredMotion.AddSpeed(Speed,MaximumSpeed); }
else if (input.Right) { yawDelta -= 20; lateralContribution = 1000; Speed = RecoveredMotion.AddSpeed(Speed,MaximumSpeed); }
if (input.Forward) { yawDelta *= 0.5f; Speed = RecoveredMotion.AddSpeed(Speed,MaximumSpeed); }
if (yawDelta != 0) targetYaw = Yaw + yawDelta;
if (input.Backward) Speed = MathF.Max(Speed - 52.5f, -300);
else if (!input.Forward) Speed = RecoveredMotion.ReleaseSpeed(Speed);
//The830 backward clock owner remains unresolved; ordinary state0
//does not invent a hold timer or admit its seeded auto-turn branch.
var ground=JimmyGroundMotion.Input(new(Speed,targetYaw),Yaw,input,MaximumSpeed,
blockBackward:(GadgetMode is -1 or 3)&&input.Fire);
Speed=ground.State.Speed;targetYaw=ground.State.TargetYaw;lateralContribution=ground.Lateral;
if(input.Left||input.Right)keyboardTurn=true;
if(ground.HeadingUpdated)targetPitch=targetRoll=0;
}
else if (movementMode==2)
{
var steering=BubbleMotion.StepInput(Speed,TurnRate,input,Grounded,dt,MaximumSpeed);
Speed=steering.Speed; TurnRate=steering.TurnRate;
if(input.Left||input.Right)keyboardTurn=true;
targetPitch=steering.TargetPitch; targetRoll=steering.TargetRoll; targetYaw=Yaw;
}
else
{
var steering = AirSteering.Step(Speed, TurnRate, input, dt,MaximumSpeed);
var steering = JimmyAirMotion.Input(new(Speed,TurnRate,keyboardTurn),input,Grounded,dt,MaximumSpeed);
Speed = steering.Speed; TurnRate = steering.TurnRate;
keyboardTurn=steering.KeyboardTurn;
if (TracksBubbleOrientation) { targetPitch=0; targetRoll=-TurnRate; }
//439E2B preserves current yaw as the destination; air apply then
//438011..43802B adds the independent turn rate directly to yaw.
@@ -492,15 +495,16 @@ public sealed class LabSimulation
StopForPrimaryFire,SetShooting,AdjustEnergy);
}
private void StepFacing()
{
var rotation=JimmyOrientation.Step(new(Pitch,Yaw,Roll),new(targetPitch,targetYaw,targetRoll),FixedStepClock.Step);
Pitch=rotation.X;Yaw=rotation.Y;Roll=rotation.Z;
}
private void StepPlayer(PlayerInput input)
{
ControllerSteps++;
const float dt = FixedStepClock.Step;
if (TracksBubbleOrientation)
{
Pitch+=(targetPitch-Pitch)*dt*4.5f;
Roll+=(targetRoll-Roll)*dt*4.5f;
}
if (movementMode==2)
{
var bubble=BubbleMotion.StepApply(Speed,TurnRate,Yaw,Pitch,Velocity,Grounded,input.Jump,dt);
@@ -508,8 +512,6 @@ public sealed class LabSimulation
if (Grounded) { BubbleBounces++; if (bubble.Boing) GadgetSound?.Invoke(106,false); }
return;
}
var yawError = MathF.IEEERemainder(targetYaw - Yaw, 360);
Yaw = (Yaw + yawError * dt * 3.7f) % 360;
//437A96 selects air mode on held jump;437B9E..BAC resets jump/mode/turn
//only in the player's grounded/released update, after input when fresh.
if (input.Jump) movementMode = 1;
@@ -517,15 +519,18 @@ public sealed class LabSimulation
{
movementMode = 0; TurnRate = 0;
}
if (Velocity.LengthSquared() != 0 || movementMode == 0 && lateralContribution != 0)
Yaw = (Yaw + TurnRate * dt) % 360;
var (sin, cos) = Trig(Yaw);
var velocity = new Vector3(-sin * Speed, Velocity.Y, cos * Speed);
//437CDx ground uses /45 then dt;43803B air uses /55 without dt.
const float friction = .8f;
var sideSpeed = movementMode == 0 ? (TurnRate * (1 - friction) * Speed / 45 + lateralContribution) * dt
: TurnRate * (1 - friction) * Speed * .0181818176060915f;
velocity += new Vector3(cos, 0, sin) * sideSpeed;
Vector3 velocity;
if(movementMode==0)
{
var ground=JimmyGroundMotion.Apply(Speed,Velocity,new(Pitch,Yaw,Roll),TurnRate,
lateralContribution,Grounded,hasSupportPolygon,dt);
velocity=ground.Velocity;Pitch=ground.Rotation.X;Yaw=ground.Rotation.Y;Roll=ground.Rotation.Z;
}
else
{
var airMotion=JimmyAirMotion.Apply(Speed,TurnRate,new(Pitch,Yaw,Roll),Velocity,dt);
velocity=airMotion.Velocity;Pitch=airMotion.Rotation.X;Yaw=airMotion.Rotation.Y;Roll=airMotion.Rotation.Z;
}
if (collision.GroundHeight(ActorRoot, 2500) is { } shadowFloor)
shadowDistance = MathF.Abs(ActorRoot.Y - shadowFloor - 13);
var air = JetpackBurst.Step(jumpState, new(Grounded, input.Jump, velocity.Y, shadowDistance,
@@ -576,6 +581,10 @@ public sealed class LabSimulation
}
}
Grounded = result.Grounded && velocity.Y <= 0;
//The capsule has no original338 support polygon. Combining source
//downward pressure with its slide solver blocks the lab stair route.
//Keep that solver's baseline until the source body/contact bridge lands.
hasSupportPolygon=false;
if (Grounded && velocity.Y < 0 || result.HitCeiling && velocity.Y > 0 && ceilingRay == null) velocity.Y = 0;
if (Grounded) { extraAirAcceleration = 0; forceFall = false; }
Velocity = velocity;
@@ -598,6 +607,7 @@ public sealed class LabSimulation
pendingImpulse = result.Body.Impulse;
extraAirAcceleration = result.Body.Acceleration.Y;
Grounded = result.Body.Supported;
hasSupportPolygon=result.SupportHit!=null;
if (Grounded) forceFall = false;
if (result.Landing != null) Landings++;
if (result.Contact is { StoredNormal.Y: > -.7f }) {WallHits++;Grappler?.Contact();}
+2 -1
View File
@@ -18,7 +18,8 @@ public static class RecoveredMotion
// Deliberately per invocation: original increments omit dt. Call cadence is
// not yet verified. Rendering must not directly choose simulation cadence.
public static float AddSpeed(float speed, float maximumSpeed = MaximumSpeed) => MathF.Min(speed + SpeedIncrement, maximumSpeed);
public static float AddSpeed(float speed, float maximumSpeed = MaximumSpeed) =>
speed<maximumSpeed?MathF.Min(speed+SpeedIncrement,maximumSpeed):speed;
public static float ReleaseSpeed(float speed) => speed > 0
? MathF.Max(0, speed - SpeedDecay) : MathF.Min(0, speed + SpeedDecay);
@@ -84,6 +84,7 @@ var player=Simulation();
Check(player.UsesOriginalBody && player.PublishedSpeed==0,"tutorial explicitly selects source body");
for(var i=0;i<120;i++)player.Step(default);
Check(player.Grounded && player.Landings==0,"steady source support must not chatter");
Check(player.Velocity.Y==-250,"source support polygon admits the ground controller's downward pressure");
var sole=standing.Vertices.Min(v=>Vector3.Transform(v.Position,player.Model).Y);
Check(MathF.Abs(sole-player.Position.Y)<.001f,"modern sole/root render bridge remains explicit and stable");
var rootBefore=player.ActorRoot;
+1 -1
View File
@@ -80,7 +80,7 @@ Test("Bubble fire throttles without starting the ordinary ray",()=>{
var world=Floor();var p=Player("LV1B",world);var director=new SceneDirector(new("LV1B",[Entity("3JIM","JIM1")]),new TaskStates([]),(_,_)=>1);
var bag=new SceneInventory(new int[19]);bag.SetState(0,3,1);using var ray=new SceneGadgets(director,bag,p,world);
p.GadgetMode=0;for(var i=0;i<20;i++)p.Step(new(false,false,true,false,false,Fire:true));
Check(p.Speed>0&&p.TurnRate>0&&p.Pitch<0&&!ray.Ray.Visible&&!p.Shooting,"shared fire predicate is Bubble throttle, not shoot");
Check(p.Speed>0&&p.TurnRate>0&&MathF.IEEERemainder(p.Pitch,360)<0&&!ray.Ray.Visible&&!p.Shooting,"shared fire predicate is Bubble throttle, not shoot");
});
Test("lava bypass, retained entry and strict4-second debounce",()=>{
var state=new Vr01FloorState();var e=state.Visit(111,0);
+6 -3
View File
@@ -25,7 +25,8 @@ static void Attach()
using var f=new Fixture();f.Attach();
Check(f.G.Attached&&f.G.Attachments==1&&f.P.GadgetMode==7,"owned raw7");
Check(f.P.PhysicsSteps==1&&f.P.ControllerSteps==1,"both phases run once");
Check(f.P.Velocity.Y==100&&f.P.JumpState==0&&!f.G.SwingPose,"attachment impulse and next-input SWING");
Check(f.P.Velocity.Y==-150&&f.P.JumpState==0&&!f.G.SwingPose,
"fresh input writes attachment100 before supported ground apply subtracts250; SWING starts next input");
int body=f.P.PhysicsSteps;f.Binding.Step(default);
Check(f.P.PhysicsSteps==body+1&&f.G.SwingPose&&f.P.Pose==PlayerPose.Swing,"ordinary body and swing pose continue");
Check(float.IsFinite(f.P.ActorRoot.Length()),"finite attached root");
@@ -109,8 +110,10 @@ static void CameraStates()
}
static void Ownership()
{
using var f=new Fixture();f.Attach();var root=f.P.ActorRoot;
f.P.Step(default,false,false);Check(f.G.Attached&&f.G.Equipped&&f.P.ActorRoot!=root,"controlfalse still body, no generic release");
using var f=new Fixture();f.Attach();var physics=f.P.PhysicsSteps;
f.P.Step(default,false,false);
Check(f.G.Attached&&f.G.Equipped&&f.P.PhysicsSteps==physics+1&&f.P.Grounded,
"controlfalse still integrates the supported body without a generic gadget release or invented takeoff");
f.D.ReleasePlayerGadget();Check(!f.G.Attached&&!f.G.Equipped&&f.P.GadgetMode==-1,"namedJimmy selected cleanup");
f.I.Inventory.SelectGadget(7);f.D.Trigger("gr");Check(!f.G.Equipped,"actualVR08 intro MCA/CAM cleanup");
}
@@ -34,5 +34,8 @@
<Compile Include="../../src/GamePort/Game/GrapplerRay.cs" />
<Compile Include="../../src/GamePort/Game/RocketOrientation.cs" />
<Compile Include="../../src/GamePort/Game/OriginalHeading.cs" />
<Compile Include="../../src/GamePort/Game/JimmyGroundMotion.cs"/>
<Compile Include="../../src/GamePort/Game/JimmyAirMotion.cs"/>
<Compile Include="../../src/GamePort/Game/JimmyOrientation.cs"/>
</ItemGroup>
</Project>
@@ -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>
+26
View File
@@ -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"
}
}
@@ -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"
}
@@ -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/Game/JetpackBurst.cs"/>
<None Include="original-jump-reference.json" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
</Project>
+18
View File
@@ -0,0 +1,18 @@
using System.Text.Json;
using GamePort.Game;
using var doc=JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"original-jump-reference.json")));
int compared=0;
foreach(var c in doc.RootElement.GetProperty("cases").EnumerateArray())
{
var p=c.GetProperty("input").EnumerateArray().ToArray();var o=c.GetProperty("observed").EnumerateArray().Select(x=>x.GetSingle()).ToArray();
float F(int i)=>p[i].GetSingle();bool B(int i)=>F(i)!=0;
var input=new JetpackBurstInput(B(3),B(4),F(5),F(6),(int)F(7),F(8),p[9].GetString()!,(int)F(10),F(11),F(12),B(13));
var r=JetpackBurst.Step(new((int)F(0),F(1),F(2)),input);string name=c.GetProperty("name").GetString()!;
Near(r.State.JumpState,o[0],name+" state");Near(r.State.HoldSeconds,o[1],name+" hold");Near(r.State.EffectRemaining,o[2],name+" timer");
Near(r.ImpulseY,o[3],name+" impulse");Near(r.VelocityYOverride??input.VelocityY,o[4],name+" vertical");Near(r.ExtraAccelerationY,o[5],name+" acceleration");
Near((int)r.Pose,o[6],name+" animation");Check(r.StartGadget==(o[7]!=0)&&r.StopGadget==(o[8]!=0),name+" effect calls");
Near(r.RadiusOverride??60,o[9],name+" radius");Check(r.RadiusOverride.HasValue==(o[10]!=0),name+" radius write");compared++;
}
Check(compared==32,"complete native fixture");Console.WriteLine("PASS32 copied-original jump/hold/release/landing/jetpack suffix observations");
static void Check(bool condition,string message){if(!condition)throw new Exception(message);}
static void Near(float a,float b,string message)=>Check(MathF.Abs(a-b)<.0002f,$"{message}: {a} != {b}");
File diff suppressed because it is too large. Load diff
@@ -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/Game/JimmyOrientation.cs"/><Compile Include="../../src/GamePort/Game/RocketOrientation.cs"/>
<None Include="original-orientation-reference.json" CopyToOutputDirectory="PreserveNewest"/>
</ItemGroup>
</Project>
@@ -0,0 +1,24 @@
using System.Numerics;
using System.Text.Json;
using GamePort.Game;
using var doc=JsonDocument.Parse(File.ReadAllText(Path.Combine(AppContext.BaseDirectory,"original-orientation-reference.json")));
int count=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();
var current=new Vector3(p[0],p[1],p[2]);var target=new Vector3(p[3],p[4],p[5]);
bool dirty=p[9]!=0;
for(int i=0;i<(int)p[7];i++)
{
var before=current;current=JimmyOrientation.Step(current,target,p[6],p[8]!=0,dirty);
if(p[8]!=0&&dirty)dirty=before!=target;
}
Check(Vector3.Distance(current,new(o[0],o[1],o[2]))<.001f,$"{c.GetProperty("name").GetString()}: {current} != {o[0]},{o[1]},{o[2]}");count++;
}
Check(count==16,"all original orientation cases");
Console.WriteLine("PASS16 copied-original Jimmy facing observations: shortest arcs,180 boundaries, negative normalization, gate retention and repeated settling");
var retained=new Vector3(0,10,0);JimmyOrientation.Step(new(350),retained,1f/60);
Check(retained==new Vector3(0,10,0),"step does not mutate destination state");
Console.WriteLine("PASS retained target state remains independent of current Euler");
static void Check(bool ok,string name){if(!ok)throw new Exception(name);}
@@ -0,0 +1,374 @@
{
"source_sha256": "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8",
"ranges": [
{
"va": "0x43a420",
"file_offset": "0x3a420",
"length": 431,
"sha256": "e052ee855e625d03a3317dcc7d507081c7519576381afa5741572157e5ffb988"
},
{
"va": "0x458f90",
"file_offset": "0x58f90",
"length": 38,
"sha256": "7f014c2a630c2e257513df09ab56595ad0fdcf892ea623d483148c002c6931c2"
},
{
"va": "0x472480",
"file_offset": "0x72480",
"length": 240,
"sha256": "406c3904538abe07d88ca440e39ca56c00765d0871943991ba7b792da4803c16"
}
],
"constants": {
"0x4afcf0": 3.7,
"0x4afd38": 4.5
},
"scope": "Copied43A420/458F90/472480, synthetic enabled/dirty actor; no original AI/body/game entrypoint.",
"rea_evidence": "ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904",
"files": {
"tools/binary/jimmy_orientation.py": "3dab00935c844af6b8792d87923294ae3eb660e4a0a1744836b02e9e81152964",
"tools/binary/jimmy_orientation_probe.c": "b3c194090e58665fbd071e0515a93221057a8a385b0f34e76e57ee5a9274e241",
"tools/binary/grappler_scalar_probe.c": "c51cc1ecefaf7a90e69a40624fd0e8cd7e01500359c4e67aee6213bb36f4a810",
"artifacts/jimmy-orientation-audit/jimmy_orientation_probe.exe": "b58b0f9bf54c9201abd911a6da75375f9d14422378f3bbf48ff25676b398fc78",
"artifacts/jimmy-orientation-audit/probe/wine.log": "9bc970a46ac7bed33507d4f1388680d478f306667fda3256041fbcdc4f2354b4"
},
"cases": [
{
"name": "ordinary",
"input": [
10.0,
20.0,
30.0,
0.0,
30.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
5.5,
23.7000008,
16.5,
1.0
]
},
{
"name": "level",
"input": [
338.0,
90.0,
338.0,
0.0,
90.0,
0.0,
0.0166666675,
1.0,
1.0,
1.0
],
"observed": [
339.649994,
90.0,
339.649994,
1.0
]
},
{
"name": "seam",
"input": [
359.0,
359.0,
359.0,
1.0,
1.0,
1.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
359.899994,
359.73999,
359.899994,
1.0
]
},
{
"name": "opposite_seam",
"input": [
1.0,
1.0,
1.0,
359.0,
359.0,
359.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
0.0999999642,
0.25999999,
0.0999999642,
1.0
]
},
{
"name": "negative",
"input": [
-20.0,
-10.0,
-30.0,
0.0,
20.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
349.0,
1.10000038,
344.0,
1.0
]
},
{
"name": "equal180",
"input": [
180.0,
180.0,
180.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
99.0,
113.400002,
99.0,
1.0
]
},
{
"name": "positive180",
"input": [
0.0,
0.0,
0.0,
180.0,
180.0,
180.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
81.0,
66.5999985,
81.0,
1.0
]
},
{
"name": "over180",
"input": [
181.0,
181.0,
181.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
261.549988,
247.230011,
261.549988,
1.0
]
},
{
"name": "canonical360",
"input": [
360.0,
360.0,
360.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
360.0,
360.0,
360.0,
1.0
]
},
{
"name": "fractional",
"input": [
0.00100000005,
359.998993,
0.00100000005,
359.998993,
0.00100000005,
359.998993,
0.370000005,
1.0,
1.0,
1.0
],
"observed": [
360.0,
0.00175030529,
360.0,
1.0
]
},
{
"name": "tiny",
"input": [
0.00999999978,
0.00999999978,
0.00999999978,
0.0,
0.0,
0.0,
0.0166666675,
1.0,
1.0,
1.0
],
"observed": [
0.00925000012,
0.00938333292,
0.00925000012,
1.0
]
},
{
"name": "settle",
"input": [
338.0,
359.0,
338.0,
0.0,
1.0,
0.0,
0.0166666675,
120.0,
1.0,
1.0
],
"observed": [
359.998077,
0.999036431,
359.998077,
1.0
]
},
{
"name": "upright",
"input": [
0.0,
90.0,
0.0,
0.0,
90.0,
0.0,
0.100000001,
1.0,
1.0,
1.0
],
"observed": [
0.0,
90.0,
0.0,
0.0
]
},
{
"name": "disabled",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
0.0,
1.0
],
"observed": [
20.0,
90.0,
30.0,
1.0
]
},
{
"name": "clean",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.100000001,
1.0,
1.0,
0.0
],
"observed": [
20.0,
90.0,
30.0,
0.0
]
},
{
"name": "zero_dt",
"input": [
20.0,
90.0,
30.0,
0.0,
0.0,
0.0,
0.0,
1.0,
1.0,
1.0
],
"observed": [
20.0,
90.0,
30.0,
1.0
]
}
]
}
+37 -4
View File
@@ -18,6 +18,7 @@ var tests = new (string Name, Action Check)[]
("turn-only speed, forward acceleration/cap and release", SpeedLimits),
("backpedal cap and release", Backpedal),
("yaw sign, forward half-turn and left precedence", Turning),
("active heading clears stale turn while control lock retains facing", FacingOwnership),
("fixed-step input replay independent of presentation rate", ReplayRates),
("jump rises, falls and returns to support", JumpLanding),
("held zero-burn jump repeats and release stops repetition", HeldJump),
@@ -358,8 +359,9 @@ static void Turning()
left.Step(new(false, false, true, false, false));
right.Step(new(false, false, false, true, false));
forwardLeft.Step(new(true, false, true, false, false));
Check(left.Yaw > 0 && right.Yaw < 0, "left/right yaw signs");
Near(left.Yaw, -right.Yaw, .00001f, "opposed keyboard yaw symmetry");
Check(left.Yaw > 0 && MathF.IEEERemainder(right.Yaw,360)<0, "left/right yaw directions across source wrap");
Near(left.Yaw, 1.2333333f, .00001f, "left facing increment");
Near(right.Yaw, 359, .00001f, "source negative-add truncation at zero seam");
Near(forwardLeft.Yaw, left.Yaw / 2, .00001f, "Up halves target turn offset");
Near(forwardLeft.Speed, 60, 0, "Up plus turn performs both speed increments");
Check(left.Velocity.X < 0 && right.Velocity.X > 0, "keyboard side-velocity signs for next physics pass");
@@ -375,6 +377,37 @@ static void Turning()
SameState(both, leftOnly, "Left has precedence when Left and Right are held together");
}
static void FacingOwnership()
{
var active = FlatSimulation();
var neutral = FlatSimulation();
foreach (var simulation in new[] { active, neutral })
for (var tick = 0; tick < 12; tick++) simulation.Step(new(false, false, true, false, false));
var heading = active.Yaw;
active.Step(new(true, false, false, false, false));
neutral.Step(default);
Near(active.Yaw, heading, .0001f, "Up writes current heading instead of retaining the old turn destination");
Check(neutral.Yaw > heading, "neutral input retains the prior facing destination");
var locked = FlatSimulation();
locked.Step(new(false, false, true, false, false));
locked.PrepareForScript();
var before = locked.Yaw;
locked.Step(new(true, false, false, true, true), controlled: false);
Check(locked.Yaw > before && locked.Speed == 0 && locked.ControllerSteps == 1 && locked.Jumps == 0,
"base facing advances its retained target during control lock while input and jump remain gated");
var tilted = FlatSimulation();
tilted.SeedBubbleTilt(new(350, 0, 10));
tilted.Step(new(true, false, false, false, false));
Check(tilted.Pitch > 350 && tilted.Pitch < 351 && tilted.Roll < 10 && tilted.Roll > 9,
"ground heading levels all axes by the shortest arc through the zero seam");
var pitch = tilted.Pitch;
tilted.Step(default, controlled: false);
Check(tilted.Pitch > pitch && tilted.Roll < 9.25f,
"pitch and roll settling belong to the same control-independent facing phase");
}
static void ReplayRates()
{
LabSimulation? reference = null;
@@ -412,7 +445,7 @@ static void JumpLanding()
Check(sawFall && largestHeight - floor > 100, "jump rises and enters descending phase");
Check(simulation.Grounded && simulation.Jumps == 1 && simulation.Landings == 1, "released jump lands once");
Near(simulation.Position.Y, floor, .01f, "landing returns feet to supporting floor");
Near(simulation.Velocity.Y, 0, 0, "landing clears downward velocity");
Near(simulation.Velocity.Y, 0, 0, "capsule compatibility landing retains its baseline vertical velocity");
}
static void HeldJump()
@@ -489,7 +522,7 @@ static void JetpackControl()
right.Step(new(true, false, false, true, true));
Check(!left.Grounded && left.JetpackEffectVisible, "steering occurs during powered flight");
}
Check(straight.Position.Z > 400 && left.Yaw > 20 && right.Yaw < -20,
Check(straight.Position.Z > 400 && left.Yaw > 20 && MathF.IEEERemainder(right.Yaw,360)<-20,
"powered Up moves from rest and Left/Right turn while airborne");
Check(left.Position.X < -50 && right.Position.X > 50 && left.Position.Y > initialHeight,
"powered paths change direction and retain vertical lift");
@@ -42,5 +42,8 @@
<Compile Include="../../src/GamePort/Game/ScooterCamera.cs"/>
<Compile Include="../../src/GamePort/Game/ScooterMotion.cs"/>
<Compile Include="../../src/GamePort/Game/ScooterWheels.cs"/>
<Compile Include="../../src/GamePort/Game/JimmyGroundMotion.cs"/>
<Compile Include="../../src/GamePort/Game/JimmyAirMotion.cs"/>
<Compile Include="../../src/GamePort/Game/JimmyOrientation.cs"/>
</ItemGroup>
</Project>
+42
View File
@@ -0,0 +1,42 @@
"""Authoritative source guards and copied-original airborne probe provenance."""
from pathlib import Path
import collections,hashlib,json,sys,unittest
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(ROOT/'tools/binary'))
from jimmy_air_motion import collect
from jimmy_air_targets import collect as collect_targets
class JimmyAirMotionEvidence(unittest.TestCase):
def test_destination_writer_original_observations(self):
fixture=json.loads((ROOT/'tests/GamePort.JimmyAirTests/original-air-targets-reference.json').read_text())
actual=collect_targets(ROOT.parent/'Original')
for key in ('source_sha256','ranges','relocations','target_range'):
self.assertEqual(actual[key],fixture[key])
self.assertEqual(len(fixture['cases']),12)
for file,digest in fixture['files'].items():
if file.startswith('tools/'):
self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
# These are recovered target writes, not a live-port conformance claim.
cases=fixture['cases']
self.assertEqual(cases[1]['observed'],[-40,45,0,1])
self.assertEqual(cases[2]['observed'],[10,45,0,1])
self.assertEqual(cases[3]['observed'],[-40,45,0,1])
self.assertEqual(cases[10]['observed'],[0,45,0,1])
self.assertEqual(cases[11]['observed'],[7,45,0,1])
def test_source_identity_ranges_and_offsets(self):
actual=collect(ROOT.parent/'Original');fixture=json.loads((ROOT/'tests/GamePort.JimmyAirTests/original-air-reference.json').read_text())
self.assertEqual(actual['source_sha256'],fixture['source_sha256']);self.assertEqual(actual['ranges'],fixture['ranges'])
self.assertEqual(actual['relocations'],fixture['relocations'])
self.assertEqual(len(actual['ranges']),5)
for row in actual['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
def test_complete_observations_and_generator_provenance(self):
fixture=json.loads((ROOT/'tests/GamePort.JimmyAirTests/original-air-reference.json').read_text())
self.assertEqual(collections.Counter(c['kind'] for c in fixture['cases']),dict(INPUT=22,APPLY=13))
for file,digest in fixture['files'].items():
self.assertEqual(len(digest),64)
if file.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
cases={(c['kind'],c['name']):c for c in fixture['cases']}
self.assertEqual(cases['INPUT','overspeed']['observed'][0],700)
self.assertEqual(cases['INPUT','ground_small']['observed'][0],-12.5)
self.assertEqual(cases['INPUT','no_latch']['observed'][1],20)
self.assertEqual(cases['APPLY','rest']['observed'],[0,0,300,0,0,0,0])
if __name__=='__main__':unittest.main()
+24
View File
@@ -0,0 +1,24 @@
"""Source/provenance guards for original Jimmy keyboard-ground components."""
from pathlib import Path
import collections,hashlib,json,sys,unittest
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(ROOT/'tools/binary'))
from jimmy_ground_motion import collect
class JimmyGroundEvidence(unittest.TestCase):
def test_original_identity_ranges_and_offsets(self):
source=collect(ROOT.parent/'Original');fixture=json.loads((ROOT/'tests/GamePort.JimmyGroundTests/original-ground-reference.json').read_text())
for field in ('source_sha256','dll_sha256','ranges'):self.assertEqual(source[field],fixture[field])
self.assertEqual(len(source['ranges']),6)
for row in source['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
def test_probe_provenance_and_complete_native_observations(self):
fixture=json.loads((ROOT/'tests/GamePort.JimmyGroundTests/original-ground-reference.json').read_text())
for path,digest in fixture['files'].items():
if path.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/path).read_bytes()).hexdigest(),digest)
self.assertEqual(collections.Counter(c['kind'] for c in fixture['cases']),dict(INPUT=17,APPLY=8))
rows={c['name']:c for c in fixture['cases']}
self.assertEqual(rows['overcap']['observed'][0],700)
self.assertEqual(rows['ground']['observed'][1],-237)
self.assertEqual(rows['ground_nopoly']['observed'][1],13)
self.assertEqual(rows['backequal']['observed'][0],-52.5)
self.assertEqual(rows['backturn']['observed'][0],600)
if __name__=='__main__':unittest.main()
+20
View File
@@ -0,0 +1,20 @@
"""Source/range/probe provenance for original Jimmy jump observations."""
from pathlib import Path
import hashlib,json,sys,unittest
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(ROOT/'tools/binary'))
from jimmy_jump_motion import collect
class JimmyJumpEvidence(unittest.TestCase):
def test_original_identity_ranges_and_offsets(self):
f=json.loads((ROOT/'tests/GamePort.JimmyJumpTests/original-jump-reference.json').read_text());s=collect(ROOT.parent/'Original')
self.assertEqual(f['source_sha256'],s['source_sha256']);self.assertEqual(f['ranges'],s['ranges']);self.assertEqual(f['relocations'],s['relocations'])
for r in s['ranges']:self.assertEqual(int(r['file_offset'],16),int(r['va'],16)-0x400000)
self.assertTrue(all(0x400000<=r['target']<0x699000 for r in s['relocations']))
def test_provenance_and_native_threshold_cases(self):
f=json.loads((ROOT/'tests/GamePort.JimmyJumpTests/original-jump-reference.json').read_text());self.assertEqual(len(f['cases']),32)
for file,digest in f['files'].items():
if file.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
cases={c['name']:c for c in f['cases']}
self.assertEqual(cases['hold_equal']['observed'][1],cases['hold_tick']['observed'][1])
self.assertEqual(cases['hold_equal']['observed'][0],3);self.assertEqual(cases['hold_tick']['observed'][0],1)
if __name__=='__main__':unittest.main()
+23
View File
@@ -0,0 +1,23 @@
"""Jimmy facing source/constant identity and copied-original observation provenance."""
from pathlib import Path
import hashlib,json,sys,unittest
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(ROOT/'tools/binary'))
from jimmy_orientation import collect
class JimmyOrientationEvidence(unittest.TestCase):
def test_identity_ranges_offsets_and_double_factors(self):
source=collect(ROOT.parent/'Original');fixture=json.loads((ROOT/'tests/GamePort.JimmyOrientationTests/original-orientation-reference.json').read_text())
for field in ('source_sha256','ranges','constants'):self.assertEqual(source[field],fixture[field])
self.assertEqual(source['constants'],{'0x4afcf0':3.7,'0x4afd38':4.5})
for row in source['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
def test_native_provenance_case_completeness_and_gates(self):
fixture=json.loads((ROOT/'tests/GamePort.JimmyOrientationTests/original-orientation-reference.json').read_text())
self.assertEqual(len(fixture['cases']),16)
for file,digest in fixture['files'].items():
self.assertEqual(len(digest),64)
if file.startswith('tools/'):self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
cases={c['name']:c for c in fixture['cases']}
for name in ('clean','disabled','zero_dt'):self.assertEqual(cases[name]['observed'][:3],cases[name]['input'][:3])
self.assertGreater(cases['level']['observed'][0],338)
self.assertGreater(cases['positive180']['observed'][1],0)
if __name__=='__main__':unittest.main()
+511
View File
@@ -0,0 +1,511 @@
"""Jimmy special material dispatch: source guards and copied-original observations."""
from pathlib import Path
import hashlib,json,sys,unittest,tempfile
ROOT=Path(__file__).resolve().parents[1]
sys.path.insert(0,str(ROOT/'tools/binary'))
from jimmy_special_contact import collect,classify,generate
# Original-code observations are committed here; generated logs remain ignored.
FIXTURE=json.loads(r'''{
"source_sha256": "f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8",
"ranges": [
{
"va": "0x43aa40",
"file_offset": "0x3aa40",
"length": 1443,
"sha256": "2acd114eb62fe67490d9301bc8e68f196830be74eb9076f52f79111467344a78"
},
{
"va": "0x42a7e0",
"file_offset": "0x2a7e0",
"length": 140,
"sha256": "b999b3f9eb20ea2be18843048f8695e34e014e54b989e45f71d4113d9a81cf18"
},
{
"va": "0x42a8d0",
"file_offset": "0x2a8d0",
"length": 72,
"sha256": "88a303b3ae7cca7fc4c3935848077bbaf5393f83ed184b8e042e67803c3c4863"
},
{
"va": "0x43a900",
"file_offset": "0x3a900",
"length": 320,
"sha256": "73185486b7c1f3b972757db81837c495491144623f2944a82d564bb0d72626f4"
},
{
"va": "0x43aff0",
"file_offset": "0x3aff0",
"length": 1456,
"sha256": "5c641e54e5e854c965e652aa2a63d3249de8d0ebe6a3317caeaa5f5ebdac47c6"
}
],
"bindings": [
{
"table": "0x4a3bdc",
"slot": "0x160",
"target": "0x42a7e0"
},
{
"table": "0x4a3bdc",
"slot": "0x164",
"target": "0x42a8d0"
},
{
"table": "0x4a373c",
"slot": "0x374",
"target": "0x42a660"
},
{
"table": "0x4af6c4",
"slot": "0x374",
"target": "0x43aa40"
}
],
"scope": "Copied43AA40 only, synthetic actor/material records, no-op160/164 damage callbacks and miss-only rays. No successful climb, damage, body or game entrypoint.",
"cases": [
{
"input": [
-1.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
59.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
60.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
2
]
},
{
"input": [
69.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
2
]
},
{
"input": [
70.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
109.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
110.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
1,
0
]
},
{
"input": [
119.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
1,
0
]
},
{
"input": [
120.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
1,
0,
0
]
},
{
"input": [
129.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
1,
0,
0
]
},
{
"input": [
130.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
179.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
180.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
1
]
},
{
"input": [
181.0,
4.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
3.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
3.0000999,
0.0,
0.0,
1.0,
1.0
],
"observed": [
1,
0,
0
]
},
{
"input": [
120.0,
2.0,
0.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
4.0,
1.0,
0.0,
1.0,
1.0
],
"observed": [
1,
0,
0
]
},
{
"input": [
110.0,
4.0,
2.0,
0.0,
1.0,
1.0
],
"observed": [
0,
1,
0
]
},
{
"input": [
60.0,
4.0,
1.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
180.0,
4.0,
1.0,
0.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
4.0,
0.0,
1.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
4.0,
0.0,
2.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
4.0,
0.0,
3.0,
1.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
180.0,
4.0,
0.0,
0.0,
0.0,
1.0
],
"observed": [
0,
0,
0
]
},
{
"input": [
120.0,
4.0,
0.0,
0.0,
1.0,
0.0
],
"observed": [
1,
0,
0
]
},
{
"input": [
60.0,
4.0,
0.0,
0.0,
1.0,
0.0
],
"observed": [
0,
0,
2
]
}
],
"files": {
"tools/binary/jimmy_special_contact.py": "bf0d690aa5dd79265718e46ff5bbeca86c7ca0e71a2b894e4ef0515f7cbd8cf1",
"tools/binary/jimmy_special_contact_probe.c": "553e77b6a175cd42a4fbdd98222dcbffed0cf26d4f516a09f982d264c213be95",
"tools/binary/grappler_scalar_probe.c": "c51cc1ecefaf7a90e69a40624fd0e8cd7e01500359c4e67aee6213bb36f4a810",
"artifacts/jimmy-special-contact/jimmy_special_contact_probe.exe": "4a759864c4ea3e9e478af28a6ef4f70f7e48da4102fb6dad3418fb9b02d1c019",
"artifacts/jimmy-special-contact/probe/wine.log": "e680314e9dd8098aa2f4ce3650f0be21072d6ae0e120f5b92b7d3d029a166aa0"
}
}
''')
class JimmySpecialContacts(unittest.TestCase):
def test_source_ranges_bindings_and_offsets(self):
source=collect(ROOT.parent/'Original')
for key in ('source_sha256','ranges','bindings'):self.assertEqual(source[key],FIXTURE[key])
for row in source['ranges']:self.assertEqual(int(row['file_offset'],16),int(row['va'],16)-0x400000)
def test_twenty_seven_original_dispatch_observations(self):
self.assertEqual(len(FIXTURE['cases']),27)
for case in FIXTURE['cases']:
material,elapsed,mode,missing,support,controlled=case['input']
policy=classify(None if missing else int(material),elapsed,int(mode))
actual=[int(policy=='damage160'),int(policy=='damage164'),
2 if policy=='fence_candidate' else 1 if policy=='ladder_candidate' and support else 0]
self.assertEqual(actual,case['observed'],case)
def test_generated_probe_cannot_target_originals_or_symlinks(self):
original=ROOT.parent/'Original'
for target in (original,original/'generated',ROOT.parent):
with self.assertRaises(ValueError):generate(original,target)
with tempfile.TemporaryDirectory() as directory:
root=Path(directory);(root/'jimmy_special_contact_probe.c').symlink_to(original/'Neutron.exe')
with self.assertRaises(ValueError):generate(original,root)
def test_source_provenance(self):
for file,digest in FIXTURE['files'].items():
self.assertEqual(len(digest),64)
if file.startswith('tools/'):
self.assertEqual(hashlib.sha256((ROOT/file).read_bytes()).hexdigest(),digest)
if __name__=='__main__':unittest.main()
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
"""Guard original airborne input/apply and prepare isolated copied-code probes."""
import argparse,hashlib,json,re,struct,subprocess
from pathlib import Path
from checkpoint_script_state import EXE_SHA256,find_case,read_va
from pe_inspect import PE
RANGES=((0x439900,0x439db7),(0x437f90,0x43812a),(0x4723f0,0x472420),(0x472480,0x472570),(0x472b10,0x472c10))
def collect(original):
pe=PE(find_case(Path(original),'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:raise ValueError('Unexpected original EXE')
report=dict(source_sha256=EXE_SHA256,ranges=[dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,
sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES])
targets={0x48d10c}
for a,b in RANGES:
asm=subprocess.run(['objdump','-d','-Mintel',f'--start-address={a}',f'--stop-address={b}',str(pe.path)],capture_output=True,text=True,check=True).stdout
targets.update(int(v,16) for v in re.findall(r'ds:0x([0-9a-f]+)',asm))
report['relocations']=[]
for a,b in RANGES:
data=read_va(pe,a,b-a)
for t in sorted(targets):
report['relocations'].extend(dict(va=a+m.start(),target=t) for m in re.finditer(re.escape(struct.pack('<I',t)),data))
return report
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
report=collect(original);output.mkdir(parents=True,exist_ok=True)
body=Path(__file__).with_name('jimmy_air_motion_probe.c').read_text().replace('/* RELOCATIONS */',','.join('{0x%x,0x%x}'%(r['va'],r['target']) for r in report['relocations']))
(output/'jimmy_air_motion_probe.c').write_text(body);(output/'source.json').write_text(json.dumps(report,indent=2)+'\n');return report
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args()
print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
+65
View File
@@ -0,0 +1,65 @@
/* Copied439900 through ordinary turn cap and437F90 velocity prefix.
Synthetic actor/friction/velocity/mouse; original Euler/trig helpers.
No game entrypoint, body, camera, jump state suffix or audio. */
#define main unused_grappler_main
#include "grappler_scalar_probe.c"
#undef main
typedef struct{float x,y,z,w;}Vec;
static uintptr_t game_table[0x390/4];static Vec velocity;static float friction;static int supported;
#define OF(o) (*(float*)(object+(o)))
#define GF(g,o) (*(float*)((g)+(o)))
static void TC missing(void*self){fprintf(stderr,"MISSING caller=%x self=%x\n",(unsigned)((unsigned char*)__builtin_return_address(0)-mapped+0x400000),(unsigned)self);require(0,"unexpected virtual");}
static Vec*TC get_velocity(void*self,Vec*out){(void)self;*out=velocity;return out;}
static void TC set_velocity(void*self,float x,float y,float z){(void)self;velocity=(Vec){x,y,z,0};}
static float TC get_friction(void*self){(void)self;return friction;}
static int TC get_supported(void*self){(void)self;return supported;}
static void mouse(short*x,short*y){*x=*y=0;}
static void setup(void){
map_source();const struct{uint32_t va,target;}rels[]={/* RELOCATIONS */};
for(unsigned i=0;i<sizeof(rels)/sizeof(rels[0]);i++){
uint32_t v;memcpy(&v,AT(rels[i].va),4);require(v==rels[i].target,"absolute operand");v=(uintptr_t)AT(v);memcpy(AT(rels[i].va),&v,4);
}
HMODULE dll=LoadLibraryA("Z:\\work\\game\\OMT2.dll");require(dll!=NULL,"copied OMT");
*(void**)AT(0x48d10c)=GetProcAddress(dll,"?global@OMediaCosSinTable@@2V1@A");require(*(void**)AT(0x48d10c)!=NULL,"original trig");
jump(AT(0x46a460),mouse);
const unsigned char input_return[]={0x5f,0x5e,0x5d,0x5b,0x83,0xc4,0x7c,0xc2,4,0};memcpy(AT(0x439db7),input_return,sizeof(input_return));
jump(AT(0x43812a),AT(0x4387a1));
for(unsigned i=0;i<sizeof(game_table)/4;i++)game_table[i]=(uintptr_t)missing;
game_table[0x218/4]=(uintptr_t)get_supported;game_table[0x248/4]=(uintptr_t)get_friction;
game_table[0x2bc/4]=(uintptr_t)get_velocity;game_table[0x2c4/4]=(uintptr_t)set_velocity;
game_table[0x328/4]=(uintptr_t)AT(0x4723f0);game_table[0x334/4]=(uintptr_t)AT(0x472480);game_table[0x38c/4]=(uintptr_t)AT(0x472b10);
}
static unsigned char*reset(void){memset(object,0,sizeof(object));unsigned char*g=object+0xc0;*(void**)g=game_table;memset(AT(0x509830),0,0x1d0);return g;}
static void input(const char*name,float speed,float turn,int latch,int up,int down,int left,int right,int ground,float maximum,float dt){
reset();OF(0x6c8)=speed;OF(0x6d4)=turn;OF(0x6bc)=30;OF(0x6c0)=35;OF(0x6c4)=maximum;object[0x6e6]=latch;*(short*)(object+0x7c4)=1;supported=ground;
*AT(0x50985e)=up;*AT(0x509860)=down;*AT(0x50985d)=left;*AT(0x50985f)=right;
((void(TC*)(void*,float))AT(0x439900))(object,dt);
printf("INPUT %s in=%.9g,%.9g,%d,%d,%d,%d,%d,%d,%.9g,%.9g out=%.9g,%.9g,%u\n",name,speed,turn,latch,up,down,left,right,ground,maximum,dt,OF(0x6c8),OF(0x6d4),object[0x6e6]);
}
static void apply(const char*name,float speed,float vx,float vy,float vz,float pitch,float yaw,float roll,float turn,float f,float dt){
unsigned char*g=reset();OF(0x6c8)=speed;OF(0x6d4)=turn;GF(g,0x224)=pitch;GF(g,0x228)=yaw;GF(g,0x22c)=roll;velocity=(Vec){vx,vy,vz,0};friction=f;
((void(TC*)(void*,float))AT(0x437f90))(object,dt);
printf("APPLY %s in=%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g out=%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g\n",name,speed,vx,vy,vz,pitch,yaw,roll,turn,f,dt,velocity.x,velocity.y,velocity.z,GF(g,0x224),GF(g,0x228),GF(g,0x22c),OF(0x6d8));
}
int main(void){
setup();
input("up",300,0,0,1,0,0,0,0,600,.1f);input("overspeed",700,0,0,1,0,0,0,0,600,.1f);
input("coast_high",600,0,0,0,0,0,0,0,600,.1f);input("coast_low",500,0,0,0,0,0,0,0,600,.1f);
input("coast_edge",600*.9090909361839294f,0,0,0,0,0,0,0,600,.1f);
input("down",300,0,0,0,1,0,0,0,600,.1f);input("back_to_zero",-10,0,0,0,1,0,0,0,600,.1f);
input("up_down",300,0,0,1,1,0,0,0,600,.1f);input("up_down_zero",0,0,0,1,1,0,0,0,600,.1f);
input("left",300,0,0,0,0,1,0,0,600,.1f);input("right",300,0,0,0,0,0,1,0,600,.1f);
input("both_turn",300,29,0,0,0,1,1,0,600,.1f);input("turn_cap",300,-29,0,0,0,0,1,0,600,.1f);
input("return",300,20,1,0,0,0,0,0,600,.1f);input("no_latch",300,20,0,0,0,0,0,0,600,.1f);input("return_cross",300,-5,1,0,0,0,0,0,600,.1f);
input("ground_up",300,0,0,1,0,0,0,1,600,.1f);input("ground_small",5,0,0,0,0,0,0,1,600,.1f);
input("ground_negative",-300,0,0,0,0,0,0,1,600,.1f);input("ground_down",300,0,0,0,1,0,0,1,600,.1f);
input("ground_up_down",0,0,0,1,1,0,0,1,600,.1f);input("tick",580,29,1,1,0,1,0,0,600,1.f/60);
apply("rest",300,0,0,0,0,0,0,30,.8f,.1f);apply("rising",300,0,10,0,0,0,0,30,.8f,.1f);
apply("falling",300,0,-10,0,0,90,0,-30,.8f,.1f);apply("forward",300,0,0,300,0,0,0,30,.8f,.1f);
apply("uphill",300,0,-10,300,30,45,0,30,.8f,.1f);apply("downhill",300,0,-10,300,330,45,0,30,.8f,.1f);
apply("roll",300,0,-10,300,0,45,30,30,.8f,.1f);apply("near_seam",300,0,1,0,0,359.5f,0,30,.8f,.1f);
apply("negative_euler",300,0,1,0,-3,-1,-2,30,.8f,.1f);apply("no_friction",300,0,1,0,0,0,0,30,0,.1f);
apply("reverse",-300,0,-10,-300,0,180,0,-20,.8f,.1f);apply("zero_scalar",0,0,-10,300,0,0,0,30,.8f,.1f);
apply("tick",600,10,-13,500,5,179,3,29,.8f,1.f/60);
puts("JIMMY_AIR_MOTION_COMPLETE");return 0;
}
+24
View File
@@ -0,0 +1,24 @@
#!/usr/bin/env python3
"""Extend original airborne input fixture through its destination-Euler write."""
import argparse,hashlib,json
from pathlib import Path
from jimmy_air_motion import collect as air_collect
from checkpoint_script_state import read_va,find_case
from pe_inspect import PE
def collect(original):
r=air_collect(original);pe=PE(find_case(Path(original),'Neutron.exe'));a,b=0x439db7,0x439e33
r['target_range']=dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest())
return r
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
r=collect(original);output.mkdir(parents=True,exist_ok=True)
base=Path(__file__).with_name('jimmy_air_motion_probe.c').read_text().split('static void input(')[0]
base=base.replace('memcpy(AT(0x439db7),input_return','memcpy(AT(0x439e33),input_return')
base=base.replace('/* RELOCATIONS */',','.join('{0x%x,0x%x}'%(v['va'],v['target']) for v in r['relocations']))
(output/'jimmy_air_targets_probe.c').write_text(base+Path(__file__).with_name('jimmy_air_targets_probe.c').read_text())
(output/'source.json').write_text(json.dumps(r,indent=2)+'\n');return r
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args();print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
+19
View File
@@ -0,0 +1,19 @@
/* Full copied439900 through439E2D, synthetic destination writer/velocity/body,
no camera tail, body or game entrypoint. */
static Vec destination;static int writes;
static void TC set_destination(void*self,float x,float y,float z){(void)self;destination=(Vec){x,y,z,0};writes++;}
static void one(int up,int down,int left,int right,float speed,int ground,float forward,float backward){
unsigned char*g=reset();OF(0x6c8)=speed;OF(0x6bc)=30;OF(0x6c0)=35;OF(0x6c4)=600;
OF(0x7ec)=forward;OF(0x7f0)=backward;*(short*)(object+0x7c4)=1;GF(g,0x228)=45;supported=ground;
*AT(0x50985e)=up;*AT(0x509860)=down;*AT(0x50985d)=left;*AT(0x50985f)=right;writes=0;
((void(TC*)(void*,float))AT(0x439900))(object,1.f/60);
printf("TARGET in=%d,%d,%d,%d,%.9g,%d,%.9g,%.9g out=%.9g,%.9g,%.9g,%d\n",up,down,left,right,speed,ground,forward,backward,destination.x,destination.y,destination.z,writes);
}
int main(void){
setup();game_table[0x36c/4]=(uintptr_t)set_destination;
one(0,0,0,0,300,0,-40,10);one(1,0,0,0,300,0,-40,10);one(0,1,0,0,300,0,-40,10);one(1,1,0,0,300,0,-40,10);
one(0,0,1,0,300,0,-40,10);one(0,0,0,1,300,0,-40,10);one(1,0,1,0,300,0,-40,10);
one(0,1,0,1,300,0,-40,10);one(0,1,0,0,0,1,-40,10);one(1,0,0,0,700,1,-40,10);
one(1,0,0,0,300,0,0,0);one(0,1,0,0,300,0,-13,7);
puts("JIMMY_AIR_TARGETS_COMPLETE");return 0;
}
+32
View File
@@ -0,0 +1,32 @@
#!/usr/bin/env python3
"""Original ground input/apply spans and isolated copied-code probe preparation."""
import argparse,hashlib,json,re,struct,subprocess
from pathlib import Path
from checkpoint_script_state import EXE_SHA256,find_case,read_va
from checkpoint_camera_audio_ui import DLL_SHA256
from pe_inspect import PE
RANGES=((0x43915d,0x4395cf),(0x437c40,0x437f7f),(0x4723f0,0x472420),
(0x472480,0x472570),(0x472b10,0x472c10),(0x476ff0,0x477490))
def collect(original):
pe=PE(find_case(Path(original),'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:raise ValueError('Unexpected original EXE')
if hashlib.sha256(find_case(Path(original),'OMT2.dll').read_bytes()).hexdigest()!=DLL_SHA256:raise ValueError('Unexpected original DLL')
return dict(source_sha256=EXE_SHA256,dll_sha256=DLL_SHA256,ranges=[dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,
sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES])
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
report=collect(original);pe=PE(find_case(original,'Neutron.exe'));targets={0x48d104,0x48d108,0x48d10c}
for a,b in RANGES:
asm=subprocess.run(['objdump','-d','-Mintel',f'--start-address={a}',f'--stop-address={b}',str(pe.path)],capture_output=True,text=True,check=True).stdout
targets.update(int(x,16) for x in re.findall(r'ds:0x([a-f0-9]+)',asm))
reloc=[]
for a,b in RANGES:
data=read_va(pe,a,b-a)
for target in sorted(targets):reloc.extend((a+m.start(),target) for m in re.finditer(re.escape(struct.pack('<I',target)),data))
output.mkdir(parents=True,exist_ok=True)
body=Path(__file__).with_name('jimmy_ground_motion_probe.c').read_text().replace('/* RELOCATIONS */',','.join('{0x%x,0x%x}'%r for r in reloc))
(output/'jimmy_ground_motion_probe.c').write_text(body);(output/'source.json').write_text(json.dumps(report,indent=2)+'\n');return report
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args()
print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
+82
View File
@@ -0,0 +1,82 @@
/* Copied43915D keyboard scalar suffix and complete437C40 ground apply.
Synthetic actor/support/animation, original vector/trig, no game entrypoint. */
#define main unused_grappler_main
#include "grappler_scalar_probe.c"
#undef main
typedef struct{float x,y,z,w;}Vec;
static uintptr_t game_table[0x440/4],outer_table[0x180/4];
static Vec velocity,root_position;static unsigned char polygon[64];static int supported,has_polygon;
#define OF(o) (*(float*)(object+(o)))
static Vec*TC get_velocity(void*self,Vec*out){(void)self;*out=velocity;return out;}
static void TC set_velocity(void*self,float x,float y,float z){(void)self;velocity=(Vec){x,y,z,0};}
static Vec*TC get_root(void*self,Vec*out){(void)self;*out=root_position;return out;}
static Vec*TC point(void*self,Vec*out,float x,float y,float z){
Vec*r=((Vec*(TC*)(void*,Vec*,float,float,float))AT(0x472b10))(self,out,x,y,z);r->x+=root_position.x;r->y+=root_position.y;r->z+=root_position.z;return r;
}
static float TC friction(void*self){(void)self;return .8f;}
static int TC support(void*self){(void)self;return supported;}
static void*TC support_polygon(void*self){(void)self;return has_polygon?polygon:NULL;}
static void TC destination(void*self,float x,float y,float z){unsigned char*g=self;*(float*)(g+0x274)=x;*(float*)(g+0x278)=y;*(float*)(g+0x27c)=z;}
static void TC animate(void*self,void*name){(void)self;(void)name;}
static void*input_entry(void){
unsigned char*c=VirtualAlloc(NULL,256,MEM_COMMIT|MEM_RESERVE,PAGE_EXECUTE_READWRITE),*p=c;
emit_byte(&p,0x53);emit_byte(&p,0x55);emit_byte(&p,0x56);emit_byte(&p,0x57);
emit_byte(&p,0x81);emit_byte(&p,0xec);word(&p,0x90);
emit_byte(&p,0xbd);word(&p,(uintptr_t)object); /*ebp complete*/
emit_byte(&p,0x31);emit_byte(&p,0xff); /*edi=0*/
emit_byte(&p,0xba);word(&p,1);emit_byte(&p,0x31);emit_byte(&p,0xf6); /*edx=1,esi=0*/
emit_byte(&p,0xbb);word(&p,(uintptr_t)(object+0x9bc));
const int slots[]={0x14,0x18,0x1c};
for(int i=0;i<3;i++){emit_byte(&p,0xc7);emit_byte(&p,0x44);emit_byte(&p,0x24);emit_byte(&p,slots[i]);word(&p,0);}
jump(p,AT(0x43915d));p+=5;unsigned char*end=p;
emit_byte(&p,0x81);emit_byte(&p,0xc4);word(&p,0x90);emit_byte(&p,0x5f);emit_byte(&p,0x5e);emit_byte(&p,0x5d);emit_byte(&p,0x5b);emit_byte(&p,0xc3);
jump(AT(0x4395cf),end);return c;
}
static void setup(void){
map_source();const struct{uint32_t at,target;}reloc[]={/* RELOCATIONS */};
for(unsigned i=0;i<sizeof(reloc)/sizeof(reloc[0]);i++){uint32_t v;memcpy(&v,AT(reloc[i].at),4);require(v==reloc[i].target,"absolute operand");v=(uintptr_t)AT(v);memcpy(AT(reloc[i].at),&v,4);}
HMODULE dll=LoadLibraryA("Z:\\work\\game\\OMT2.dll");require(dll!=NULL,"copied OMT2");
*(void**)AT(0x48d104)=GetProcAddress(dll,"?quick_magnitude@OMedia3DVector@@QBEMXZ");
*(void**)AT(0x48d108)=GetProcAddress(dll,"?angles@OMedia3DVector@@QAEXAAF0@Z");
*(void**)AT(0x48d10c)=GetProcAddress(dll,"?global@OMediaCosSinTable@@2V1@A");
require(*(void**)AT(0x48d104)&&*(void**)AT(0x48d108)&&*(void**)AT(0x48d10c),"OMT vector exports");
game_table[0x2bc/4]=(uintptr_t)get_velocity;game_table[0x2c4/4]=(uintptr_t)set_velocity;
game_table[0x310/4]=(uintptr_t)get_root;game_table[0x384/4]=(uintptr_t)point;
game_table[0x334/4]=(uintptr_t)AT(0x472480);game_table[0x328/4]=(uintptr_t)AT(0x4723f0);game_table[0x38c/4]=(uintptr_t)AT(0x472b10);
game_table[0x248/4]=(uintptr_t)friction;game_table[0x218/4]=(uintptr_t)support;game_table[0x338/4]=(uintptr_t)support_polygon;game_table[0x36c/4]=(uintptr_t)destination;
outer_table[0x150/4]=(uintptr_t)animate;
}
static void reset(void){
memset(object,0,sizeof(object));*(void**)object=outer_table;*(void**)(object+0xc0)=game_table;
memset(AT(0x509830),0,0x1d0);*(short*)AT(0x4f0588)=-1;*AT(0x4f83e0)=0;*(void**)AT(0x5099e4)=object;
OF(0x6bc)=30;OF(0x6c0)=35;OF(0x6c4)=600;root_position=(Vec){0,0,0,1};
memset(polygon,0,sizeof(polygon));*(float*)(polygon+12)=1;
}
static void input_case(const char*name,void(*run)(void),float speed,int up,int down,int left,int right,float yaw,float hold,int latch){
reset();OF(0x6c8)=speed;OF(0xc0+0x228)=yaw;OF(0x830)=hold;object[0x828]=latch;object[0x850]=down;
*AT(0x50985e)=up;*AT(0x50985d)=left;*AT(0x50985f)=right;run();
printf("INPUT %s in=%.9g,%d,%d,%d,%d,%.9g,%.9g,%d out=%.9g,%.9g,%.9g,%u\n",name,speed,up,down,left,right,yaw,hold,latch,OF(0x6c8),OF(0x870),OF(0xc0+0x278),object[0x828]);
}
static void apply_case(const char*name,float speed,Vec v,float pitch,float yaw,float roll,float turn,float side,int support_in,int poly,float dt){
reset();velocity=v;OF(0x6c8)=speed;OF(0xc0+0x224)=pitch;OF(0xc0+0x228)=yaw;OF(0xc0+0x22c)=roll;OF(0x6d4)=turn;OF(0x870)=side;supported=support_in;has_polygon=poly;
((void(TC*)(void*,float))AT(0x437c40))(object,dt);
printf("APPLY %s in=%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%.9g out=%.9g,%.9g,%.9g,%.9g\n",name,speed,v.x,v.y,v.z,pitch,yaw,roll,turn,side,support_in,poly,dt,velocity.x,velocity.y,velocity.z,OF(0xc0+0x228));
}
int main(void){
setup();void(*input)(void)=input_entry();
input_case("up",input,0,1,0,0,0,90,0,0);input_case("left",input,0,0,0,1,0,90,0,0);input_case("right",input,0,0,0,0,1,90,0,0);
input_case("upleft",input,100,1,0,1,0,90,0,0);input_case("upright",input,100,1,0,0,1,90,0,0);input_case("bothturn",input,100,1,0,1,1,90,0,0);
input_case("back",input,0,0,1,0,0,90,0,0);input_case("all",input,100,1,1,1,1,90,0,0);input_case("release",input,100,0,0,0,0,90,0,0);
input_case("negative",input,-20,0,0,0,0,90,0,0);input_case("cross",input,20,0,0,0,0,90,0,0);
input_case("overcap",input,700,1,0,0,0,90,0,0);input_case("turnovercap",input,700,1,0,1,0,90,0,0);
input_case("backcap",input,-299,0,1,0,0,90,0,0);input_case("backequal",input,0,0,1,0,0,90,1.5f,0);input_case("backturn",input,0,0,1,0,0,90,1.51f,0);input_case("latched",input,0,0,1,1,0,90,2,1);
apply_case("rest",300,(Vec){0,0,0,0},0,0,0,0,0,0,0,.1f);
apply_case("stationaryturn",300,(Vec){0,0,0,0},0,0,0,20,0,0,0,.1f);
apply_case("side",300,(Vec){0,0,0,0},0,0,0,0,-1000,0,0,.1f);
apply_case("turn",300,(Vec){1,0,0,0},0,0,0,20,0,0,0,.1f);
apply_case("tilt",300,(Vec){0,13,1,0},30,45,20,0,0,0,0,.1f);
apply_case("ground",300,(Vec){0,13,1,0},0,0,0,0,0,1,1,.1f);
apply_case("ground_nopoly",300,(Vec){0,13,1,0},0,0,0,0,0,1,0,.1f);
apply_case("fall",300,(Vec){0,-13,1,0},0,0,0,0,0,0,1,.1f);
puts("JIMMY_GROUND_COMPLETE");return 0;
}
+39
View File
@@ -0,0 +1,39 @@
#!/usr/bin/env python3
"""Guard/capture original437F90 jump suffix using the airborne prefix harness."""
import argparse,hashlib,json,re,struct,subprocess
from pathlib import Path
from checkpoint_script_state import EXE_SHA256,find_case,read_va
from pe_inspect import PE
RANGES=((0x437f90,0x4387d8),(0x4723f0,0x472420),(0x472480,0x472570),(0x472b10,0x472c10))
def collect(original):
pe=PE(find_case(Path(original),'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:raise ValueError('Unexpected original EXE')
report=dict(source_sha256=EXE_SHA256,ranges=[dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,
sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES])
targets={0x48d10c,0x4387ac,0x4387c4,0x4f0608,0x4ef3e8,0x4eca60,0x4f05ec,0x4f05f4}
for a,b in RANGES:
asm=subprocess.run(['objdump','-d','-Mintel',f'--start-address={a}',f'--stop-address={b}',str(pe.path)],capture_output=True,text=True,check=True).stdout
targets.update(int(v,16) for v in re.findall(r'ds:0x([0-9a-f]+)',asm))
#Jump table bytes are data; reject spurious disassembled absolute operands.
targets={t for t in targets if 0x400000<=t<0x699000}
report['relocations']=[]
for a,b in RANGES:
data=read_va(pe,a,b-a)
for t in sorted(targets):
report['relocations'].extend(dict(va=a+m.start(),target=t) for m in re.finditer(re.escape(struct.pack('<I',t)),data))
return report
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
report=collect(original);output.mkdir(parents=True,exist_ok=True)
#Reuse only synthetic actor/trig setup; retain the entire original jump suffix.
shared=Path(__file__).with_name('jimmy_air_motion_probe.c').read_text().split('static void input(')[0]
shared=shared.replace('jump(AT(0x43812a),AT(0x4387a1));','')
shared=shared.replace('/* RELOCATIONS */',','.join('{0x%x,0x%x}'%(r['va'],r['target']) for r in report['relocations']))
body=Path(__file__).with_name('jimmy_jump_motion_probe.c').read_text()
(output/'jimmy_jump_motion_probe.c').write_text(shared+body)
(output/'source.json').write_text(json.dumps(report,indent=2)+'\n');return report
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args()
print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
+69
View File
@@ -0,0 +1,69 @@
/* Appended to airborne fixture setup. Full copied437F90, synthetic actor/world,
effect timer, jump/support, animation and inventory; no game entrypoint/body. */
static uintptr_t outer_table[0x180/4];
static unsigned char fire_effect[0x700],level_object[0x500];
static Vec acceleration,impulse;static int jump_button,inventory,pose,start_calls,stop_calls,radius_calls;static float radius;
static Vec*TC root(void*self,Vec*out){(void)self;*out=(Vec){0,100,0,1};return out;}
static Vec*TC get_accel(void*self,Vec*out){(void)self;*out=acceleration;return out;}
static void TC set_accel(void*self,float x,float y,float z){(void)self;acceleration=(Vec){x,y,z,0};}
static void TC set_impulse(void*self,float x,float y,float z){(void)self;impulse=(Vec){x,y,z,0};}
static void TC set_radius(void*self,float r){(void)self;radius=r;radius_calls++;}
static int TC jump_held(void*self){(void)self;return jump_button;}
static void TC nop(void*self){(void)self;}
static void TC start(void*self,int kind){(void)self;require(kind==2,"start gadget selector");start_calls++;}
static void TC stop(void*self){(void)self;stop_calls++;}
static void TC animation(void*self,const char*name){(void)self;pose=!strcmp(name,"JUMP")?1:!strcmp(name,"FALL")?2:!strcmp(name,"FLY")?3:0;require(pose!=0,"animation alias");}
static void TC animation_loop(void*self,const char*name,int loop){require(loop==1,"loop flag");animation(self,name);}
static int get_item(int group,int item){require(group==0&&item==3,"jetpack inventory slot");return inventory;}
static void log_nop(const char*format,...){(void)format;}
static void gauge(float value){(void)value;}
static void extend(void){
for(int i=0;i<6;i++){uint32_t*v=(void*)AT(0x4387ac+i*4);*v=(uintptr_t)AT(*v);}
for(int i=0;i<5;i++){uint32_t*v=(void*)AT(0x4387c4+i*4);*v=(uintptr_t)AT(*v);}
jump(AT(0x403950),get_item);jump(AT(0x472970),log_nop);jump(AT(0x4037f0),gauge);
for(unsigned i=0;i<sizeof(outer_table)/4;i++)outer_table[i]=(uintptr_t)missing;
outer_table[0xe0/4]=(uintptr_t)animation_loop;outer_table[0x150/4]=(uintptr_t)animation;
outer_table[0x138/4]=(uintptr_t)start;outer_table[0x140/4]=(uintptr_t)stop;
outer_table[0x148/4]=(uintptr_t)nop;outer_table[0x158/4]=(uintptr_t)jump_held;
game_table[0x270/4]=(uintptr_t)get_accel;game_table[0x278/4]=(uintptr_t)set_accel;
game_table[0x28c/4]=(uintptr_t)set_impulse;game_table[0x264/4]=(uintptr_t)set_radius;game_table[0x310/4]=(uintptr_t)root;
*(void**)AT(0x509948)=level_object;F(0x5cfc04)=-800;
}
static void one(const char*name,int state,float hold,float burn,int ground,int jump,float vy,float shadow,int item,float energy,const char*level,int gadget,float dt,float extra,int effect){
reset();*(void**)AT(0x509948)=level_object;*(void**)object=outer_table;memset(fire_effect,0,sizeof(fire_effect));
*(short*)(object+0x7e8)=state;*(short*)(object+0x7c4)=1;OF(0x874)=hold;OF(0x86c)=shadow;OF(0x884)=8;
*(void**)(object+0x7f8)=effect?fire_effect:NULL;*(float*)(fire_effect+0x6c0)=burn;
supported=ground;jump_button=jump;inventory=item;pose=start_calls=stop_calls=radius_calls=0;radius=60;
acceleration=(Vec){3,extra,5,0};impulse=(Vec){0,0,0,0};velocity=(Vec){0,vy,0,0};friction=.8f;
F(0x4f83d4)=energy;*(short*)AT(0x4f0588)=gadget;
*(uint32_t*)(level_object+0x490)=((uint32_t)level[0]<<24)|((uint32_t)level[1]<<16)|((uint32_t)level[2]<<8)|level[3];
((void(TC*)(void*,float))AT(0x437f90))(object,dt);
printf("JUMP %s in=%d,%.9g,%.9g,%d,%d,%.9g,%.9g,%d,%.9g,%s,%d,%.9g,%.9g,%d out=%d,%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%d,%.9g,%d\n",name,state,hold,burn,ground,jump,vy,shadow,item,energy,level,gadget,dt,extra,effect,*(short*)(object+0x7e8),OF(0x874),*(float*)(fire_effect+0x6c0),impulse.y,velocity.y,acceleration.y,pose,start_calls,stop_calls,radius,radius_calls);
}
int main(void){
setup();extend();
for(int state=0;state<=5;state++)for(int held_=0;held_<=1;held_++){
char n[40];sprintf(n,"state%d_%s",state,held_?"held":"released");one(n,state,.2f,4,0,held_,20,200,1,100,"LV1B",-1,.1f,-264,1);
}
one("takeoff",0,0,0,1,1,0,75.9f,0,100,"LV1B",-1,1.f/60,0,1);
one("land_held",3,.7f,4,1,1,-40,75.9f,1,100,"LV1B",-1,.1f,880,1);
one("land_state5",5,.7f,4,1,1,-40,75.9f,1,100,"LV1B",-1,.1f,880,1);
one("hold_equal",1,.3f,0,0,1,200,200,1,100,"LV1B",-1,.1f,-264,1);
one("hold_exact_input",1,.4f,0,0,1,200,200,1,100,"LV1B",-1,0,-264,1);
one("hold_tick",1,23.f/60,0,0,1,200,200,1,100,"LV1B",-1,1.f/60,-264,1);
one("hold_over",1,.4f,0,0,1,200,200,1,100,"LV1B",-1,.001f,-264,1);
one("no_inventory",2,.2f,0,0,1,-20,200,0,100,"LV1B",-1,.1f,-264,1);
one("disabled_inventory",2,.2f,0,0,1,-20,200,4,100,"LV1B",-1,.1f,-264,1);
one("no_energy",2,.2f,0,0,1,-20,200,1,0,"LV1B",-1,.1f,-264,1);
one("tutorial_bypass",2,.2f,0,0,1,-20,200,0,0,"VR04",6,.1f,-264,1);
one("blocked_level",2,.2f,0,0,1,-20,200,1,100,"LEV3",-1,.1f,-264,1);
one("blocked_gadget",2,.2f,0,0,1,-20,200,1,100,"LV1B",7,.1f,-264,1);
one("expired_3",3,.2f,0,0,1,-20,200,1,100,"LV1B",-1,.1f,-264,1);
one("expired_4",4,.2f,-.1f,0,0,-20,200,1,100,"LV1B",-1,.1f,-264,1);
one("null_effect",2,.2f,0,0,1,-20,200,1,100,"LV1B",-1,.1f,-264,0);
one("far_burn",3,.2f,4,0,1,-20,500,1,100,"LV1B",-1,.1f,-264,1);
one("near_fall",3,.2f,4,0,1,-2,499,1,100,"LV1B",-1,.1f,-264,1);
one("near_edge",3,.2f,4,0,1,-1,499,1,100,"LV1B",-1,.1f,-264,1);
one("fraction_extra",1,.2f,4,0,0,20,200,1,100,"LV1B",-1,.1f,17.75f,1);
puts("JIMMY_JUMP_MOTION_COMPLETE");return 0;
}
+22
View File
@@ -0,0 +1,22 @@
#!/usr/bin/env python3
"""Guard Jimmy43A420 facing and generate its isolated copied-code probe."""
import argparse,hashlib,json,re,struct
from pathlib import Path
from checkpoint_script_state import EXE_SHA256,find_case,read_va
from pe_inspect import PE
RANGES=((0x43a420,0x43a5cf),(0x458f90,0x458fb6),(0x472480,0x472570))
def collect(original):
pe=PE(find_case(Path(original),'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:raise ValueError('Unexpected original EXE')
return dict(source_sha256=EXE_SHA256,ranges=[dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,
sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES],
constants={hex(a):struct.unpack('<d',read_va(pe,a,8))[0] for a in (0x4afcf0,0x4afd38)})
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
report=collect(original);output.mkdir(parents=True,exist_ok=True)
(output/'source.json').write_text(json.dumps(report,indent=2)+'\n')
(output/'jimmy_orientation_probe.c').write_text(Path(__file__).with_name('jimmy_orientation_probe.c').read_text());return report
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args()
print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
+41
View File
@@ -0,0 +1,41 @@
/* Copied43A420/458F90/472480 facing, synthetic enabled/dirty actor.
No original game entrypoint, body, AI targets or renderer. */
#define main unused_grappler_main
#include "grappler_scalar_probe.c"
#undef main
static uintptr_t table[0x340/4];
#define OF(o) (*(float*)(object+(o)))
static void fix(uint32_t start,uint32_t end){
const uint32_t targets[]={0x48d914,0x48e5b0,0x48e5c0,0x48e5c4,0x4afcf0,0x4afd38};
for(uint32_t at=start;at+4<=end;at++){
uint32_t v;memcpy(&v,AT(at),4);
for(unsigned i=0;i<sizeof(targets)/4;i++)if(v==targets[i]){v=(uintptr_t)AT(v);memcpy(AT(at),&v,4);at+=3;break;}
}
}
static void run(const char*name,float x,float y,float z,float tx,float ty,float tz,float dt,int ticks,int enabled,int dirty){
memset(object,0,sizeof(object));*(void**)object=table;object[5]=enabled;object[10]=dirty;
OF(0x224)=x;OF(0x228)=y;OF(0x22c)=z;OF(0x274)=tx;OF(0x278)=ty;OF(0x27c)=tz;
for(int i=0;i<ticks;i++)((void(TC*)(void*,float))AT(0x43a420))(object,dt);
printf("ORIENT %s in=%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%.9g,%d,%d,%d out=%.9g,%.9g,%.9g,%u\n",name,x,y,z,tx,ty,tz,dt,ticks,enabled,dirty,OF(0x224),OF(0x228),OF(0x22c),object[10]);
}
int main(void){
map_source();fix(0x43a420,0x43a5cf);fix(0x472480,0x472570);
const unsigned char ready[]={0xb0,1,0xc3};memcpy(AT(0x475ca0),ready,3);table[0x334/4]=(uintptr_t)AT(0x458f90);
run("ordinary",10,20,30,0,30,0,.1f,1,1,1);
run("level",338,90,338,0,90,0,1.f/60,1,1,1);
run("seam",359,359,359,1,1,1,.1f,1,1,1);
run("opposite_seam",1,1,1,359,359,359,.1f,1,1,1);
run("negative",-20,-10,-30,0,20,0,.1f,1,1,1);
run("equal180",180,180,180,0,0,0,.1f,1,1,1);
run("positive180",0,0,0,180,180,180,.1f,1,1,1);
run("over180",181,181,181,0,0,0,.1f,1,1,1);
run("canonical360",360,360,360,0,0,0,.1f,1,1,1);
run("fractional",.001f,359.999f,.001f,359.999f,.001f,359.999f,.37f,1,1,1);
run("tiny",.01f,.01f,.01f,0,0,0,1.f/60,1,1,1);
run("settle",338,359,338,0,1,0,1.f/60,120,1,1);
run("upright",0,90,0,0,90,0,.1f,1,1,1);
run("disabled",20,90,30,0,0,0,.1f,1,0,1);
run("clean",20,90,30,0,0,0,.1f,1,1,0);
run("zero_dt",20,90,30,0,0,0,0,1,1,1);
puts("JIMMY_ORIENTATION_COMPLETE");return 0;
}
+35
View File
@@ -0,0 +1,35 @@
#!/usr/bin/env python3
"""Read-only Jimmy material-contact evidence and isolated dispatcher probe."""
import argparse,hashlib,json,struct
from pathlib import Path
from checkpoint_script_state import EXE_SHA256,find_case,read_va
from pe_inspect import PE
RANGES=((0x43aa40,0x43afe3),(0x42a7e0,0x42a86c),(0x42a8d0,0x42a918),(0x43a900,0x43aa40),(0x43aff0,0x43b5a0))
BINDINGS=((0x4a3bdc,0x160,0x42a7e0),(0x4a3bdc,0x164,0x42a8d0),(0x4a373c,0x374,0x42a660),(0x4af6c4,0x374,0x43aa40))
def collect(original):
pe=PE(find_case(Path(original),'Neutron.exe'))
if hashlib.sha256(pe.data).hexdigest()!=EXE_SHA256:raise ValueError('Unexpected original EXE identity')
for table,slot,target in BINDINGS:
if struct.unpack('<I',read_va(pe,table+slot,4))[0]!=target:raise ValueError('Changed contact binding')
return dict(source_sha256=EXE_SHA256,ranges=[dict(va=hex(a),file_offset=hex(pe.offset(a-pe.base)),length=b-a,sha256=hashlib.sha256(read_va(pe,a,b-a)).hexdigest()) for a,b in RANGES],bindings=[dict(table=hex(t),slot=hex(s),target=hex(a)) for t,s,a in BINDINGS])
def classify(material,elapsed,mode):
if elapsed<=3:return 'none'
if material is None:return 'none'
if 120<=material<=129:return 'damage160'
if 110<=material<=119:return 'damage164'
if mode!=0:return 'none'
if 60<=material<=69:return 'fence_candidate'
if material==180:return 'ladder_candidate'
return 'none'
def generate(original,output):
original=Path(original).resolve();output=Path(output).resolve()
if output.is_relative_to(original) or original.is_relative_to(output):raise ValueError('Separate output required')
if output.exists() and any(p.is_symlink() for p in output.rglob('*')):raise ValueError('Generated output contains symlinks')
report=collect(original);output.mkdir(parents=True,exist_ok=True)
source=Path(__file__).with_name('jimmy_special_contact_probe.c').read_text()
(output/'jimmy_special_contact_probe.c').write_text(source)
(output/'source.json').write_text(json.dumps(report,indent=2)+'\n');return report
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('original',type=Path);p.add_argument('--generate-probe',type=Path);a=p.parse_args()
print(json.dumps(generate(a.original,a.generate_probe) if a.generate_probe else collect(a.original),indent=2))
@@ -0,0 +1,41 @@
/* Copied43AA40 with synthetic actor/material, no-op damage callbacks and miss-only
ray. Tests dispatch/gates only, not damage or fence/ladder successful entry. */
#define main unused_grappler_main
#include "grappler_scalar_probe.c"
#undef main
typedef struct{float x,y,z,w;}Vec;
static uintptr_t outer[0x170/4],game[0x390/4];
static unsigned char polygon[32],material[32],chunk[32],support_shape[32];
static int damage160,damage164,rays,has_support;
static void TC hit160(void*self,Vec normal){(void)self;require(normal.x==1&&normal.w==1,"normal passed intact");damage160++;}
static void TC hit164(void*self){(void)self;damage164++;}
static Vec*TC root(void*self,Vec*out){(void)self;*out=(Vec){100,50,100,1};return out;}
static Vec*TC local(void*self,Vec*out,float x,float y,float z){(void)self;*out=(Vec){x,y,z,1};return out;}
static void*TC support(void*self){(void)self;return has_support?support_shape:NULL;}
static int ray(void){rays++;return 0;}
static void fix(void){
const uint32_t data[]={0x48e5a0,0x48d400,0x4afd40,0x48e5ec};
for(uint32_t at=0x43aa40;at+4<=0x43afe3;at++){
uint32_t v;memcpy(&v,AT(at),4);for(unsigned i=0;i<4;i++)if(v==data[i]){v=(uintptr_t)AT(v);memcpy(AT(at),&v,4);at+=3;break;}
}
jump(AT(0x47c210),ray);
}
static void one(int id,float elapsed,int mode,int missing,int support_on,int controlled){
memset(object,0,sizeof(object));*(void**)object=outer;unsigned char*g=object+0xc0;*(void**)g=game;
*(float*)(g+0x774)=elapsed;*(short*)(g+0x704)=mode;*(int*)(chunk+8)=id;
*(void**)(polygon+4)=missing==2?NULL:material;*(void**)(material+0xc)=missing==3?NULL:chunk;
*(void**)AT(0x5099e4)=controlled?g:NULL;has_support=support_on;damage160=damage164=rays=0;
((void(TC*)(void*,Vec,void*))AT(0x43aa40))(g,(Vec){1,0,0,1},missing==1?NULL:polygon);
printf("CONTACT in=%d,%.9g,%d,%d,%d,%d out=%d,%d,%d\n",id,elapsed,mode,missing,support_on,controlled,damage160,damage164,rays);
}
int main(void){
map_source();fix();outer[0x160/4]=(uintptr_t)hit160;outer[0x164/4]=(uintptr_t)hit164;
game[0x310/4]=(uintptr_t)root;game[0x338/4]=(uintptr_t)support;game[0x384/4]=(uintptr_t)local;
const int ids[]={-1,59,60,69,70,109,110,119,120,129,130,179,180,181};
for(unsigned i=0;i<sizeof(ids)/sizeof(ids[0]);i++)one(ids[i],4,0,0,1,1);
one(120,3,0,0,1,1);one(120,3.0001f,0,0,1,1);one(120,2,0,0,1,1);
one(120,4,1,0,1,1);one(110,4,2,0,1,1);one(60,4,1,0,1,1);one(180,4,1,0,1,1);
one(120,4,0,1,1,1);one(120,4,0,2,1,1);one(120,4,0,3,1,1);
one(180,4,0,0,0,1);one(120,4,0,0,1,0);one(60,4,0,0,1,0);
puts("JIMMY_SPECIAL_CONTACT_COMPLETE");return 0;
}