Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Wretched on Thu 21/04/2005 22:17:12

Title: editor.dat (SOLVED)
Post by: Wretched on Thu 21/04/2005 22:17:12
AGS just crashed whislt saving game and now I'm getting invalid editor.dat file, I assume this is serious. Is there any standard procedure to rebuild the game ? or salvage a lot of work from the remenants ?
Title: Re: editor.dat
Post by: strazer on Thu 21/04/2005 22:22:00
Look if there's a file called backup_editor.dat in the game folder.
Rename the original editor.dat and rename backup_editor.dat in editor.dat, then try opening the game again.
Title: Re: editor.dat
Post by: Pumaman on Thu 21/04/2005 22:23:36
As strazer says, there should be a backup created that you can rename.

However, there are two important points here:
1. Always back up your work regularly, at least once a week. You never know what might happen
2. The AGS editor should not crash while saving your game, what sort of error message did you get?
Title: Re: editor.dat
Post by: Wretched on Thu 21/04/2005 22:27:10
Yes I backed up last week but I still lost tonnes, there is no backup_editor.dat file.

Didn't actually crash with a message, the computer ceased up for 10 minutes with harddisk thrashing away, and I had no option but to reset.
Title: Re: editor.dat
Post by: Pumaman on Thu 21/04/2005 22:35:43
If the backup_editor.dat isn't there, you can just copy the editor.dat from your backup, which should mean at least you won't lose any sprites and stuff that you've added (you'll just lose any script changes, most likely).

How much free disk space do you have?

It could well be that rebooting the computer while it was saving led to the backup file not being committed to disk, so it's not an advisable thing to do.
Title: Re: editor.dat
Post by: Wretched on Thu 21/04/2005 22:47:39
I've got 4 gig diskspace left, is there some reason that I don't have a backup-editor.dat file, is there an option for this somewhere? Unfortunatly the game was a MAGS entry so I cannot redo the lost work in time. Thanks for your help.
Title: Re: editor.dat
Post by: Pumaman on Thu 21/04/2005 22:50:41
The backup_editor.dat file is created while it saves the game, the reason you don't have one is probably because you reset the computer while it was saving.
Title: Re: editor.dat
Post by: Wretched on Thu 21/04/2005 23:29:36
I've had a look at the editor.dat file I have, it's about 64K in size, there is some obvious corruption at the start then I have the last few lines of the global script header file and the rest of the file seems ok.
Comparing this with a backup editor.dat it seems to be just the header file missings, this was all #defines so I should be able to rebuild this.
Question , is it possible to rebuild the front of this file in a binary editor for example ?
Title: Re: editor.dat
Post by: Wretched on Fri 22/04/2005 00:56:23
Yippeeee.

Managed to rebuild the editor.dat file by taking part of the backup one and the remenants of the corrupt one, joining them together in a binary editor and hand correcting some offset value. And am back on track. Just 50 odd global #defines to type in which should all be found by script error reports. Phew!

p.s. It my birthday too. :)
Title: Re: editor.dat
Post by: on Fri 22/04/2005 02:23:14
Well happy birthday!  And nice work on recovering your file too!
Title: Re: editor.dat (SOLVED)
Post by: Pumaman on Fri 22/04/2005 21:20:10
Yes, happy birthday and glad you recovered it!

Now that it's working again, could you save the game and just check that it is creating a backup_editor.dat file in the game folder.
Title: Re: editor.dat (SOLVED)
Post by: Wretched on Sat 23/04/2005 02:44:44
There is no sign of a backup_editor.dat file here or in any other ags game directories I have looked in. There are the two files  backup_ac2game.dta  and backup_acsprset.spr but thats it. I have version 2.62 WindowsXP version if this is relevant.
Title: Re: editor.dat (SOLVED)
Post by: Pumaman on Sat 23/04/2005 14:56:44
Hmm ok, maybe it was a new feature in 2.7, I honestly can't remember now. Thanks for checking.
Title: Re: editor.dat (SOLVED)
Post by: on Sat 23/04/2005 20:10:56
I just checked one of my old 2.62 game folders (just to verify all this) and I found no backup_editor.dat.  There was a backup_ac2game.dta and a backup_acsprset.spr, so I'm guessing that the backup_editor.dat file was a new feature of 2.7.  Good one too I may add.