News:

Simutrans Wiki Manual
The official on-line manual for Simutrans. Read and contribute.

Savefile format

Started by ojii, April 01, 2011, 09:33:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ojii

Hi everyone

I might be missing some obvious stuff, but are there any docs on the savefile format? I'm asking because while I'm a programmer, I don't know much C++, but I had this nice idea of writing a program that turns savefiles into nice network diagrams, by extracting the lines and station positions from a savefile.

I'm a Python programmer (I know other stuff, but that's what I'm most comfortable with), so I can read binary savefiles as long as I know the structure of it.

Also: As a general programmer, but not necessarily a good C++ programmer, what could I be helpful with in contributing to simutrans?

jamespetts

Ahh - the save file format is a little haphazard, I'm afraid, and isn't formally documented anywhere. It works by the process of the code writing bytes representing certain data in a particular order and reading them back in the exact same order, with a number of additional complexities (versioning, for example, and groups of data, each of which use data read earlier to determine the format of the data that is to be expected next). I'm afraid that the only way to work out the format is to read the code.
Download Simutrans-Extended.

Want to help with development? See here for things to do for coding, and here for information on how to make graphics/objects.

Follow Simutrans-Extended on Facebook.

Ashley

I have done a certain amount of reverse-engineering of this when writing a little utility to parse the results of a gameinfo query. If you (like I) know Python fairly well then reading the relevant bits of the Simutrans code isn't too difficult. I'll try and post later when I have more time with a few pointers to get you started.
Use Firefox? Interested in IPv6? Try SixOrNot the IPv6 status indicator for Firefox.
Why not try playing Simutrans online? See the Game Servers board for details.

VS

One possibility is to write library that uses directly Simutrans code and interfaces with python. Other than that, you'll be always chasing a moving target, adapting your code to match ongoing changes. There is no documentation, as usual with open source... the source is the reference.

My projects... Tools for messing with Simutrans graphics. Graphic archive - templates and some other stuff for painters. Development logs for most recent information on what is going on. And of course pak128!