Adventure Game Studio

AGS Support => Advanced Technical Forum => Topic started by: Sirpunchula on Sun 18/10/2009 17:45:58

Title: Root element missing? [problem resurfaced]
Post by: Sirpunchula on Sun 18/10/2009 17:45:58
Last night i saved and closed my game with no problems, only to discover this when i tried to load it back up today:

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

Root element is missing.

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 preserve Whitespace
at System.Xml.XmlDocument.Load(XmlReader reader)
at System.Xml.XmlDocument.Load(String Filename)
at AGS.Editor.AGSEditor.LoadUserDataFile(String fileName)
at AGS.Editor.AGSEditor.LoadUserGameFile(String fileName)
at AGS.Editor.Tasks.LoadGameFromDisk(String gameToLoad, Boolean interactive)
at Ags.Editor.InteractiveTaskLoadGameFromDisk(String gameToLoad)

I'm don't know what this means, is there anyone who knows what I can do to fix this?
Title: Re: Root element missing?
Post by: Pumaman on Sun 18/10/2009 17:58:19
Make a backup copy of the game folder, then delete the Game.agf.user file and try again.
Title: Re: Root element missing?
Post by: Sirpunchula on Sun 18/10/2009 18:06:09
Thanks, that fixed the problem.
Title: Re: Root element missing? [problem resurfaced]
Post by: Sirpunchula on Tue 20/10/2009 22:25:17
 Now the backup copy has the same Root element problem with the same message as above, but now deleting the "Game.agf.user" file doesn't solve the problem. Is there any other way I can fix this and keep the problem from resurfacing?
Title: Re: Root element missing? [problem resurfaced]
Post by: Pumaman on Wed 21/10/2009 21:23:05
Why are you trying to use the backup copy if the main copy is working?

This problem should not surface at all, let alone re-surface. Are you sure that the latest error you're getting is identical to the first one? Have you been using the "Send Error Report" button?

The error indicates that the game files haven't been saved properly. This should never happen, so I'm not sure why it's happening to you. Is the game on your hard drive, and not on a USB stick or anything like that?
Title: Re: Root element missing? [problem resurfaced]
Post by: Sirpunchula on Wed 21/10/2009 22:39:46
Quote from: Pumaman on Wed 21/10/2009 21:23:05
Why are you trying to use the backup copy if the main copy is working?

This problem should not surface at all, let alone re-surface. Are you sure that the latest error you're getting is identical to the first one? Have you been using the "Send Error Report" button?

The error indicates that the game files haven't been saved properly. This should never happen, so I'm not sure why it's happening to you. Is the game on your hard drive, and not on a USB stick or anything like that?


-  My main copy isn't working; It had the same error as my backup does now.
-  I've compared the current error to the previous one up above; They're exactly the same, with the only exception being that deleting the "game.agf.user" file no longer solves the problem.
-  I didn't know there was a send error report button, where is it located?
-  And yes, I'm saving all of my files onto a hard drive.
Title: Re: Root element missing? [problem resurfaced]
Post by: Pumaman on Thu 22/10/2009 21:30:51
Which version of AGS are you using?
Title: Re: Root element missing? [problem resurfaced]
Post by: Sirpunchula on Sat 24/10/2009 00:24:24
Version 3.1.2, service pack 1
Title: Re: Root element missing? [problem resurfaced]
Post by: Pumaman on Sun 25/10/2009 12:10:06
Strange, I'm not sure why you would be getting a problem like this, it seems to indicate that the game files haven't been saved properly ... but if you didn't get any problems saving it then I don't understand why this would happen.

Has anyone else experienced any problems like this?
Title: Re: Root element missing? [problem resurfaced]
Post by: Digital Mosaic Games on Sat 21/11/2009 19:22:40
Yes, I´ve got the same problem. I´ve made a backup copy and it worked.
But this time it came the "rootelement missing-error" again and I made a backup copy again but it didn´t worked. ???
Title: Re: Root element missing? [problem resurfaced]
Post by: Pumaman on Mon 23/11/2009 22:57:55
Did you get any errors saving the game the last time before that? Are you saving it to your hard drive rather than a USB stick or anything like that?
Title: Re: Root element missing? [problem resurfaced]
Post by: Rubishov on Sat 07/04/2012 01:10:02
I'm having the exact same problem. I'm saving on a hard drive, and deleting the Game.agf.user file doesn't help. Did anyone ever find a solution to this?
Title: Re: Root element missing? [problem resurfaced]
Post by: lakespiral on Tue 05/07/2016 15:29:23
Same problem here. Haven't started AGS in a while and now it gave me this warning even though I didn't open any files. I opened the game I was last working and the error screen appeared a second time.

Edit: It doesn't open the game at all. "Unable to read the user preferences file. You may lose some of your Preferences setting and may not be able to access Source Control. The error was: Root element is missing."
Title: Re: Root element missing? [problem resurfaced]
Post by: Cassiebsg on Tue 05/07/2016 17:03:13
Uhm... actually I had that error a while ago too. Never figured what exactly happened, after panicking for a bit, I reopened my project and everything seemed fine, I  checked all the preferences but they all seemed to be like I had them before... I was confused, and haven't seen the error since.

Using 3.4.0.7 at the time.
Title: Re: Root element missing? [problem resurfaced]
Post by: Crimson Wizard on Tue 05/07/2016 17:46:29
Quote from: lakespiral on Tue 05/07/2016 15:29:23
Edit: It doesn't open the game at all. "Unable to read the user preferences file. You may lose some of your Preferences setting and may not be able to access Source Control. The error was: Root element is missing."
You say it does not open at all, do you mean that after this message it just goes back to Welcome window (where you select from recent projects)?

Where is your project located, in general (user documents, drive C, other?)

If you don't mind, could you post contents of Game.agf.user here?
Title: Re: Root element missing? [problem resurfaced]
Post by: lakespiral on Wed 06/07/2016 16:32:39
Yes. It goes back to the welcome window. The project is on my desktop. I opened the Game.agf.user file with notepad but there was nothing there. Three empty lines.

Edit: Ags version 3.3.3.0 I've had some blue screens (not related to ags). Don't remember if AGS was running at the time that happened...
Title: Re: Root element missing? [problem resurfaced]
Post by: Crimson Wizard on Wed 06/07/2016 17:16:56
Quote from: lakespiral on Wed 06/07/2016 16:32:39
Yes. It goes back to the welcome window. The project is on my desktop. I opened the Game.agf.user file with notepad but there was nothing there. Three empty lines.
It actually sounds like the file got corrupted. Did you try just deleting it? AGS is supposed to recreate it.
Title: Re: Root element missing? [problem resurfaced]
Post by: lakespiral on Wed 06/07/2016 17:38:22
I moved it to another folder and that didn't do a thing. It didn't recreate it. Game.agf is also a bunch of empty lines. Argh. Well. There goes that game. I'm going to have a hard time explaining it to my daughter :~(
Title: Re: Root element missing? [problem resurfaced]
Post by: Crimson Wizard on Wed 06/07/2016 17:53:26
Quote from: lakespiral on Wed 06/07/2016 17:38:22
Game.agf is also a bunch of empty lines.
Oh... well, Game.agf is a main file, so if it got damaged there is not much you can do except for recreating the project.
But if other files in your game are still intact, that may not be THAT hard to do. Rooms, scripts, sprites - they are all stored separately. You may want to try if you can create a new empty project and import them there.

Also, make backups of your game regularily. (I really suggest learning file version control at some point)
Title: Re: Root element missing? [problem resurfaced]
Post by: lakespiral on Thu 07/07/2016 10:32:30
Took some hours of intensive work, but got it back together. Will make more backups in the future. What does file version control mean?
Title: Re: Root element missing? [problem resurfaced]
Post by: Crimson Wizard on Thu 07/07/2016 12:18:11
Quote from: lakespiral on Thu 07/07/2016 10:32:30
What does file version control mean?

It is the system that keeps records of the history of project changes. It stores all the stages of your work in a kind of database, called "repository". There are also web services that host such repositories, even for free (with certain restrictions).
It may take some time to learn using one, but I believe it is worth it.
You may look out for SVN or Git, for example.