Please please save my game.. I'm desperate.. [SOLVED!]

Started by SilverWizard_OTF, Sat 09/11/2013 01:12:41

Previous topic - Next topic

SilverWizard_OTF

Guys I can't believe it.. :(

I pressed "run without a dubugger" option, and suddenly my computer crashed :( Black screen, keyboard wasn't responding. I reboot and entered Windows normally.
And then I was terrified to realise that when i couldn't load my game from AGS editor.. it shows this error..

"Unable to read the user preferences file. You may lose some of your Preferences settings and may not be able to access Source Control.

The error was: Root element is missing"

I pressed OK and then this error occured:

"An error occured whilst trying to load your game. The error was:

Root element is missing.

If you cannot resolve the error, please post on the AGS Technical Forum for assistance.

Error details: System.Xml.XmlException: Root element is missing
at System.Xml.XmlTextReaderImpl.Throw(Exception e)
at System.Xml.XmlTextReaderImpl.ThrowWithoutLineInfo(String res)
at System.Xml.XmlTextReaderImpl.ParseDocumentContent()
at System.Xml.XmlTextReaderImpl.Read()
at System.Xml.XmlLoader.Load(XmlDocument doc, XmlReader reader, Boolean preserveWhitespace)
atSystem.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String filename)
at AGS.Editor.AGSEditor.LoadGameFile(String fileName)
at AGS.Editor.Tasks.LoadGameFromDisk(String gameToLoad, Boolean interactive)
at AGS.Editor.InteractiveTasks.LoadGameFromDisk(String gameToLoad)"

Then i just can't load my game.

It means so much to me this game.. i wanted to give it as a present... I am so frustrated i hadn't kept any recent backup... days and countless hours of work seem to be wasted :( Is there any way to fix this? Anything that could be done? I can't describe how much grateful i would be.

Sorry for whining... and thank you guys for your time.
"All we have to decide is what to do, with the time that is given to us"

monkey0506

It looks like your Game.agf file got corrupted when your computer crashed. What you can try is renaming the file Game.agf.bak to Game.agf (although 99 times out of ten that doesn't work because apparently the backup file is overwritten before the new file is finished being saved... :-X).

If that doesn't work, then unfortunately you're going to lose quite a bit of your info. The Game.agf file stores everything from the General Settings pane, the Global Variables pane, the Custom Properties schema, the GUI layouts, the Rooms used by the game (not the CRM files themselves of course, but just a list of them) and their descriptions, the InventoryItems, Characters, Dialogs (including dialog scripts), the info for your sprite cache (slot numbers, dimensions, source file name), all of your views and loops, the new-style audio types and clip info, and other stuff as well.

In short, if you lose your Game.agf, you've lost most of your game info that's been put into the editor. IMO, this should be seen as a bug in the editor and the way its resources are managed. This file should really be split up into smaller units.

If you don't have a backup (and the Game.agf.bak doesn't help) then there's not really much we can do at this point.

Ghost

#2
This is a shot into the dark, since I never tested it, but would the (infamous) Windows Save-Point feature allow him to return to an uncorrupted (if outdated) version of the game? Does this thing actually work (that way)?

__
Edit:

No, sorry. I read up on it and apparently you can only undo installs (and even that does not always work, or appears to work very clean at all). Documents, and I think that is what AGS game files are treated as, remain unchanged.

SilverWizard_OTF

Is there any way to open/edit the Game.agf file and see what's missing and if i can do something to restore it manually? I tried with a XML editor but it doesn't recognise it. Shouldn't be a way since the file's size is not zero? I mean, it contains a considerable amount of information. Isn't any way to extract them? With a good hex editor perhaps?
"All we have to decide is what to do, with the time that is given to us"

monkey0506

XML is written in plain-text. Just open it with Notepad, Wordpad, or literally any text editor. You might be able to recover something. The editor might simply be unable to find the root XML element if the closing tag is missing (XML is syntactically the same as HTML, but with user-defined tags).

SilverWizard_OTF

If i try to open it like this, it just shows me an empty file, though it obviously contains information, acoording to its size. How can it be possible? :(
"All we have to decide is what to do, with the time that is given to us"

Slasher

Hi

I know this may not help this situation buts its worth a mention for future reference.
QuoteI am so frustrated i hadn't kept any recent backup... days and countless hours of work seem to be wasted
Like me you may have learnt the 'Hardway' about the importance of having a backup. I've had to rebuild a few games in the past from scratch, so I generally have 2 backups now, just in case.





SpeechCenter

To view what's in there start with an hex editor and see what you have there, if you see content it's possible to fix it to open with a text editor. Sometimes text editors don't show something with binary content, although it's more likely your file just contains zeros.

If you are using Windows 7 or above try to right click on the file, and choose "restore previous version", it may take several seconds until you see something. This has a chance if you worked within "my documents". You can also check previous versions for Game.agf.bak.

SilverWizard_OTF

I am so happy!!! :) It seems i had kept a somewhat decent backup, not very recent but it saved me a LOT of trouble.. i followed these steps:

1. Replaced the corrupted game.agf with backup's one.

2. Deleted all rooms and imported them again, one by one (luckily rooms are stored seperately from game.agf! :tongue: )

Scripts, hotspots, objects e.t.c., everything were there (though i had to reconfigure/reimport the more recent objects' images)

3. Replaced with previous sprite cache, since new one was useless and reimported sprites. Fortunately enough, i keep anything that has to do with images, music e.t.c. so it was an affordable task, hadn't to redraw -almost- anything.

4. Recreated some global variables, imported some audio files, did some checks and reconfiguring...

Everything now is back to normal! :)

This incident teached me a valuable lesson.. BACKUP... BACKUP... BACKUP. Let this be the moral of the story.

Honestly, a bunch of thank you guys for the support. It was really helpful! :) You gave me the courage to try and deal with the problem, instead of abandoning it, full of dissapointment. Cheers!
"All we have to decide is what to do, with the time that is given to us"

SilverWizard_OTF

btw, SpeechCenter, you have right. The corrupted game.agf contained just zeros, i checked with a hex editor. Also, restoring to previous versions found 3-4 previous versions of the file, though judging from the date i considered safer to just replace it with the game.agf of my backup files.
"All we have to decide is what to do, with the time that is given to us"

SMF spam blocked by CleanTalk