Page 1 of 1

What are bak and json extensions used for in level folders?

Posted: Mon Feb 21, 2022 8:47 pm
by Mal8rk
I was always wondering, what are bak and json extensions used for in level folders

And does something bad happen if you erase them from your level folder?

Re: What are bak and json extensions used for in level folders?

Posted: Tue Feb 22, 2022 5:21 am
by deice
.bak isn't it's own filetype, it's just the conventional extension used for backups of other files. the pge editor backs your level up sometimes while you're editing it, and the uses could range from convenience to reverting certain operations or even as a failsafe in case of a crash, though you'd have to ask wohlstand if you wanted to know the exact details of what the level backups are for. from experience these are safe to delete.

JSON is short for javascript object notation, and they're essentially just a simple way to organize data in a plain text format. when you refer to a json file in your level folder, i assume you mean "progress.json". if i recall correctly, this file is used for achievement functionality within smbx2. read more on that here. erasing it from an episode's folder will most likely just delete your achievement progress for that episode, though i haven't tested it myself.

Re: What are bak and json extensions used for in level folders?

Posted: Fri Mar 11, 2022 5:06 pm
by Wohlstand
These .bak files resulted because of the "safe-saving" mechanism and normally these files should be removed very fast, but they stay exist because you close Editor very fast. The purpose of this mechanism is to avoid file damage once your computer gets a power surge or BSoD that randomly kills the file (attempting to open it again may result in a blank file or a file filled with junk data). I think I'll tweak the thing to get these files been deleted faster and avoid them trashing your episode directory when you close an editor.

Re: What are bak and json extensions used for in level folders?

Posted: Sun Apr 03, 2022 2:28 pm
by Wohlstand
P.S. Just now I made the tweak that makes these files being removed when you close the Editor:

https://github.com/WohlSoft/Moondust-Pr ... caa9de5637