Compare commits
3
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7818cc8d64 | ||
|
|
7656bb69ad | ||
|
|
f0be8504dd |
No files matched your search
@@ -1,7 +1,10 @@
|
||||
# Neutron GamePort
|
||||
|
||||
Follow `../AGENTS.md` and `../prompt.MD`. This is the local Git repository.
|
||||
Do not configure a remote, push, upload originals or use cloud CI.
|
||||
User workflow update (2026-11-05): push completed, verified commits to the
|
||||
existing `Gitea` remote; `main` tracks `Gitea/main`. This supersedes earlier
|
||||
no-remote/no-push rules. Keep builds/tests local; do not upload originals or
|
||||
generated packages or use cloud CI.
|
||||
Originals are in `../Original/` and must remain byte-identical; verify using
|
||||
`python3 tools/recon/inventory.py ../Original --verify docs/original-manifest.json`.
|
||||
|
||||
|
||||
@@ -1,5 +1,17 @@
|
||||
# Compatibility and validation
|
||||
|
||||
Turning/fire feedback (2026-11-05): source left/right turn clips restored for
|
||||
low-speed grounded turning; jetpack fire now shares full owner pitch/yaw/roll
|
||||
and visual alignment. Player visual/movement/data/director/jetpack/Python checks
|
||||
pass, native Linux flight and both clip previews render with zero Vulkan errors.
|
||||
Full source morph timing/native Windows comparison remain open. Details:
|
||||
[turn/fire](gameplay/jimmy-turn-fire-fixes.md).
|
||||
|
||||
Turn/fire packages: clean f0be850,519 original copies and4285 prepared files each.
|
||||
Standalone Linux powered flight and turn previews pass with five identical
|
||||
readbacks and zero validation errors;539 originals unchanged. Windows has build/
|
||||
resource verification only. Runtime identity is retained in package BUILD-INFO.
|
||||
|
||||
Body contact foundation (2026-11-05): finite XYZW publication, independent body
|
||||
modes, static-context retention and landing callback ownership implemented.100
|
||||
full native numeric outputs and six state/branch comparisons pass; existing
|
||||
|
||||
+8
-1
@@ -1,9 +1,16 @@
|
||||
# Decisions
|
||||
|
||||
User workflow update (2026-11-05): completed, verified milestones are now pushed
|
||||
to the existing `Gitea` remote at `https://gitea.unixnight.com/UnixNight/Neutron.git`
|
||||
on `main`. This explicit user instruction supersedes earlier local-only Git
|
||||
restrictions in prompt.MD and AGENTS.md. Builds/tests remain local; original
|
||||
assets and generated packages stay excluded.
|
||||
|
||||
1. **Preserve input directory.** Keep Original in place, baseline all file hashes,
|
||||
generate outputs elsewhere. No legacy binary execution in the source directory.
|
||||
2. **Nested local repository.** Workspace `.git` is reserved and not a functioning
|
||||
repository. Initialize GamePort/.git, no remotes, commit code/docs/tools only.
|
||||
repository. Initialize GamePort/.git, commit code/docs/tools only. The original
|
||||
no-remote rule is superseded by the user workflow update below.
|
||||
3. **Evidence-first data recovery.** Native x86 executable does not imply little
|
||||
endian formats: GAM and OMT use big endian metadata. Require bounded readers,
|
||||
full consumption and real original-file regressions.
|
||||
|
||||
@@ -0,0 +1,119 @@
|
||||
# Jimmy grounded turning poses
|
||||
|
||||
Recovered 2026-11-05 for restoring turn animation without replacing the recently
|
||||
recovered movement implementation. All addresses are preferred-base EXE VAs;
|
||||
the corresponding file offsets below are VA minus `0x400000` for this image.
|
||||
Original files remain untouched.
|
||||
|
||||
## Evidence and confidence
|
||||
|
||||
**Recovered static facts:** retained REA original EXE disassembly
|
||||
`artifacts/jimmy-movement-audit/rea-original-disassembly.json`, evidence
|
||||
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`;
|
||||
EXE SHA-256
|
||||
`f5281076e1a2492f2d61f87aae3f4544b6d0f535ebe33f9fbb6f78710fe1aea8`.
|
||||
`tools/binary/jimmy_turn_animation.py` checks fixed range hashes, source strings,
|
||||
thresholds and actual ASE identities. JN-Engine's original `C3DJimmy.md` index
|
||||
was a constructor/resource lead; its replacement movement is not evidence here.
|
||||
|
||||
## State owners and selection
|
||||
|
||||
Jimmy's complete actor owns signed speed `+0x6C8` and signed short side substate
|
||||
`+0x82A`; the game interface is complete actor `+0xC0`, so these become `+0x608`
|
||||
and `+0x76A` inside `437940`.
|
||||
|
||||
| Source VA / file offset | Recovered behavior |
|
||||
| --- | --- |
|
||||
| `438F6E / 38F6E` | Ground input handler clears complete `82A`. This is an input-phase write, not an unconditional player-update reset. |
|
||||
| `4391BD / 391BD` | Keyboard Right writes `+1` to `82A`. |
|
||||
| `439230 / 39230` | Keyboard Left writes `-1`; keyboard Left wins when both directions are held. |
|
||||
| `437A8C / 37A8C`, `437AA8 / 37AA8` | Jump-held and unsupported cases leave the ordinary grounded selection path. Existing control/global busy gates also precede this path. |
|
||||
| `437AC9 / 37AC9` | Compare **signed speed** with float **10.0**, stored at `48E5EC / 8E5EC`. Speed `>10` requests `RUN` regardless of side substate. |
|
||||
| `437B18 / 37B18` | For speed `<=10`, read side substate. Zero proceeds to the existing primary-action/STOP decision. |
|
||||
| `437B68 / 37B68`, `437B7E / 37B7E` | Side `-1` requests `LEFT` if complete vtable `+15C` predicate is false. |
|
||||
| `437B85 / 37B85`, `437B91 / 37B91` | Other nonzero side requests `RIGHT` if the same predicate is false. |
|
||||
| `437B72 / 37B72`, `437B85 / 37B85` | True primary-action predicate suppresses that side pose request, retaining the current action rather than switching to a turn. |
|
||||
|
||||
`+15C` binds to `42A7A0 / 2A7A0`: global `4F83E0` makes it false;
|
||||
otherwise it returns OR of bytes `509834`, `509845`, `509849`, `509AC4`.
|
||||
Mapping this to the port's ordinary Fire input is a scoped implementation
|
||||
interpretation, not a claim that every original input source is now reproduced.
|
||||
|
||||
Ground input also writes `82A` for analog/mouse and camera-timer paths at
|
||||
`439021`, `43904C`, `43907D`, `4390AD`, `439104`, `43914C`. Restoring keyboard
|
||||
turn animation need not add or retune these movement paths. Preserve the field
|
||||
across the project's already recovered input/player ordering; clearing it in a
|
||||
pose getter would destroy the source state relationship.
|
||||
|
||||
## Animation request versus acceptance
|
||||
|
||||
Complete vtable `+150` binds to the Jimmy animation selector `43AFF0`; requests
|
||||
above are not unconditional playback switches.
|
||||
|
||||
* `43AFF8–43B00E / 3AFF8–3B00E`: compare requested/current logical animation name;
|
||||
the identical-name case returns at `43B597`, preserving animation time.
|
||||
* `43B273–43B284 / 3B273–3B284`: compare complete signed speed `6C8` with zero.
|
||||
X87 C0 test branches to `43B597` for negative speed (also unordered), before
|
||||
STOP/FALL/LEFT/RIGHT handling. **Backpedal therefore must keep BACK precedence**
|
||||
even when `437940` would otherwise request a turn. Explicit BACK handling is
|
||||
earlier at `43B227–43B270`.
|
||||
* `43B32A–43B375 / 3B32A–3B375`: LEFT request calls action helper `+148`, then
|
||||
generic start `+E0(LEFT,1)` at `43B351`, and clears body acceleration XYZ.
|
||||
* `43B378–43B3C3 / 3B378–3B3C3`: RIGHT mirrors it, generic start at `43B39F`.
|
||||
|
||||
The start argument **1** is directly observed, also used for RUN and BACK.
|
||||
Looping these sustained poses in the existing port player is the bounded
|
||||
interpretation. Full original generic animation frame/end semantics and special
|
||||
HIT/SPLAT/FENCE/LADDER guards are outside this small restoration; do not replace
|
||||
the complete animation selector with a newly invented priority table.
|
||||
|
||||
## Resources and playback contract
|
||||
|
||||
Constructor `422AC0` registers `HILEFT` with `jimleft.ase` through pushes
|
||||
`422B42 / 22B42` and `422B47 / 22B47`; the corresponding RIGHT registration is
|
||||
`422B56 / 22B56` and `422B5B / 22B5B`. Strings live at `4EF250`, `4EF248`,
|
||||
`4EF238`, `4EF230`. Generic animation start `40DD90` prefixes logical names
|
||||
with `HI` in the high-detail path (`40DE95`, HI string `4ED3DC`), producing the
|
||||
registered identifiers. Low-detail prefix is `LOW`, not `LO`.
|
||||
|
||||
Both supplied turn ASE files contain one `01jimmy` mesh, **6 samples**, times
|
||||
`0,480,960,1440,1920,2400`, **10 fps**, **480 ticks/frame**, and **426 vertices**
|
||||
per sample. They have 814 faces but no UVs; extract with textured `jimstop.ase`
|
||||
as the morph base, retaining its face/UV topology as existing morph extraction
|
||||
already does. This is not a separate skeletal animation or a yaw transform.
|
||||
|
||||
Implementation contract for ordinary controlled grounded movement:
|
||||
|
||||
1. Retain the source side substate as input state, Left `-1`, Right `+1`, zero
|
||||
on each actual ground-input call; retain state between phases.
|
||||
2. Existing jump/air/control/action ownership keeps precedence. Keep BACK for
|
||||
negative travel. Positive speed above 10 keeps RUN.
|
||||
3. At nonnegative speed up to 10, side state selects matching LEFT/RIGHT unless
|
||||
primary action owns the request. Zero direction follows existing idle/action.
|
||||
4. Load `jimleft` and `jimright` with `jimstop` topology, loop through the existing
|
||||
morph player, and avoid restarting the same clip on every update.
|
||||
5. Do not change physical yaw, body target, acceleration, jump or jetpack rules
|
||||
merely to make the clips appear. The current turn-only keyboard behavior
|
||||
reaches speed zero after its existing acceleration/coast logic; forward plus
|
||||
turn normally exceeds the RUN threshold.
|
||||
|
||||
## Implementation and verification boundary
|
||||
|
||||
Before this restoration, `LabSimulation.Pose` had no turn poses, the preview
|
||||
library had no LEFT/RIGHT mapping, and the preparation default omitted both
|
||||
files. Parent integration owns those runtime/extractor changes and their C#
|
||||
regressions. This investigation changes no gameplay code.
|
||||
|
||||
The helper validates immutable original identity and static evidence, and parses
|
||||
the real turn ASEs. It does **not** run original code, launch the original game,
|
||||
or claim Linux/Windows visual verification. Runtime checks should cover idle
|
||||
turn/release, both directions, forward+turn RUN, backpedal+turn BACK, jump/air
|
||||
priority, action suppression, repeated-pose time continuity, and an actual scene
|
||||
view. Remaining questions: source generic playback timing/end behavior and all
|
||||
special-action interactions beyond this bounded ordinary pose restoration.
|
||||
|
||||
Reproduce the evidence guard from `GamePort/`:
|
||||
|
||||
```sh
|
||||
python3 tools/binary/jimmy_turn_animation.py ../Original
|
||||
```
|
||||
@@ -0,0 +1,68 @@
|
||||
# Turning animations and rotating jetpack fire
|
||||
|
||||
2026-11-05. User requests restoring turning animation and reports that jetpack
|
||||
fire does not follow Jimmy's rotation. Movement/physics arithmetic is preserved.
|
||||
|
||||
## Changes and evidence
|
||||
|
||||
[Turning recovery](jimmy-turn-animation.md) records REA instruction evidence,
|
||||
original addresses/offsets, source animation acceptance and supplied clip hashes.
|
||||
`jimleft.ASE`/`jimright.ASE` each contain six original morph samples. They were
|
||||
missing from default preparation and runtime pose/action mapping. Preparation
|
||||
now exports them with jimstop's topology/UVs; the player loads LEFT/RIGHT, retains
|
||||
the input-owned side field, and chooses the matching clip when grounded at
|
||||
nonnegative speed≤10. Forward movement above10 retains RUN, negative travel keeps
|
||||
the existing backpedal path, and takeoff/air/primary-action ownership takes
|
||||
precedence. Repeated requests retain the same clip/time. Existing generic morph
|
||||
loop timing remains its separately documented port policy.
|
||||
|
||||
The retained REA EXE disassembly Evidence
|
||||
`ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904`
|
||||
also covers jetpack42204C..4220BC (file2204C..220BC): owner310 returns its root,
|
||||
then effect314 copies it; owner328 returns full Euler, then effect32C copies it.
|
||||
Focused instructions are retained in artifacts/jimmy-turn-fire/fire-follow.asm.
|
||||
The old JetpackVisuals used a yaw-only matrix. It now samples the original fire
|
||||
morph through the same model transform as Jimmy, including pitch/yaw/roll and the
|
||||
shared local sole-alignment correction. That correction is explicitly modern;
|
||||
sharing it preserves original relative attachment instead of leaving the flame
|
||||
in another visual frame. Geometry, scale, timer, visibility and energy are not
|
||||
retuned. Exact final OMT matrix decomposition/animation cadence remain open.
|
||||
|
||||
## Verification
|
||||
|
||||
New PlayerVisualTests exercise both source six-frame clips, pose selection,
|
||||
left precedence, release/run/jump/primary ownership, actual morph advancement and
|
||||
same-pose time continuity. Fire tests compare the actual vertex buffer through
|
||||
three combined rotations/translations, preserve unit determinant, and verify
|
||||
hidden/reset behavior. The former movement assertion requiring idle while turning
|
||||
now expects the left clip.28 movement groups, original-data/Director regressions,
|
||||
14 jetpack groups, the new visual groups and333 Python tests pass; build has zero
|
||||
warnings/errors. The source turn guard passes. These are bounded source and port
|
||||
checks, not whole-original gameplay or native Windows comparison.
|
||||
|
||||
Native Linux GTX1070/private Xvfb replays pass the300-step right-mouse jetpack
|
||||
sequence and both original turn-clip previews at1920×1080, zero Vulkan validation
|
||||
errors. Forward/braking flame captures and the left clip were visually inspected;
|
||||
flame orientation now follows the owner rather than remaining vertical. New
|
||||
visual tests cover actual runtime pose selection as well as the sampled mesh.
|
||||
Artifacts: artifacts/jimmy-turn-fire/window/. Native Windows and exact original
|
||||
morph timing remain separate verification boundaries.
|
||||
|
||||
## Final packages
|
||||
|
||||
Both self-contained packages identify clean runtime commit
|
||||
`f0be8504ddc4d740ccd8d9c92b97856dfedb4a16`. Each contains519 verified original
|
||||
copies and4285 matching prepared files, including both six-frame turn clips.
|
||||
The539 originals remain unchanged. Package identities and hashes are retained
|
||||
in artifacts/jimmy-turn-fire/package-identity.json.
|
||||
|
||||
Standalone Linux apphost checks from /tmp with SDK environment variables unset
|
||||
pass the powered SDL replay and both turn previews. All five GPU readbacks match
|
||||
the development captures byte for byte; all three runs report zero Vulkan
|
||||
validation errors. Logs and comparisons are retained as package-*.log and
|
||||
package-readbacks.json in the same artifact directory. The first explicit-scene
|
||||
preview invocation omitted its required GAM argument and exited before rendering;
|
||||
the corrected invocation supplies the matching level and original camera.
|
||||
Windows is cross-published and resource-verified; native Windows runtime checks
|
||||
remain outstanding. Package BUILD-INFO retains the runtime commit above; this
|
||||
validation record is added after packaging.
|
||||
@@ -1,5 +1,29 @@
|
||||
# Progress — 2026-11-05
|
||||
|
||||
Workflow update: the user authorizes pushing completed, verified commits to the
|
||||
existing `Gitea/main` upstream from now on. See docs/decisions.md and AGENTS.md.
|
||||
|
||||
## Turning animation and jetpack attachment feedback
|
||||
|
||||
Restored supplied six-frame jimleft/jimright clips to default preparation and
|
||||
runtime pose/action selection. Standing/slow turns select the source direction;
|
||||
forward running, backpedal, jump and primary action retain precedence. The input
|
||||
side field is retained between its ground-input updates; repeating a pose does
|
||||
not restart its clip. JetpackVisuals now shares Jimmy's full visual transform,
|
||||
including pitch/roll and the modern local alignment, fixing yaw-only fire.
|
||||
|
||||
New player visual groups,28 movement/14 jetpack, original-data/Director checks,
|
||||
333 Python tests and source guard pass; build is clean. Native Linux powered
|
||||
replay and both turn previews pass with zero Vulkan errors; captured flame tilt
|
||||
was inspected. Source facts/modern alignment and timing limits:
|
||||
[turn/fire fix](gameplay/jimmy-turn-fire-fixes.md). Body hazard/climb recovery
|
||||
remains the subsequent priority; this feedback fix changes no movement physics.
|
||||
|
||||
Both packages identify clean runtime f0be850; each verifies519 original copies
|
||||
and4285 prepared resources. Standalone Linux flight/turn checks from /tmp pass
|
||||
with five byte-identical development readbacks and zero Vulkan errors.539 source
|
||||
originals remain unchanged. Windows is cross-published, not runtime-verified.
|
||||
|
||||
## Body root/mode ownership checkpoint
|
||||
|
||||
Implemented the next Jimmy body prerequisites while keeping lab/outside capsule
|
||||
|
||||
@@ -46,6 +46,10 @@ compile, runtime and original-fidelity verification are separate.
|
||||
|
||||
## Immediate continuation
|
||||
|
||||
- [x] User feedback: restore original left/right turning animations and fix jetpack
|
||||
fire following pitch/roll as well as yaw. Source guards, visual/pose tests and
|
||||
native Linux rendering pass; see gameplay/jimmy-turn-fire-fixes.md.
|
||||
|
||||
- [ ] 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.
|
||||
|
||||
@@ -45,6 +45,7 @@ dotnet run --project tests/GamePort.LabRouteTests -- ../Original
|
||||
dotnet run --project tests/GamePort.UndergroundRouteTests -- ../Original
|
||||
dotnet run --project tests/GamePort.DynamicCollisionTests -- ../Original
|
||||
dotnet run --project tests/GamePort.JetpackTests
|
||||
dotnet run --project tests/GamePort.PlayerVisualTests -- ../Original
|
||||
dotnet run --project tests/GamePort.ObjectiveTests -- ../Original
|
||||
dotnet run --project tests/GamePort.ProjectionTests -- ../Original
|
||||
python3 tests/GamePort.HudTests/test_ui.py
|
||||
|
||||
@@ -24,8 +24,9 @@ public sealed class JetpackVisuals
|
||||
{
|
||||
draw.Visible = owner.JetpackEffectVisible;
|
||||
if (!draw.Visible) return;
|
||||
var model = Matrix4x4.CreateRotationY(-owner.Yaw * MathF.PI / 180)
|
||||
* Matrix4x4.CreateTranslation(owner.ActorRoot);
|
||||
clip.Sample(owner.Steps / 60d, destination.Vertices.AsSpan(offset, clip.Base.Vertices.Length), model);
|
||||
//42204C..4220B6 copies the owner's full root/Euler. Share the owner's
|
||||
//local visual correction too, keeping the original relative attachment
|
||||
//when the port aligns Jimmy's upright soles with the floor.
|
||||
clip.Sample(owner.Steps / 60d, destination.Vertices.AsSpan(offset, clip.Base.Vertices.Length), owner.Model);
|
||||
}
|
||||
}
|
||||
@@ -47,14 +47,16 @@ public sealed class PreviewAnimationLibrary
|
||||
if (ReferenceEquals(clip, Current)) Name = label;
|
||||
}
|
||||
foreach (var (pose, folder) in new[] { (PlayerPose.Idle, "jimstop"), (PlayerPose.Run, "jimrun"),
|
||||
(PlayerPose.Backpedal, "jimbackpedal"), (PlayerPose.Jump, "jimjump"), (PlayerPose.Fall, "jimfall"), (PlayerPose.Fly, "jimfly"), (PlayerPose.Shoot, "jimshoot") })
|
||||
(PlayerPose.Backpedal, "jimbackpedal"), (PlayerPose.Jump, "jimjump"), (PlayerPose.Fall, "jimfall"), (PlayerPose.Fly, "jimfly"), (PlayerPose.Shoot, "jimshoot"),
|
||||
(PlayerPose.TurnLeft,"jimleft"),(PlayerPose.TurnRight,"jimright") })
|
||||
{
|
||||
var path = Path.Combine(parent, folder, "animation.json");
|
||||
if (!File.Exists(path)) continue;
|
||||
movement[pose] = Load(path);
|
||||
}
|
||||
foreach (var (action, folder) in new[] { ("STOP", "jimstop"), ("TALK", "jimtalk"), ("RUN", "jimrun"),
|
||||
("JUMP", "jimjump"), ("FALL", "jimfall"), ("SCRATCH", "jimscratch"), ("FLY", "jimfly"), ("SHOOT", "jimshoot") })
|
||||
("JUMP", "jimjump"), ("FALL", "jimfall"), ("SCRATCH", "jimscratch"), ("FLY", "jimfly"), ("SHOOT", "jimshoot"),
|
||||
("LEFT","jimleft"),("RIGHT","jimright") })
|
||||
{
|
||||
var path = Path.Combine(parent, folder, "animation.json");
|
||||
if (File.Exists(path)) actions[action] = Load(path);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace GamePort.Game;
|
||||
public readonly record struct PlayerInput(bool Forward, bool Backward, bool Left, bool Right, bool Jump,
|
||||
bool Rise = false, bool Descend = false, bool StrafeLeft = false, bool StrafeRight = false, bool Fast = false, bool Fire = false,
|
||||
bool RocketTurn = false, bool RocketRoll = false, bool RocketMouseRise = false,bool GrapplerEnter=false);
|
||||
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot, Swing }
|
||||
public enum PlayerPose { Idle, Run, Backpedal, Jump, Fall, Fly, Shoot, Swing, TurnLeft, TurnRight }
|
||||
|
||||
/// <summary>
|
||||
/// Walking, airborne steering and jetpack checkpoint. Recovered arithmetic is described in
|
||||
@@ -35,6 +35,8 @@ public sealed class LabSimulation
|
||||
private JetpackBurstState jumpState;
|
||||
private bool forceFall;
|
||||
private bool keyboardTurn, hasSupportPolygon;
|
||||
private sbyte groundTurnDirection;
|
||||
private bool primaryHeld;
|
||||
private Vector3 noclipEntry;
|
||||
private float noclipEntryYaw;
|
||||
private int gadgetMode = -1;
|
||||
@@ -127,7 +129,9 @@ public sealed class LabSimulation
|
||||
: Grappler?.SwingPose==true ? PlayerPose.Swing
|
||||
: GadgetMode == 0 ? bubblePose
|
||||
: pendingImpulse.Y > 0 ? PlayerPose.Jump
|
||||
: Grounded ? Shooting ? PlayerPose.Shoot : Speed < -1 ? PlayerPose.Backpedal : Speed > 1 ? PlayerPose.Run : PlayerPose.Idle
|
||||
: Grounded ? Shooting ? PlayerPose.Shoot : Speed < -1 ? PlayerPose.Backpedal : Speed > 10 ? PlayerPose.Run
|
||||
: Speed>=0&&!primaryHeld&&groundTurnDirection<0 ? PlayerPose.TurnLeft
|
||||
: Speed>=0&&!primaryHeld&&groundTurnDirection>0 ? PlayerPose.TurnRight : PlayerPose.Idle
|
||||
: jumpState.JumpState == 3 && jumpState.EffectRemaining > 0 ? PlayerPose.Fly
|
||||
: !forceFall && Velocity.Y > 0 ? PlayerPose.Jump : PlayerPose.Fall;
|
||||
public int Steps { get; private set; }
|
||||
@@ -205,6 +209,7 @@ public sealed class LabSimulation
|
||||
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = shadowDistance = 0;
|
||||
lateralContribution = 0; pendingImpulse = Vector3.Zero; movementMode = 0;
|
||||
keyboardTurn=false;hasSupportPolygon=false;
|
||||
groundTurnDirection=0;primaryHeld=false;
|
||||
jumpState = default;
|
||||
forceFall = JetpackEffectVisible = false;
|
||||
Shooting = false;
|
||||
@@ -426,6 +431,7 @@ public sealed class LabSimulation
|
||||
if (gadgetMode==0) { GadgetMode=-1; DefaultGadgetRequested?.Invoke(); }
|
||||
Shooting = false;
|
||||
Velocity = pendingImpulse = Vector3.Zero;
|
||||
groundTurnDirection=0;primaryHeld=false;
|
||||
Speed = PublishedSpeed = TurnRate = extraAirAcceleration = lateralContribution = 0;
|
||||
jumpState = default; movementMode = 0; forceFall = JetpackEffectVisible = false;
|
||||
//Modern debug stop freezes the retained facing request as well as body
|
||||
@@ -464,9 +470,11 @@ public sealed class LabSimulation
|
||||
{
|
||||
const float dt = FixedStepClock.Step;
|
||||
lateralContribution = 0;
|
||||
primaryHeld=input.Fire;
|
||||
//438A60 dispatches by stored movement mode, not current support.
|
||||
if (movementMode == 0)
|
||||
{
|
||||
groundTurnDirection=(sbyte)(input.Left?-1:input.Right?1:0); //complete82A: keyboard Left wins.
|
||||
//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,
|
||||
|
||||
@@ -327,7 +327,7 @@ static void SpeedLimits()
|
||||
var turn = FlatSimulation();
|
||||
for (var i = 0; i < 40; i++) turn.Step(new(false, false, true, false, false));
|
||||
Near(turn.Speed, 0, 0, "turn-only +30 then decay35 clamps at zero");
|
||||
Check(turn.Grounded && turn.Pose == PlayerPose.Idle, "turn-only remains supported and idle");
|
||||
Check(turn.Grounded && turn.Pose == PlayerPose.TurnLeft, "turn-only remains supported and uses the left turning clip");
|
||||
|
||||
var walk = FlatSimulation();
|
||||
walk.Step(new(true, false, false, false, false));
|
||||
|
||||
@@ -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"/>
|
||||
<Compile Include="../../src/GamePort/Application/PreviewAnimationLibrary.cs"/>
|
||||
<Compile Include="../../src/GamePort/Application/JetpackVisuals.cs"/>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,54 @@
|
||||
using System.Numerics;
|
||||
using GamePort.Assets;
|
||||
using GamePort.Game;
|
||||
using GamePort.Application;
|
||||
|
||||
var original=Path.GetFullPath(args.Length==1?args[0]:"../Original");
|
||||
var prepared=Path.GetFullPath("artifacts/extracted");
|
||||
var standing=AseMesh.Load(AssetPath.Resolve(original,"ASE/jimstop.ase"));
|
||||
var floor=new Mesh(new[]{new Vector3(-10000,0,-10000),new Vector3(-10000,0,10000),new Vector3(10000,0,10000),new Vector3(10000,0,-10000)}
|
||||
.Select(p=>new MeshVertex(p,Vector2.Zero,Vector3.One)).ToArray(),[0,1,2,0,2,3]);
|
||||
LabSimulation Player()=>new(new(floor),standing,new Vector3(0,20,0),0);
|
||||
|
||||
foreach(var left in new[]{true,false})
|
||||
{
|
||||
var p=Player();var input=new PlayerInput(false,false,left,!left,false);
|
||||
for(int i=0;i<20;i++)p.Step(input);
|
||||
Check(p.Speed==0&&p.Grounded&&p.Pose==(left?PlayerPose.TurnLeft:PlayerPose.TurnRight),"standing turn selects directional clip");
|
||||
var clips=new PreviewAnimationLibrary(Path.Combine(prepared,"animations/jimstop/animation.json"));
|
||||
Check(clips.SelectPose(p.Pose)&&clips.Current.HasVertexMotion&&clips.Current.FrameCount==6,"original six-frame turn clip is loaded");
|
||||
var first=new MeshVertex[clips.Current.Base.Vertices.Length];var next=new MeshVertex[first.Length];
|
||||
clips.Current.Sample(0,first,Matrix4x4.Identity);clips.Current.Sample(clips.Current.SampleInterval,next,Matrix4x4.Identity);
|
||||
Check(first.Where((v,i)=>v.Position!=next[i].Position).Any(),"turn clip advances instead of holding a static pose");
|
||||
Check(!clips.SelectPose(p.Pose),"holding turn does not restart its animation every step");
|
||||
Check(clips.SelectAction(left?"RIGHT":"LEFT"),"authored turn action maps to original family");
|
||||
p.Step(default);Check(p.Pose==PlayerPose.Idle,"release leaves standing turn");
|
||||
for(int i=0;i<20;i++)p.Step(input with{Forward=true});
|
||||
Check(p.Pose==PlayerPose.Run,"forward turning keeps the run cycle");
|
||||
p.Step(input with{Jump=true});Check(p.Pose==PlayerPose.Jump,"takeoff overrides ground turn");
|
||||
}
|
||||
var both=Player();both.Step(new(false,false,true,true,false));Check(both.Pose==PlayerPose.TurnLeft,"left input wins");
|
||||
var primary=Player();primary.Step(new(false,false,true,false,false,Fire:true));Check(primary.Pose!=PlayerPose.TurnLeft,"primary input suppresses a new turn pose");
|
||||
primary.SetShooting(true);Check(primary.Pose==PlayerPose.Shoot,"active shot owns its pose");
|
||||
Console.WriteLine("PASS source directional turn selection, six-frame motion, hold/release, run/jump/primary precedence and authored actions");
|
||||
|
||||
var owner=Player();owner.LevelCode="VR04";
|
||||
Check(owner.ApplyRetainedLevelState(new("LV1B",3,1,.625f,6.125f)),"powered effect fixture");
|
||||
owner.RestoreReturnRoot(owner.ActorRoot+Vector3.UnitY*400);
|
||||
var visuals=new JetpackVisuals(new Mesh([],[]),prepared);
|
||||
var clip=new MorphAnimation(Path.Combine(prepared,"actors/jetpack/fire/animation.json"));
|
||||
foreach(var rotation in new[]{new Vector3(-35,65,-20),new Vector3(15,220,25),new Vector3(0,359,0)})
|
||||
{
|
||||
owner.ApplyAuthoredTransform(owner.ActorRoot+new Vector3(10,5,-7),rotation);
|
||||
owner.Step(default,controlled:false);
|
||||
visuals.Update(visuals.Mesh,owner);
|
||||
Check(visuals.Mesh.Draws[^1].Visible&&owner.JetpackEffectVisible,"active effect remains visible");
|
||||
var expected=new MeshVertex[clip.Base.Vertices.Length];clip.Sample(owner.Steps/60d,expected,owner.Model);
|
||||
for(int i=0;i<expected.Length;i++)Check(Vector3.Distance(expected[i].Position,visuals.Mesh.Vertices[i].Position)<.0001f,
|
||||
"flame shares Jimmy's full visual frame, including pitch/roll and local compatibility alignment");
|
||||
Check(MathF.Abs(owner.Model.GetDeterminant()-1)<.00001f,"attachment rotation cannot scale the flame");
|
||||
}
|
||||
owner.Reset();visuals.Update(visuals.Mesh,owner);
|
||||
Check(!visuals.Mesh.Draws[^1].Visible,"reset/inactive effect stays hidden");
|
||||
Console.WriteLine("PASS original flame geometry follows combined pitch/yaw/roll, translation and owner visibility without scaling");
|
||||
static void Check(bool ok,string name){if(!ok)throw new Exception(name);}
|
||||
@@ -0,0 +1,84 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Read-only identity, branch-range and ASE guards for Jimmy's turn poses.
|
||||
|
||||
The retained REA disassembly is interpreted in docs/gameplay/jimmy-turn-animation.md.
|
||||
This validates that the original bytes and morph resources still match that evidence;
|
||||
it neither executes the original nor substitutes a Python gameplay implementation.
|
||||
"""
|
||||
import argparse
|
||||
import hashlib
|
||||
import json
|
||||
from pathlib import Path
|
||||
import struct
|
||||
import sys
|
||||
|
||||
from checkpoint_script_state import EXE_SHA256, find_case, read_va
|
||||
from pe_inspect import PE
|
||||
|
||||
RANGES = (
|
||||
(0x422b40, 40, '80c05deb52453d14b4db0e74254ea9ab6775358392551681cea7d4b5b5747347'),
|
||||
(0x437ac9, 213, '2b8559afb06bcb3f04c033bbac31f4db8cff4ca07309cedd34c464bb9d162a7f'),
|
||||
(0x438f6e, 7, '6f5f444126a0866a854c30e2818fe8d36d75447a14c06b2868067ebac52b7284'),
|
||||
(0x4391bd, 7, 'f292143f7a0fa307f5d198fc1763b11f4bb3758e299df5147f04e3970af5bd28'),
|
||||
(0x439230, 9, '007abea151f3b1ae7ed194e44693e2a101950bf49b27a4ef045ecba829f60fec'),
|
||||
(0x42a7a0, 54, 'c8fa10f42eefe68a195d9980f1a57558a240cd7877bfeab567e7868c0ddf419f'),
|
||||
(0x43aff8, 34, 'e72f29b0659f469c3482e539ffd8af9659858b526c4101deb5de419aeee0cc7e'),
|
||||
(0x43b273, 23, '46fb502f80298f10195873eb9637301bde63a644431d128aeb64ff0259f9da1c'),
|
||||
(0x43b32a, 156, '27d0d59eed50895c9405c25273802e0e74b5fa10c015343ecec86cae25022074'),
|
||||
(0x40de95, 137, 'bdae5e890787e8b0f0d8d94b0f518f37f0cf5ab8bb8794e9530a5b124cf6e8cd'),
|
||||
)
|
||||
ASSETS = {
|
||||
'jimstop.ase': 'b294d090ac5c4ec449d845db6d837f2cbedf5f7b812f5b6ed2bb70f85246f1d0',
|
||||
'jimleft.ase': '08772d0b0f539ceb61d92b5f84663e62255beafb970a903548f96ab2b14d20e0',
|
||||
'jimright.ase': 'b5578a5df2e84a8d78d9e00fa8cf57e9744cd12dcc7fdbfba241e4730edf2adf',
|
||||
}
|
||||
STRINGS = {
|
||||
0x4ef230: b'HIRIGHT\0', 0x4ef238: b'jimright.ase\0',
|
||||
0x4ef248: b'HILEFT\0', 0x4ef250: b'jimleft.ase\0',
|
||||
0x4f05dc: b'RIGHT\0', 0x4f05e4: b'LEFT\0', 0x4ed3dc: b'HI\0',
|
||||
}
|
||||
|
||||
|
||||
def collect(original):
|
||||
original = Path(original)
|
||||
pe = PE(find_case(original, 'Neutron.exe'))
|
||||
if hashlib.sha256(pe.data).hexdigest() != EXE_SHA256:
|
||||
raise ValueError('Unexpected original EXE')
|
||||
ranges = []
|
||||
for va, length, expected in RANGES:
|
||||
digest = hashlib.sha256(read_va(pe, va, length)).hexdigest()
|
||||
if digest != expected:
|
||||
raise ValueError(f'Changed evidence range {va:#x}')
|
||||
ranges.append(dict(va=hex(va), file_offset=hex(pe.offset(va-pe.base)),
|
||||
length=length, sha256=digest))
|
||||
for va, expected in STRINGS.items():
|
||||
if read_va(pe, va, len(expected)) != expected:
|
||||
raise ValueError(f'Changed string at {va:#x}')
|
||||
if struct.unpack('<f', read_va(pe, 0x48e5ec, 4))[0] != 10.0:
|
||||
raise ValueError('Changed run threshold')
|
||||
if struct.unpack('<f', read_va(pe, 0x48d914, 4))[0] != 0.0:
|
||||
raise ValueError('Changed backpedal guard')
|
||||
sys.path.insert(0, str(Path(__file__).resolve().parents[1]/'extractors'))
|
||||
from ase import read_ase
|
||||
assets = []
|
||||
for name, expected in ASSETS.items():
|
||||
path = find_case(find_case(original, 'ASE'), name)
|
||||
animation = read_ase(path)
|
||||
if animation['sha256'] != expected:
|
||||
raise ValueError(f'Changed ASE resource {name}')
|
||||
assets.append(dict(source=path.name, sha256=expected,
|
||||
frames_per_second=animation['framesPerSecond'],
|
||||
ticks_per_frame=animation['ticksPerFrame'],
|
||||
objects=[dict(name=o['name'], samples=len(o['samples']),
|
||||
times=[s['time'] for s in o['samples']],
|
||||
vertex_counts=sorted({len(s['vertices']) for s in o['samples']}))
|
||||
for o in animation['objects']]))
|
||||
return dict(source_sha256=EXE_SHA256,
|
||||
rea_evidence='ev_0d64cc58fa8f5573fc8e61e0f2c20e36288099212bd2257d3a3121361fd6c904',
|
||||
ranges=ranges, assets=assets)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = argparse.ArgumentParser(description=__doc__)
|
||||
parser.add_argument('original', type=Path)
|
||||
print(json.dumps(collect(parser.parse_args().original), indent=2))
|
||||
@@ -55,7 +55,7 @@ def main():
|
||||
parser.add_argument('--scenes', nargs='+', default=['level1b', 'VR01'])
|
||||
parser.add_argument('--all-scenes', action='store_true', help='Prepare every supplied GAM/OMT scene pair')
|
||||
parser.add_argument('--audio', nargs='*', default=['sounds', 'musicjimmyshouse', 'musicneighborhood'])
|
||||
parser.add_argument('--animations', nargs='*', default=['jimstop', 'jimrun', 'jimjump', 'jimscratch', 'jimbackpedal', 'jimfall', 'jimtalk', 'jimfly', 'jimshoot'])
|
||||
parser.add_argument('--animations', nargs='*', default=['jimstop', 'jimrun', 'jimjump', 'jimscratch', 'jimbackpedal', 'jimfall', 'jimtalk', 'jimfly', 'jimshoot', 'jimleft', 'jimright'])
|
||||
args = parser.parse_args()
|
||||
if args.output.resolve().is_relative_to(args.original.resolve()):
|
||||
parser.error('Output must be outside the original installation')
|
||||
|
||||
Reference in new issue
Block a user