Goz3rr / SatisfactorySaveEditor

293 stars 75 forks source link

Add U6 and U7 read write support #269

Open etothepiiequals opened 1 year ago

etothepiiequals commented 1 year ago

This PR aims at adding readability/saveability to U6 and U7 saves. Even though the repo is as good as dead, it might be a starting point for future work or forks. Since i was tinkering with it in my free time anyway.

It should be backwards compatible with older saves, but very well may be able to be optimized. Since i don't fully understand the code structure of the parser. Just enough to make this change happen, hopefully without much issue.

A lot of credit goes to Thomas for his fork for adding u6 readability https://github.com/Goz3rr/SatisfactorySaveEditor/pull/262. A large part of my changes were possible because of his work.

Edit: Please note that this does not update cheats or anything else rather than just being able to open and write saves. Some cheats are definitely broken in this PR.

ACoolerName commented 1 year ago

After compiling and running, it is indeed able to read/write update 7 saves, however, the save does not load ingame after it has been edited... the game will either crash or create a fresh new world. I found a workaround by loading the save into SCIM and then downloading it without changing anything, however, this has led to the discovery that many of the cheats do not work in update 7 (not tested update 6). e.g. i tested resetting awesomeshop tickets and spawning in a crate with all items and neither of these work. However things like infinite power and teleport all crates to host seem to work fine. You can download the compiled version of this here: https://github.com/ACoolerName/SatisfactorySaveEditorUPDATE7/releases/tag/v7.0

etothepiiequals commented 1 year ago

Yes this PR/fork does not update any cheats, the editor view or anything else rather than barely writing/reading a save file. As much more would be needed to be done to have a full functioning editor again.

Thanks for your comment on the issues for loading the files ingame. I will try to look into it when I have the time.

etothepiiequals commented 1 year ago

Did some fixes on dissimilarities when saving.

If you still have issues with a particular save to not load ingame after just opening and saving it with the editor, it's probably best you make it available here.

ACoolerName commented 1 year ago

Now when attempting to save this specific savefile, with any edits/cheats applied: heheheha.zip The save editor crashes and the savefile is left with 1kb data only.

Then when trying to load a different save: Yes.zip I am left with this error message: image

I have once again compiled your code into a release if anyone would like to test it out for themselves. https://github.com/ACoolerName/SatisfactorySaveEditorUPDATE7/releases/tag/v7.1

etothepiiequals commented 1 year ago

Thanks for your help. I was able to fix most cheats. But only tested them with a U7 save so far.

About the heheha save file: Editing some basic numbers and properties worked fine for me. I noticed it would crash on some cheats. But they hopefully work now with the latest changes.

About the Yes save file: It looks like that save file is corrupt. A big part of it is just overwritten with zeroes. Some "checksum" does not match, that's why the error gets thrown it seems. I changed that checksum check to just a log warning, so that the editor does not throw an error there in the future. As the game seems to still be able to load what is left of the file, the editor now also attempts to load what is left. Bear in mind though, that a lot of stuff is missing in that savefile itself.