The International Simutrans Forum

Community => Simutrans Help Center => Topic started by: Aristide on April 29, 2014, 02:30:37 PM

Title: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Aristide on April 29, 2014, 02:30:37 PM
Hi ! :)

I want to export datas from Simutrans Save game for create a plan (like this : (http://www.tcl.fr/var/tcl/storage/images/media/images/plan-de-la-ligne-c34/5680936-1-fre-FR/Plan-de-la-ligne-C3.jpg).

Do you know tools for do that ? Or How I can parse Simutrans save game (I can create a tool if need) ?
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Sarlock on April 29, 2014, 02:39:53 PM
It's a fairly straightforward XML file, so with a bit of work you can parse out the information you need... as for existing tools, I know that some people have made their own specific tools for other reasons, but nothing comprehensive, so you'll probably have to program one yourself for this application.
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Aristide on April 29, 2014, 02:42:54 PM
Hi :) Thanks you for your response ^^

The (uncompresse) file content is not very understandable :

(http://wstaw.org/m/2014/04/29/plasma-desktopPH3138.png) :/
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Ters on April 29, 2014, 03:11:30 PM
You must set the save game format to xml first. As far as I know, the default is binary. I have no idea how to do that, however. You can try searching, or wait for someone who knows to pass by. The file format can change at any time, so the tool must keep track of changes in every new version of Simutrans.
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: eipi on April 29, 2014, 03:22:17 PM
Try changing the save format to "zip" in simuconf.tab, i.e. change

saveformat = bzip2 to saveformat = xml
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: isidoro on April 29, 2014, 10:24:10 PM
Another possibility is to create a "fake" scenario.  With some knowledge of Squirrel programming language, you have access to a lot of data from the game, you can process it from Squirrel and, hopefully (of this, I'm not sure now), save it in whatever format you like...

Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Aristide on April 30, 2014, 07:44:59 PM
Hi again, thanks for your response. I Looking for a documentation about XML Save Game for know structure etc. Do you have a URL (or document) for more information ?
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Ters on April 30, 2014, 09:38:11 PM
Unfortunately, I think this is a "figure it out yourself" / "the source code is the documentation" thing. Even if someone, most likely outside the dev team, have made some documentation, it is likely outdated.
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: prissi on April 30, 2014, 10:14:17 PM
Every schedule start with a "<fahrplan_t>" tag. The actual entries inside are "koord3d" which conist of x,y,and z coordinates of a stop.

But this information is virtually useless, as you need to load the whole map to find out, what stop is at these coordinates. Using game script (or a patch) is the only way to get these informations.

Since something like this was implemented in the minimap, it is probably best to read the original discussion on the implementations: http://forum.simutrans.com/index.php?topic=6760.0
Title: Re: [Question] - Export from Simutrans save game to « table » or plan ?
Post by: Dwachs on May 02, 2014, 09:08:05 AM
Quote from: Aristide on April 30, 2014, 07:44:59 PM
Hi again, thanks for your response. I Looking for a documentation about XML Save Game for know structure etc. Do you have a URL (or document) for more information ?

Please proceed into the direction isodoro is suggesting: Create a dummy scenario that will read all the in-game information and process the output for you.

Try the attached scenario file: Create new directory under

simutrans/<yourpakset>/scenario/linestats

or

(My Documents)/simutrans/addons/<yourpakset>/scenario/linestats

copy the file there.

Start simutrans with flags '-debug 2 -log 1', load your savegame, load the scenario 'linestats'. It should print some information to the console (and the log file simulog.log).

Edit: Uploaded the wrong file accidentally. Please redownload.