Files
Neutron/docs/save-format.md
T

4.0 KiB
Raw Blame History

Original TSK save and task state

All12 supplied TSK files decode completely and byte-round-trip in C#. Originals remain read-only; implementation is Assets/OriginalSave.cs. This establishes the wire format, not complete runtime saving or resume behavior.

Original writer EXE0x45FEE0 and loader0x4603F0 use OMT stream operators (big endian scalars; one-byte Latin1 string length). Writer calls at 0x45FFD3–0x46003C, 0x460057–0x4600AF, 0x4600B2–0x46013F independently support these field sizes/order. Reader calls at0x4605A8–0x460633, 0x460A83–0x460BCF, 0x460BDD–0x460D60 mirror them.

Offset / order Wire type Evidence / current interpretation
0 4-byte FourCC Current level code; NewGame LV1B
4 float32 Global0x4F83D4; NewGame20.0; energy consumed by jetpack, adjustment0x42A920 clamps0..100; other uses pending
8 int16 Global0x4F83CC; preserve signed/raw value
10 int32 Score0x4F83C0; pickup addition0x42ADC0
14 int32 Global0x4F8194; selected objective index, set by0x406F50
18 4200 int32 Global0x4F8438..0x4FC5D8; acquired-item slots referenced by pickup code
16818 29 int32 One int at each8-byte record from0x4F7DB8..0x4F7EA0; semantics pending
16934 4 Pascal strings Startpoint, reserved name, return level, return start
after strings 3 float32 Transition departure root at Jimmy complete+9A8; captured on ordinary departure, preserved/restored by RETURN
after vector 19 int32 9 group0 and10 group1 inventory states; source getters sign-extend shorts
after inventory int32 count Task entry count
per task Pascal string +int32 Task name and state, in original order

The vector identity is established by writer46008B..4600B0 and reader460B9E..460BBA, which access complete+9A8 (interface+8E8). It is separate from pickup42AF00's complete+1E38 checkpoint. Pending RETURN flags are not serialized; fresh save loading still selects its STRT. See analysis/runtime-checkpoint.md for the source capture, one-time position restoration and start-trigger suppression rules.

No version tag/checksum was found in this supplied format. Unknown tables/fields and unusual existing inventory values are preserved. Several old saves contain large or negative inventory states; normalizing them to booleans would break the forensic round-trip and is not justified by current evidence.

NewGame's12 tasks are MOM, LIBBY, BENNY, SCENE, DINO, CLONE, KITTY1/2/3, HYDRANT1/2 and REACTOR. Only SCENE is nonzero, initially30.

TaskStates.Get implements EXE0x45FEA0: first matching name, missing returns0. Comparison helper0x487C20 folds ASCII A-Z (locale fallback exists in the original; the supplied task names are ASCII). Setter0x45F990 updates matching existing entries and broadcasts assignment to objects sharing TaskName via slot0x424. It does not insert a missing task, and repeated assignments still broadcast. SCENE milestone dispatch now updates the selected objective through the recovered 44-entry mapping (SceneInteractions.ObjectiveForScene), including35/50/60 to1/2/3. The original helper0x406F50 clears transient objective flags and selects the new entry. The TSK field currently retains its generic C# name OtherCounter to avoid changing the wire representation; its recovered meaning is the objective selector.

TaskActivation implements the corrected animated-entity, pickup and LOAD gates. ExactLevel is a numeric state, not a boolean. Animated entities prioritize exact match, otherwise RequiredLevel threshold and exclusive RemoveLevel; Required=-1 leaves state unchanged. Pickup override omits RemoveLevel. LOAD accepts no required task, taskstate-1, or threshold plus optional exact equality. These are gate formulas only; scene visibility/collision/state execution requires integration.

Tests cover all12 original saves, truncation/trailing bytes, mutations, case-insensitive task query, missing tasks and assignment notification. Remaining: map every remaining global field and task side effect, original checkpoint selection, complete state serialization/resume, port configuration and native platform tests.