The International Simutrans Forum

 

Author Topic: [Question] - Export from Simutrans save game to « table » or plan ?  (Read 3644 times)

0 Members and 1 Guest are viewing this topic.

Aristide

  • Guest
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) ?

Offline Sarlock

  • Devotee
  • *
  • Posts: 1340
  • Languages: EN
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.

Aristide

  • Guest
Hi :) Thanks you for your response ^^

The (uncompresse) file content is not very understandable :

:/

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5603
  • Languages: EN, NO
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.

Offline eipi

  • *
  • Posts: 67
  • Languages: DE EN FR ES C++ LaTeX
Try changing the save format to "zip" in simuconf.tab, i.e. change

Code: [Select]
saveformat = bzip2 to
Code: [Select]
saveformat = xml

Offline isidoro

  • Devotee
  • *
  • Posts: 1130
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

  • Guest
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 ?

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5603
  • Languages: EN, NO
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.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9790
  • Languages: De,EN,JP
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

Offline Dwachs

  • DevTeam, Coder/patcher
  • Administrator
  • *
  • Posts: 4631
  • Languages: EN, DE, AT
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.
« Last Edit: May 02, 2014, 12:19:21 PM by Dwachs »