Restore tutorial return placement and source terrain collision eligibility

This commit is contained in:
UnixNight committed 2026-10-25 01:30:09 -04:00
1 parent ca08c468ba
commit 8d60a68511
36 files changed
+991 -69

No files matched your search

+10 -7
View File
@@ -2,7 +2,7 @@
This checkpoint implements deterministic static geometric collision against the
extracted original scene. It is **not the recovered original collision solver**.
The original collision masks, class activation rules, shape selection, tolerances,
Remaining collision masks, class activation rules, tolerances,
step handling and controller state integration are still unresolved. No original
runtime comparison establishes collision fidelity.
@@ -12,8 +12,10 @@ runtime comparison establishes collision fidelity.
`5a33d11311fc222631eb8f7384d1863192cb1f55f7e67035caa0ae12fd9892ab`.
The existing read-only extractor produces
`artifacts/extracted/level1b/scene.json` in unchanged original Y-up world units:
8,607 expanded vertices and 2,869 triangles. Collision uses **all nondegenerate
source triangles**, independent of `Mesh.Draws`, texture or material resolution.
8,607 expanded vertices and 2,869 triangles. Collision now excludes the18
triangles of shape94 ncwater, following the recovered NC shape-name gate at
44DD2F..44DD70. All2,851 other nondegenerate source triangles remain eligible,
independent of `Mesh.Draws`, texture or material resolution.
The actual lab has no degenerate triangles removed by this rule. Mesh vertex/index
arrays and original files are not modified.
@@ -27,10 +29,11 @@ collision mask. Rendering visibility alone is therefore not used to discard them
The regression creates a mesh with no visible draws and proves its original
triangles still block movement.
No decorative surface is excluded at this checkpoint: there is insufficient
specific evidence for a general exclusion rule. This conservative policy can block
on decorative surfaces or invisible proxies that original state/activation logic
would disable. Animated/dynamic scene entities are not added to this static mesh.
The NC exclusion is a shape-name prefix rule, not a material heuristic. The shape
metadata already exists in prepared scene mesh records; vertex/index/render data
is preserved. Other activation/mask rules remain unresolved. See water-collision.md
and underground-route.md for source bytes and the actual passage regression.
Animated/dynamic scene entities are not added to this static mesh.
There is no invented room-sized collision box or coordinate clamp.
## Capsule coordinates and API
+5 -3
View File
@@ -120,7 +120,9 @@ and SCENE exactly35 at0x4365ED..FD. Only that gate performs:
1. Active Jimmy complete+0x1E8 at0x43662C, resolved through complete vtable
0x4A3BDC to0x42AF00: capture current level code and physics root at complete
+0x1E48/+0x1E38. The port emits CheckpointCaptured(root); it does not guess
that this is the unidentified TSK StoredVector or change a STRT checkpoint.
that this is TSK StoredVector or change a STRT checkpoint. Follow-up recovery
identifies StoredVector as the separate departure root at+9A8; see
runtime-checkpoint.md.
2. SCENE50 assignment0x436632..639.
3. Inventory setter0x4038C0(group0,item3,state1) at0x43663E..644.
4. Help/item-information page0 via0x406F90(0), call0x43664B.
@@ -186,8 +188,8 @@ flags at0x4F7D00, stores the selector0x4F8194 and sets flag[objective]=1. Releva
lab milestones35/50/60 select1/2/3;65 does not replace the selector. The port
maps all44 supplied milestone states (including140/141 selecting8), exposes
CurrentObjective/ObjectiveChanged, and saves the selector in OtherCounter.
The lab stationary objective panel and practice modal are integrated; timed UI
slides/highlights and remaining objective consumers are separate work.
The objective timer/slide/O behavior and practice modal are integrated;
practice highlights and remaining objective consumers are separate work.
### Verification and boundaries
+8 -3
View File
@@ -198,8 +198,11 @@ The checkpoint filter immediately returns false when polygon material is null
(`0x4794E8..0x4794ED`). **Null material is therefore retained for static collision**,
even though it is skipped by drawing. This directly supports retaining the lab's
325 unresolved-material triangles. The actual LV1B materials contain no
`cstart`/`ccheck*` names, so all2,869 source triangles reach this registration
path. No general "decorative" name filter was found in it.
`cstart`/`ccheck*` names. Follow-up recovery of the CALLER at44DD2F..44DD70
shows that NC-prefixed shape names skip464B00 entirely: shape94 ncwater's18
triangles are excluded, leaving2,851 registered source triangles. The polygon
function itself has no general decorative-material filter. See water-collision.md
for source bytes, vtable path and the distinction between shape and material names.
Two grids are populated: all polygons at base `0x5CFC7C` and a wall/ceiling grid
at `0x509B24` when stored polygon normal.Y is strictly below0.7
@@ -289,7 +292,9 @@ All13 groups pass: original-DLL math bit references; source winding/two-sided
override; strict endpoint/start; nearest/tie identity; root/velocity/acceleration;
height guard independent of velocity;0.1 factor boundary; crossed-geometry query
lift; disabled geometry; invalid input; ten-second gravity stability/jump; actual
2869 lab triangles including invisible proxies and predicted root76.448635.
2869 raw lab triangles including invisible proxies and predicted root76.448635.
That standalone raw-array support test does not apply registration masks; the
integrated OriginalScenePhysics now omits NC shapes before support/wall queries.
tools/binary/collision_mode2_probe.c builds with local i686-w64-mingw32-gcc and
runs only via tools/recon/reference_capture.py --asset-probe --probe-executable
+127
View File
@@ -0,0 +1,127 @@
# Practice RETURN position and independent Jimmy checkpoint
Read-only static recovery, 2026-10-25. Neutron.exe SHA-256:
f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8.
Text/data VAs below map to file offsets VA-0x400000. The distinction between
Jimmy's complete object and its interface at complete+C0 is essential here.
## Three separate pieces of state
| Complete-object fields | Recovered purpose | Evidence |
| --- | --- | --- |
|+724/+774|Current/requested STRT and secondary saved string|43B6A7..43B6E0, TSK writer460057..46006F|
|+88C/+8F0|RETURN level filename and STRT strings|43B6F8..43B758, LOAD457FB9..45815C|
|+9A8/+9AC/+9B0/+9B4|Saved departure root, fourth vector component; first three floats serialized as TSK StoredVector|43B7B1..43B7CC, writer46008B..4600B0, reader460B9E..460BBA|
|+954|Suppress the matching STRT's initial trigger once|RETURN458014, STRT4427F2..44282A/442887..4428AD|
|+9A5|Preserve saved departure root during RETURN staging and restore it on PostLoad|RETURN458028, transition43B78E..43B7CF, Jimmy423A90..423B24|
|+1E38..+1E47 and+1E48|Independent Jimmy checkpoint root and level FourCC|42AF00..42AF4E and42AF50..42AFB7|
The earlier unknown TSK StoredVector can now be identified as the saved transition
departure root. It is not Jimmy42AF00's+1E38 checkpoint and is not an arbitrary
full save of the current player position. Existing wire names and layout remain
unchanged; unknown values still round-trip without normalization.
## Ordinary departure captures the live root
Jimmy complete vtable4A3BDC+168 points to Player43B5A0. After staging all four
level/start strings,43B78E checks byte[complete+9A5]. If zero,43B798..43B7A9 invokes
the player interface's virtual310 root getter.43B7B1..43B7CC copies its16 bytes to
complete+9A8. If9A5 is nonzero, the branch jumps directly to43B7CF and retains the
previous root. The routine then schedules level loading through game virtual100
at43B7E1..43B7F1. No yaw, camera or full physics state is captured by this block.
The practice Yes branch4046AF stages VR04/PHONEBOOTH with current level/STRT as
return strings. The saved root must therefore be captured when accepting the
practice transition, from the live player root at that point. Merely keeping
the original STARTEXP coordinates cannot reproduce RETURN placement.
## RETURN preserves and restores that root
LOAD's RETURN branch calls Jimmy's gadget cleanup slot178 at457FF7, sets
complete+954 to1 at458014 and complete+9A5 to1 at458028. It resolves the stored
return strings and calls the same transition virtual168 at45815C. Since9A5 is
already set,43B5A0 does not replace the lab's saved root with the tutorial exit.
Jimmy PostLoad first applies the requested STRT's authored position and rotation.
At423A90 it tests interface+8E5 (=complete+9A5). When nonzero it clears the byte
at423A9E, passes interface+8E8/8EC/8F0 (=complete+9A8/9AC/9B0) to the root setter
virtual16C at423ABF, and updates the attached companion root at423AE3..423B1E.
The pending return flag is consumed. The requested STRT's authored yaw remains;
there is no separate saved departure yaw in this path.
The companion receives the **identical saved root**, with no added offset. At
423AE3..423B09 the16-byte stack argument is copied directly from
interface+8E8/+8EC/+8F0/+8F4. The receiver at[interface+95C] is Jimmy complete+A1C,
the Goddard complete pointer created by423C98->41C810 and stored at423CAE.
423B12 addsC0 and423B1E calls Goddard interface+168. Goddard's vtable49F480+168
is471680, which forwards the XYZ components unchanged to virtual16C=471630,
the ordinary root setter. No rotation is passed. Restore the available Goddard
actor to the same saved root as Jimmy; let his own130*.3 support settle his Y
afterward rather than adding a gstart/forward offset. Goddard follow-state4
behavior remains independently incomplete.
STRT PostLoad compares its tag with player complete+724 and checks complete+954.
When that flag is set,4427F2..44280D clears it without scheduling the initial
trigger or clearing player control. Without the flag,442819 sets its deferred
trigger byte and44282A clears control. The alternate no-valid-trigger path also
clears954 at442887..4428A4. Returning to STARTEXP must suppress LABEXP entirely;
fast-forwarding the intro would still execute its authored actor/task effects.
## Why the TSK vector is the same departure root
The writer45FEE0 finds JIM1 with474070 at460043. That lookup returns the animated
interface, so its three float writes from+8E8/+8EC/+8F0 at46008B..4600B0 correspond
to complete+9A8/+9AC/+9B0. The loader explicitly converts controlled interface to
complete by subtractingC0 at460A79, reads three floats at460B6F..460B9C, and writes
complete+9A8/+9AC/+9B0 at460BA3/460BAD/460BBA. This resolves the apparent different
offsets on the two sides of the wire format.
The wire format does not serialize954/9A5. An explicit scan of the supplied EXE's
9A5 and interface8E5 operands finds constructor reset4376C8, staging check43B78E,
RETURN setter458028 and PostLoad test/clear423A90/423A9E. Direct TSK loader4603F0
does not itself set the pending-return flag. The current fresh --load-save STRT
spawn policy therefore stays separate from a live RETURN continuation; a stored
nonzero vector alone must not force player placement or suppress scene triggers.
Broader menu/load paths and original runtime comparison remain unverified.
## The independent pickup checkpoint remains separate
Jimmy complete vtable+1E8 points to42AF00. It captures the current game level
FourCC at complete+1E48 and root at complete+1E38.42AF50 repeats that capture and
calls an attached effect callback. The lab jet pack pickup invokes42AF00 before
SCENE35->50 and opening practice. No consumer of those two capture fields has
been established by this recovery. Their exact future use must not be invented
from the name checkpoint or conflated with RETURN/TSK departure state.
## Implementation and tests
Game/RuntimeCheckpoint.Stage(storedRoot,currentRoot,returning) selects the live
root for an ordinary departure and preserves the stored root for RETURN. Its
Returning and ActivateStartTrigger flags describe only that transition; they are
not serialized. Finite input checks reject invalid runtime state while preserving
all finite original coordinates. Source consumers still own scene loading,
root/companion placement and trigger scheduling.
```
source scripts/env.sh
dotnet run --project tests/GamePort.CheckpointTests -- ../Original
```
The test checks decisive original instruction bytes/vtable addresses, independent
checkpoint versus return offsets, a lab->serialized VR04->RETURN lifecycle, and
all12 original TSK byte round-trips. Runtime integration now carries RETURN identity
through SceneContinuation, captures live roots when requesting ordinary transitions
and writes them into TSK snapshots. LabSimulation restores exact XYZ without floor
snapping; SceneDirector suppresses the STRT trigger rather than fast-forwarding it.
Goddard receives the same root with his rotation retained.
`dotnet run -- --headless --smoke-practice-return` exercises lab -> VR04 -> lab with
three actual renderer initializations. It walks45 input steps before departure,
then uses explicit source pickup/exit contacts (not a navigation replay). The saved
departure differs from STARTEXP by more than100 horizontal units; RETURN must
restore that exact root and the companion, retain yaw155 and have control with no
active intro. These assertions occur before the returned scene's first physics
tick, keeping placement distinct from support settling. Movement/director tests
also check unsupported-root settling and one-time trigger suppression.
Static recovery and managed/headless checks do not establish original or native
Windows runtime fidelity. Complete companion follow-state behavior remains open.
+6 -3
View File
@@ -82,7 +82,9 @@ the argument addresses and literal targets are certain. Modal1/2/3 dispatch
VR03/VR02/VR01 respectively, so type0 must not be routed toVR01.
Runtime checkpoint42AF00 captures the current level code and a16-byte
actor root into Jimmy+1E48/+1E38 separately. This does not prove the
meaning of the saved TSK StoredVector or justify overwriting it.
meaning of the saved TSK StoredVector by itself. Follow-up43B5A0/RETURN/TSK
recovery proves that vector is the separate departure root at+9A8; see
runtime-checkpoint.md for capture/restore and initial-trigger suppression.
No path404D1E hides practice elements, clears4F8198, disables cursor and
unpauses main game virtual168(0); yes continues into the level transition.
@@ -129,5 +131,6 @@ Follow-up field tracing confirms the meaning of the two staged return arguments:
Therefore source modal0 Yes preserves current `level1b.gam`/`STARTEXP` as the
return pair for the normal NewGame route, while entering VR04/PHONEBOOTH.
Its separately captured checkpoint root and unknown TSK StoredVector remain
distinct evidence; a new PHONEBOOTH return marker must not be invented.
Its separately captured pickup checkpoint root and TSK departure root remain
distinct. RETURN restores the latter after applying the requested STRT yaw and
suppresses that STRT's initial trigger; no new PHONEBOOTH marker is invented.
+84
View File
@@ -0,0 +1,84 @@
# Lab underground passage replay
2026-10-25. Deterministic managed integration using original LV1B source geometry,
STRT, switches and bars. This is a port navigation check; no original executable
was run and no original files were modified. Full collision/cadence fidelity and
progression into this fixture are not established by this replay.
## Fixture and original records
The player begins at the original STRT `riverlab` at approximately
(3785.4702,-1040.4089,-2597.4324), yaw0. SCENE65 is an explicit initial task fixture,
assigned before constructing the director. It is not a recovered task award or a
claim that the preceding port story already reaches65. NewGame supplies all other
save values. The separate underground LOAD remains untouched; its SCENE65 gate
and level1.gam/riverlab destination are recorded in lab-progression.md.
Original bar root is (3810.1970,-1076.0883,-1180.4956), duration5 seconds,
OpenAmount500 and OpenTime3. Both distinct `C3DBUTTON` actors target these bars
with Toggle-1. The higher/near-door switch is approximately
(3401.5176,-987.4839,-1198.4617); the lower/river switch is
(4059.9485,-1195.6429,-1921.8291). Source state machine addresses, sound lifetime,
strict contact/timeout and duplicate-tag handling are in buttons-doors.md.
## Input route and assertions
`tests/GamePort.UndergroundRouteTests` uses the same live player/director/contact,
mechanism, NPC patrol and dynamic-door collision consumers as the existing lab
route. Only the initial authored STRT supplies the player position. Subsequent
movement comes from `PlayerInput`; every step checks finite, continuous movement,
control ownership and the absence of a positional warp.
The modern test follower walks to the lower switch, centers before the arched
masonry, crosses the raised bars, approaches the upper switch, recenters and
returns through the doorway. Heading tolerance6 degrees, waypoint arrival30
units and90 release ticks between legs are test input choices, not original AI.
A naive diagonal approach catches the actual arched entrance edge, so approaching
the center before advancing is material to this navigation test.
Both switches must enter DOWN through real player contacts. The original bars
must reach their full500-unit opening. At each of the two gate-plane crossings,
the current source box's minimumY must exceed the live capsule's head, so the test
cannot pass merely by walking through a still-obstructing moving gate. The live
source-gated dynamic resolver runs on every player step. After returning,1200
released ticks establish cooldown reset and timed closure. SCENE, score and
transition destination must remain unchanged by this button route.
A separate negative query tests the reclosed gate using the replay's actual
standing root height, with an80-unit sphere sweep from gateZ-100 to gateZ-20.
It must enter the recovered dynamic broadphase and be blocked at gateZ-76 or
farther away. This query never assigns or repositions the live player and is not
represented as an extra input-navigation leg. The narrowphase remains the explicit
modern adapter documented in dynamic-collision.md.
## Water collision defect exposed and corrected
Before the NC shape exclusion was implemented, the first simulation step raised
the riverlab actor85.89 units from its real floor to the `ncwater` plane at
Y-1006.045. Actor root then stood at about-930.095. Its146-unit vertical difference
from the reclosed bar root exceeded the original normal-body broadphase limit140
(2*doorRadius40 + JimmyRadius60), silently skipping closed-bar tests.
The original level loader excludes shapes whose names begin NC from terrain
registration; it is not a generic water-material guess. The recovered rule is now
consumed by both capsule terrain and source body support. See water-collision.md
for binary addresses and direct source regressions. The route's first-step guard
rejects that former rise. Corrected live root height stays near-1016, allowing the
closed-gate negative query to exercise both source broadphase and provisional
narrowphase. Full water/swimming gameplay remains a separate system.
## Verification
From GamePort:
```
source scripts/env.sh
dotnet run --project tests/GamePort.UndergroundRouteTests -- ../Original
```
Pass recorded in artifacts/underground-route.log:2763 steps,4153.21 horizontal
travel,0 jumps,3 small support landings,1.79 maximum rise,14 masonry wall hits,
grounded final feet (3814.5361,-1092.0243,-2058.7490). Both gate crossings have
clearance, both switches reset UP and the bars reclose. This establishes the
managed port route from its explicit fixture, not a native-platform GPU test,
whole-game progression or source-identical movement/response.
+80
View File
@@ -0,0 +1,80 @@
# NC shape collision registration
Static original EXE/OMT evidence, 2026-10-25. Original files were read only; no
original instructions were executed. This corrects the earlier statement in
original-collision.md that all 2,869 lab triangles reach static registration.
The polygon registration function has no general decorative-material filter,
but its caller omits entire shapes whose names begin with NC.
## Recovered call path
Addresses are preferred Neutron.exe VAs. For these `.text` addresses the file
offset is VA minus 0x400000. EXE SHA-256:
f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8.
LV1B initialization calls game complete-object slot 0x158 at **0x44F569**.
CLevel01BGame complete vtable **0x4C3CD0**, slot 0x158, resolves to **0x44DBF0**.
That shared scene loader iterates original shape resources, using 0x477BA0
(which explicitly requests `3DSh` at 0x477BC2) and the resource's shape name.
Its string is derived from the shape's database metadata at 0x44DC65 onward.
For each terrain object, after assigning its source shape, it tests:
- 0x44DD27: lowercase the first name character with 0x47F9B9.
- 0x44DD2F: compare against `n` (0x6E); other names take InitPhysics.
- 0x44DD5C: lowercase the second name character.
- 0x44DD64: compare against `c` (0x63).
- **0x44DD67**: equality jumps to 0x44DD70, bypassing the InitPhysics call.
- 0x44DD69..0x44DD6D: ordinary names call terrain interface slot **0x2C**.
C3DTerrain interface vtable **0x4D4CCC**, slot 0x2C, is **0x464B00**.
That function reads the assigned shape and calls static registration **0x479140**
at **0x464B18**. Omitting InitPhysics therefore excludes the whole NC shape
from both static collision grids, including the support-ray grid.
0x47F9B9 is the CRT lowercase routine; its default ASCII path maps A..Z by +32
(0x47F9CC..0x47F9DE). The equivalent ASCII prefix rule is case-insensitive.
The other shared scene loaders retain the same gate: 0x44D4F0 checks at
0x44D62F/0x44D664 and skips 0x44D66D; 0x44D810 checks at 0x44D94F/0x44D984
and skips 0x44D98D. Rendering setup and material processing continue after the
gate. This is a **shape-name rule**, not a material-name, visibility or alpha rule.
Do not delete NC geometry from rendering or use a substring/material heuristic.
## Actual supplied geometry
| Archive | Shape ID/name | Payload file offset | Size | Excluded triangles |
| --- | --- | --- | --- | --- |
| level1b.omt | 94 / ncwater | 353257 | 2162 | 18 |
| level1.omt | 172 / ncwater | 1962491 | 2398 | 20 |
| level1.omt | 174 / ncwater2 | 1163215 | 310 | 2 |
| level1.omt | 178 / ncwater3 | 1111837 | 310 | 2 |
Lab source/draw geometry remains **2,869** triangles. Static registered geometry
is **2,851**, including all **325 null-material triangles**. VR04 has no NC-named
shapes. level1b.omt SHA-256 is
5a33d11311fc222631eb8f7384d1863192cb1f55f7e67035caa0ae12fd9892ab;
level1.omt SHA-256 is
a1b525c433c613fc7e63b8fa69abb51a7a91565dce78970745afe158a05e7f6b.
Lab shape 94 includes the large horizontal surface at Y=-1006.0449829101562
covering X=3342.3577..4225.8027 and Z=-3466.2422..2431.9878. Material 181 is
also named ncwater, but that coincidence is not the source registration gate.
Treating this shape as solid lets the provisional capsule overlap correction
push the riverlab player up onto that water plane. Excluding its static collision
has direct source support; the observed pop alone would not justify a filter.
## Reproduction and limits
Run `python3 tools/binary/water_collision_evidence.py` from GamePort for nine
instruction-byte checks, two direct vtable checks and source geometry counts.
`python3 -m unittest discover -s tests -p test_water_collision.py -v` passes both
groups, including ASCII case variants, prefix versus substring and preservation
of null-material lab proxies. Generated facts: artifacts/water-collision-evidence.json.
MeshPolygonSource now obtains shape names from prepared mesh records; its
TerrainCollision flag filters both SceneCollision and OriginalScenePhysics support
without changing source/render arrays. The managed underground replay verifies
both open passage and a closed source-gated box query at the corrected root height.
These facts establish source collision
eligibility, not a complete original sphere solver, water hazard/swimming behavior,
NPC phase order or original runtime comparison. Those remain separate work.