FINDarkside / TLD-Save-Editor

Edit The Long Dark save files
http://www.moddb.com/mods/the-long-dark-save-editor-2/downloads
MIT License
76 stars 31 forks source link

Linux build? #15

Closed shmerl closed 4 years ago

shmerl commented 4 years ago

Is it buildable for Linux?

FINDarkside commented 4 years ago

No. This uses WPF for UI which can't be used on Linux as far as I know.

biotinker commented 4 years ago

I managed to pull out the relevant pieces of code to convert a save file into full plaintext, and then back to TLD save format, runnable on linux. No fancy GUI or anything, just text files that I could edit by hand.

The problem I'm running into is, if I decompress, parse the string of byte numbers for e.g. 'global', decompress that, make any edit, and then wrap everything back up, the game no longer recognizes the save file. But if I do the decompression, then repack everything without edits, that works fine.

Do you know if there is any sort of save file checksumming or anything going on that needs to be accounted for?

If I can get this fully working, I can push what I've built back upstream so that linux users have an option available.

biotinker commented 4 years ago

Specifically, I noticed in GameSave.cs that there are a few things that are explicitly set rather than just using the values already in the save file. Specifically: m_SceneSaveFilenameCurrent m_SceneSaveFilenameNextLoad m_CheatsUsed m_Timestamp None of these seem like they would obviously cause a save to break, or not. Am I missing something that needs to be done so that a save file is recognized?

FINDarkside commented 4 years ago

There's no file checksumming last I checked, so I'd guess there's some problem in how you convert the save to text file and back.

biotinker commented 4 years ago

Oh, I figured it out- nano was adding a newline to the file when I edited it.

I'll update here with details for anyone using linux once I've got it cleaned up.