Nifflas' Support Forum

Level Editing Support => Knytt Stories Level Editing Support => Topic started by: Purple Pineapple on November 01, 2009, 21:22:50

Title: Levels accidentally deleted?
Post by: Purple Pineapple on November 01, 2009, 21:22:50
I've been working on a level for a couple months now. It was (I think) about a hundred screens. Today, it disappeared. I opened the editor, and there was nothing there besides the starting position. It was as if the whole level got deleted. All the custom tilesets I had were still there, however. I looked in the folder and found that the map.bin was still there, and was 10 KB big. I then tried replacing the map.bin with the map.bin from another level. Nothing happened. I also tried to run it from the game and got the same big void. I then opened the map.bin file in notepad. It was one big row of spaces. Typically when you open a map.bin, it's gibberish. It seems as though the map.bin got completely erased, leaving everything else intact. This happened before on one of my other levels. It was a test level though, so it didn't really matter, and I dismissed it as a glitch.

tl;dr. Backup your levels.
Title: Re: Levels accidentally deleted?
Post by: Emeraldfire7 on November 01, 2009, 22:07:10
check your recycle bin if it was deleted it will be there (unless it happened like 10 days ago) how it got deleted no one will know O.O (spooky i know :P2) you may have deleted it while cleaning up your data folders? i've done things like that before XD

edit: didn'd read the rest of your post XD so it doesn;t really matter but if it happens again (to a non test level) check your recycle bin lol
Title: Re: Levels accidentally deleted?
Post by: AA on November 01, 2009, 22:15:03
Never seen it happen to anyone yet, are you on Windows Vista or 7 by any chance?

Try using an undelete program (like this (http://www.portablefreeware.com/?id=1063)) to recover the file.

By the way, the Map.bin file is a Gzip archive: once unzipped it will still look like gibberish on notepad for the most part, but you can see room coordinates.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 01, 2009, 22:33:04
The bin file wasn't deleted so much as written over.
It was one big row of spaces.
Which probably means that there's nothing there.

Never seen it happen to anyone yet, are you on Windows Vista or 7 by any chance?
Windows 7, but the other time it happened I was running XP.
Title: Re: Levels accidentally deleted?
Post by: LPChip on November 01, 2009, 22:49:46
It could have been corrupted. This can happen if you have a faulty drive or get a powerloss/system crash during the saving of the file.

Maybe (not sure if this actually can happen) you created a new level with the same name, so it overwritten your level with an empty one.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 01, 2009, 23:02:15
Maybe (not sure if this actually can happen) you created a new level with the same name, so it overwritten your level with an empty one.
If you try, it will say something like "That level already exists" or something.
Title: Re: Levels accidentally deleted?
Post by: Salmoneous on November 02, 2009, 10:44:37
It's some kind of error, it has happened before.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 03, 2009, 01:29:45
Oh. I forgot to mention: I think LP is exactly correct, seeing as my computer did crash in related circumstances. The weird thing is that the backup files (map1.bkup) were also wiped.
Title: Re: Levels accidentally deleted?
Post by: Gorfinhofin on November 03, 2009, 03:10:56
Well that makes sense. If you were saving the level with the editor when the computer crashed it would have been in the process of updating the backups as well as the regular map.bin. I think. Don't quote me on that.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 03, 2009, 03:28:16
..the whole point of having 3 backup files.
Title: Re: Levels accidentally deleted?
Post by: Gorfinhofin on November 03, 2009, 03:53:24
Yes, but when you save, it turns the old save into backup 1, backup 1 into backup 2, and backup 2 into backup 3.
Once again, please don't quote me on that, because I am teetering dangerously over the line between remembering and making stuff up.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 03, 2009, 04:04:29
That's almost correct. KS actually uses backup 3 to write backup 2, 2 to write 1, 1 to write the regular. It should have only corrupted one.
Title: Re: Levels accidentally deleted?
Post by: Emeraldfire7 on November 03, 2009, 04:06:57
unless it corrupted backup 3 then it would have wiped all the others am i correct?
Title: Re: Levels accidentally deleted?
Post by: Gorfinhofin on November 03, 2009, 04:24:20
Oh, I see. So it replaces each backup file one by one... Hmm... Well then...
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 03, 2009, 04:26:49
Gah, my bad.

backup 2 -> backup 3
backup 1 -> backup 2
regular save -> backup 1
Then, it saves the game.
Title: Re: Levels accidentally deleted?
Post by: Emeraldfire7 on November 03, 2009, 10:16:02
well either way it could just have corrupted the first one in the "chain" causing the others to go blank
Title: Re: Levels accidentally deleted?
Post by: LPChip on November 03, 2009, 10:37:56
Especially if you're trying to do stuff after you notice you've lost the data.

It only takes 3 saves to clear all backups.
Title: Re: Levels accidentally deleted?
Post by: Purple Pineapple on November 04, 2009, 06:48:47
As soon as I rebooted and it was gone, I didn't edit/save the level at all.