moritz-h / satisfactory-3d-map

A 3D map savegame tool for the game Satisfactory.
GNU General Public License v3.0
26 stars 1 forks source link

Is the save structure doc in this repo newest for 1.0 version? #7

Closed Haosonn closed 1 month ago

Haosonn commented 1 month ago

I used the following structure provided. All good before SessionVisibility, but it turns out that something gets wrong at SessionVisibility with value -102 and afterward (EditorObjectVersion=40) .

+----------+-----------------------+
| int32    | SaveHeaderVersion     |
| int32    | SaveVersion           |
| int32    | BuildVersion          |
| FString  | MapName               |
| FString  | MapOptions            |
| FString  | SessionName           |
| int32    | PlayDurationSeconds   |
| int64    | SaveDateTime          |
| int8     | SessionVisibility     |
| int32    | EditorObjectVersion   |
| FString  | ModMetadata           |
| bool     | IsModdedSave          |
| FString  | SaveIdentifier        |
| bool     | IsPartitionedWorld    |
| FMD5Hash | SaveDataHash          |
| bool     | IsCreativeModeEnabled |
+----------+-----------------------+

I also tried referencing FGSaveManagerInterface.h of the newest version from my 1.0 game dir. There may also be something wrong (EditorObjectVersion = 10394)


    int32 SaveVersion;
    int32 BuildVersion;
    FString SaveName;
    ESaveLocationInfo SaveLocationInfo;
    FString MapName;
    FString MapOptions;
    FString SessionName;
    int32 PlayDurationSeconds;
    FDateTime SaveDateTime;
    int32 EditorObjectVersion;
    FString ModMetadata;
    bool IsModdedSave;
    FMD5Hash SaveDataHash;
    bool IsEditedSave;
    FString SaveIdentifier;
    bool IsPartitionedWorld;
    bool IsCreativeModeEnabled;

So which one is correct with the current 1.0 version?

Haosonn commented 1 month ago

I fixed it by reading bool vars as int(4 bytes). But it is still weird that EditorObjectVerion=-102

moritz-h commented 1 month ago

Yes bools are 4 byte. Unreal serializes them as uint32 (see https://github.com/moritz-h/satisfactory-3d-map/blob/v0.7.0/docs/SATISFACTORY_SAVE.md#basic-types).

The documented header should also be correct for 1.0. It did not change since Update 8. The header only ever changes when SaveHeaderVersion changes, so you may validate if the value is still 13.

I can observe EditorObjectVerion is 40 for the 1.0 saves I have seen so far. You can download the 3d map tool from the Releases page (https://github.com/moritz-h/satisfactory-3d-map/releases) and try reading you save file. The save header will be printed into the log file, so you may can compare to your parsing results.

Overall the documentation should mostly be valid for 1.0. The low level structure did not change that much from Update 8. Changes in 1.0 saves I have seen so far are: