News:

SimuTranslator
Make Simutrans speak your language.

[Question] - Export from Simutrans save game to « table » or plan ?

Started by Aristide, April 29, 2014, 02:30:37 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Aristide

Hi ! :)

I want to export datas from Simutrans Save game for create a plan (like this : .

Do you know tools for do that ? Or How I can parse Simutrans save game (I can create a tool if need) ?

Sarlock

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.
Current projects: Pak128 Trees, blender graphics

Aristide

Hi :) Thanks you for your response ^^

The (uncompresse) file content is not very understandable :

:/

Ters

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.

eipi

Try changing the save format to "zip" in simuconf.tab, i.e. change

saveformat = bzip2 to saveformat = xml

isidoro

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...


Aristide

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 ?

Ters

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.

prissi

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

Dwachs

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.
Parsley, sage, rosemary, and maggikraut.