tylercamp / palcalc

MIT License
14 stars 3 forks source link

Save file loading error - sakurajima update incompatibility #19

Closed tylercamp closed 12 hours ago

tylercamp commented 4 days ago

Pal Calc appears to be incompatible with save files from the latest v0.3.x updates, which prevents those files from loading.

The error I've seen is from an invalid string parsing event within .worldSaveData.GroupSaveDataMap.Value. Some compatibility issues have been raised in palworld-save-tools, but those are EOF errors and not parsing errors like what I'm seeing: https://github.com/cheahjs/palworld-save-tools/issues/178

The port of palworld-save-tools in Pal Calc is based on PST v22. The latest is v23 with a changelog here

tylercamp commented 4 days ago

I can see some compatibility issues with my own save file but it would be good to have some other save files as well to make sure I'm not missing anything. Others can attach their save files here (namely Level.sav)

tylercamp commented 4 days ago

The bug was caused by incomplete handling of .worldSaveData.GroupSaveDataMap.Value. In more recent game versions this field has an extra property.

The Pal Calc save parser avoids keeping all parsed data in memory, and instead collects data as it goes through the file. Because of this, the parsing for group (guild) data had to manually perform some parsing of its section of the file, and this parsing was incomplete.

The fix was to replace the ARCHIVE_PRESERVE flag with a preserveValues field on FArchiveReader, where that value is force-enabled for the group data reader. This allows the reader to use the full FArchiveReader logic (which automatically handles arbitrary properties) rather than hard-coding and expecting a specific set of properties.

See https://github.com/tylercamp/palcalc/commit/def711901ecb8bafc6c9f38cdad537709538f674

tylercamp commented 4 days ago

I'll leave this issue open in case of any further bugs, and will close in about a week if there are no reported problems.