The International Simutrans Forum

 

Author Topic: XML reader error (From: Network Diagram Tool)  (Read 3340 times)

0 Members and 1 Guest are viewing this topic.

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
XML reader error (From: Network Diagram Tool)
« on: March 10, 2012, 07:39:19 PM »
I just hab a big problem with this tooll that has ruined my principal savegame. I used to load my savegame in SimuMapViewer, it works correctly but after I tried to play simutrans with the same savegame and it crashed. I tried to reconvert savegame into bzip2 (in simuconf.tab) but it makes no difference! :/ Moreover the size of the savegame reach the size of 1 MB after i use SimuMapviewer.


Here is the error message when I try to load my savegame:





Have you got any solution for me?

Offline yorkeiser

  • *
  • Posts: 107
  • Beer guru
  • Languages: IT EN FR
Re: XML reader error (From: Network Diagram Tool)
« Reply #1 on: March 12, 2012, 08:48:10 AM »
I just hab a big problem with this tooll that has ruined my principal savegame. I used to load my savegame in SimuMapViewer, it works correctly but after I tried to play simutrans with the same savegame and it crashed. I tried to reconvert savegame into bzip2 (in simuconf.tab) but it makes no difference! :/ Moreover the size of the savegame reach the size of 1 MB after i use SimuMapviewer.


Here is the error message when I try to load my savegame:





Have you got any solution for me?

Isaac, this tool can't ruin a savegame for the simple motivation that it DOESN'T write on any file: it simply opens the .sve in read mode, reads the file and closes it.
In addiction, java safety policy doesn't allow an external tool to write on your hard disk files, you would have to manually add the file to jvm "trust zone" to allow this operation.
The problem is probably related to simutrans, maybe with some version when you save to xml format you can't then revert to bzip2 or something similar?
The XML savegame is obviously bigger than the bzip2, that's not an issue.

Offline sdog

  • Devotee
  • *
  • Posts: 2052
Re: XML reader error (From: Network Diagram Tool)
« Reply #2 on: March 12, 2012, 05:55:47 PM »
[...] I tried to reconvert savegame into bzip2 (in simuconf.tab) but it makes no difference! :/

did you try to un-pack, and later re-pack, the savegame manually, using bzip2/bunzip2?

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #3 on: March 13, 2012, 10:11:47 PM »
Thanks for your answers,
I've just downloaded bzip2 but i don't know how to reconvert my savegame into bzip format. Can you explain me?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #4 on: March 13, 2012, 11:58:26 PM »
You do not need to do this. Simutrans will also load uncompressed games even if they were initially saved compressed. Just copy the file into your savegame folder. It will just take a long while to process large files.

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #5 on: March 14, 2012, 12:15:43 AM »
You do not need to do this. Simutrans will also load uncompressed games even if they were initially saved compressed. Just copy the file into your savegame folder. It will just take a long while to process large files.

I'm sorry i don't understand, what is the file i have to copy in the savegame folder in order to compress my savegame?

Offline yorkeiser

  • *
  • Posts: 107
  • Beer guru
  • Languages: IT EN FR
Re: XML reader error (From: Network Diagram Tool)
« Reply #6 on: March 14, 2012, 08:46:27 AM »
Isaac, can you please zip the .sve file and load it on some file storage, so I can download it and try to load it in Simutrans 111.0? I also need to know which pakset you're using.

Offline Isaac Eiland-Hall

  • Benevolent Dictator
  • Administrator
  • *
  • Posts: 3926
  • Providing hosting for Simutrans projects
    • pc2.io
  • Languages: EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #7 on: March 14, 2012, 09:45:56 AM »
...I'm so used to being the only Isaac here - it took me a minute to realize why I didn't know what file you were talking about... xD

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #8 on: March 14, 2012, 01:38:34 PM »
Simutrans will show (and load) and file which contains either binary or XML data generated by simutrans. It does not need to be compressed. Just copy the XML file your read into the line tool to a file name like game_xyz_xml.sve (it must end by sve) and copy it into the simutrans savegame folder. You do not need to compress it. Simutrans should show your savegame and you should be able to load it by simutrans the normal way like any other savegame. You do not need to compress it again.

If simutrans crashes upon loading, there might be another error in SImutrans. Please report that then.

Offline sdog

  • Devotee
  • *
  • Posts: 2052
Re: XML reader error (From: Network Diagram Tool)
« Reply #9 on: March 14, 2012, 09:47:42 PM »
i'm afraid i caused more confusion with my previous message. Isaac Clarke, i just wanted to know, to exclude one possible cause for a broken savegame. I did not implicitly say you should use bzip2 yourself. As prissi said, simutrans uses it internally.

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #10 on: March 14, 2012, 11:22:47 PM »

Simutrans will show (and load) and file which contains either binary or XML data generated by simutrans. It does not need to be compressed. Just copy the XML file your read into the line tool to a file name like game_xyz_xml.sve (it must end by sve) and copy it into the simutrans savegame folder. You do not need to compress it. Simutrans should show your savegame and you should be able to load it by simutrans the normal way like any other savegame. You do not need to compress it again.


If simutrans crashes upon loading, there might be another error in SImutrans. Please report that then.




I'm sorry i really don't know what file you are talking about :/ You say that simutrans also use bzip2 internally but my savegame is still crashing simutrans and simutrans convert nothing. My savegame has still a too big size to be loaded correctly by simutrans.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #11 on: March 15, 2012, 09:49:19 AM »
The uncompressed XML file of a 1MB savegame will be about 250-500MB. Simutrans can read such games without problems. There was however a version which produced broken savegames.

Update your binary to the latest nightly, and load the game you gave to the mapview program. EXACTLY THIS FILE. If simutrans crashes on load, then send this file (after using zip or whatever) and I will have a look at it.

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #12 on: March 15, 2012, 06:04:17 PM »

The uncompressed XML file of a 1MB savegame will be about 250-500MB. Simutrans can read such games without problems. There was however a version which produced broken savegames.


Update your binary to the latest nightly, and load the game you gave to the mapview program. EXACTLY THIS FILE. If simutrans crashes on load, then send this file (after using zip or whatever) and I will have a look at it.




I've juste updated simutrans with the last nightly as you adviced me but it still change nothing, the problem is really just with the savegame i load with SimuMapViewer (i deleted this tool to evitate that it destroy more savegames...) I can load other savegames and it works perfectly.





Here is a view of the savegame folder and you can see the size of the savegame "Megacarte", the broken one.
I'm desesperate and i don't know  what to do.

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: XML reader error (From: Network Diagram Tool)
« Reply #13 on: March 15, 2012, 07:12:23 PM »
Look Isaac, I guess your save was gone.

By looking the image you attached, it says all, somewhere it should be i32 but it's i16. Open your save with a text editor and compare with another save the first 50 lines.

Offline Xelofino

  • *
  • Posts: 46
  • Don't forget to eat chocolate!
Re: XML reader error (From: Network Diagram Tool)
« Reply #14 on: March 15, 2012, 09:15:05 PM »
Isaac, there was written that you have to make copy of the save because when you make what is written in the readme (please take those documents serious) then you would know, that after changing the save format in the simuconf, the save gets saved as and xml save. This is why its bigger and like described in the simuconf.tab : more errorful. Perhaps it was just bad luck but it was definately not the program that ruined your save. And btw. you always create a copy of an important save, perhaps you've learned this by now. Of course i'm sorry about that lost game but you'll have to learn read carefully and patiently.

For me, everything went fine, compliment. Next steps perhaps...Planes? ;)

Xelofino

P.S : Please folks, read those "Readme"s. It takes minutes to read and you spare the time figuring out how it should work and why it isn't.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #15 on: March 15, 2012, 09:48:13 PM »
The savegame looks fine: 900 MB is about the size it should be.

And again compress your savegame with zip or any other programm and upload it somewhere, so a programmer can access it and find out what went wrong. Otherwise we cannot really help you, if you do not give any other informations.

If the file is not completely garbeld, it should be solvable.

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #16 on: March 16, 2012, 12:59:32 AM »
Isaac, there was written that you have to make copy of the save because when you make what is written in the readme (please take those documents serious) then you would know, that after changing the save format in the simuconf, the save gets saved as and xml save. This is why its bigger and like described in the simuconf.tab : more errorful. Perhaps it was just bad luck but it was definately not the program that ruined your save. And btw. you always create a copy of an important save, perhaps you've learned this by now. Of course i'm sorry about that lost game but you'll have to learn read carefully and patiently.

For me, everything went fine, compliment. Next steps perhaps...Planes? ;)

Xelofino

P.S : Please folks, read those "Readme"s. It takes minutes to read and you spare the time figuring out how it should work and why it isn't.

So why put an online tool that can destroy savegames of others? It is reckless. Especially since it is a savegame that I worked for a year and a half now. I just tried to compress my broken savegame and put it online in the forum but the forum tells me that the file is too large (5MB).

Offline An_dz

  • Web Admin
  • Administrator
  • *
  • Posts: 2920
  • D'oh
    • by An_dz
  • Languages: pt, en, it, (de)
Re: XML reader error (From: Network Diagram Tool)
« Reply #17 on: March 16, 2012, 02:49:22 AM »
Any program can corrupt files Isaac, we won't have computers if only programs that don't corrupt files exist.
It was your fault not making a backup, also the Network diagram tool program didn't corrupted the file, Simutrans did. You converted the save and saved over, you can't convert something and delete the original without checking the converted one.

You have no obligation to know that XML is easier corrupted, but you always need to keep backup. All the games I have I save in 2 slots, if one corrupts I have another that may be from hours before, but at least it's not from zero.

And try to upload here.

In truth, not even Simutrans could have corrupted the file, the own HD could handled wrong some write functions, or other program or service could have wrote in the wrong place.

PS.: Don't get mad with me. ::'(

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #18 on: March 16, 2012, 09:12:01 AM »
Some simutrans version had a problem that corrupted XML savegames. The game was no corrupted by the line mapping tool, but more likely by simutrans itself. Also some maps are already defective in memory, thus they cannot be saved correctly any more. If you sent your savegame, one may find out if and how to rescue it. Without the sve one cannot do anything.

Otherwise please stop blaming each other!

Offline yorkeiser

  • *
  • Posts: 107
  • Beer guru
  • Languages: IT EN FR
Re: XML reader error (From: Network Diagram Tool)
« Reply #19 on: March 16, 2012, 09:17:13 AM »
So why put an online tool that can destroy savegames of others? It is reckless. Especially since it is a savegame that I worked for a year and a half now. I just tried to compress my broken savegame and put it online in the forum but the forum tells me that the file is too large (5MB).

Isaac, I'm sorry for your trouble but I have to repeat this another time: this tool can't corrupt, or "destroy" as you said, anything, because it doesn't write on any file, nor on the sve file, nor on configuration files, nor on any files on your hard disk. I don't know if you have programming skills, but when you open a file in read mode you can't write on it. If you don't write on a file, you can't corrupt it, it's logical. The tool opens the file, reads the xml structure, maps it into memory and then closes it: nothing, I repeat, is written on your file. I follow this community since many years, why would I have to put online something that arms other people's work?

The problem you're having is surely related to simutrans, probably on some version xml saving is buggy and you can't recover the savegame: that's obviously off my scope, but if you put online the .sve you're trying to recover someone here can surely help you, prissi has asked for this twice.
I don't follow simutrans' development, so I don't know if there are known issues with xml saving; the only thing I can do, is to add a disclaimer in the tool to advice users to make a backup of the savegame before changing saving format.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: XML reader error (From: Network Diagram Tool)
« Reply #20 on: March 16, 2012, 12:12:43 PM »
As An_dz said, always, always back up files!
Once I lost a few weeks' worth work on a large gimp xcf file... I just wanted to cry (I think it was in the roads project).
I don't know if Simutrans program itself should make backups.

I could suggest a new naming convention for savegames:
   .sve -> uncompressed binary
   .sve.bz2 -> bzipped binary
   .svx -> uncompressed xml
   .svx.bz2 -> bzipped xml

This way, saving in one format will NEVER overwrite another format.
I also believe the format should be selectable in a combo box in save dialog (default being that in simuconf).
And in load dialog the save format should be listed together with version info.

Actually, I'm going to file an extension request with the above.

EDIT: see here: http://forum.simutrans.com/index.php?topic=9554.0



Whoudn't be great to be able to generate and display this graphs in-game and be able to export them as .png from inside the game? Shoudn't be too hard to adapt your java program to C++ code, maybe.

:thumbsup:

We just need someone to help integrating with the existing code... do you volunteer? ;)
« Last Edit: March 16, 2012, 12:24:10 PM by fabio »

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #21 on: March 16, 2012, 01:59:24 PM »
Ok, there was indeed an error in the xml reader, when a name (like a vehcile) ended with "]". Thus next nightly should load your file (I could not save it for you, as I lack many items of your game).

Offline Isaac_Clarke

  • *
  • Posts: 175
  • Languages: FR, EN
Re: XML reader error (From: Network Diagram Tool)
« Reply #22 on: March 18, 2012, 08:44:50 PM »
Ok, there was indeed an error in the xml reader, when a name (like a vehcile) ended with "]". Thus next nightly should load your file (I could not save it for you, as I lack many items of your game).

Prissi thank you very much :) , I hope it does not you've taken time to find the error. I just need to download the latest nightly build to get my backup?

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 10828
  • Languages: De,EN,JP
Re: XML reader error (From: Network Diagram Tool)
« Reply #23 on: March 18, 2012, 08:51:57 PM »
Yes, this was an error in the XML-Reader. It could have hit other people too, so it was well worth fixing.

Download the newest nightly, and load your game.

Offline Fabio

  • Devotee
  • Administrator
  • *
  • Posts: 2898
  • The Pak128 Guy
    • Visit me on Facebook
  • Languages: EN, IT, RO, FR
Re: XML reader error (From: Network Diagram Tool)
« Reply #24 on: March 19, 2012, 09:33:09 AM »
As it's hopefully solved, I split this and move to fixed bugs board.