Current Development Reports

18 mrt 1999

File Format
I started to work on a new (binary) file format. Since Trainsim maps easily grow too large to safely edit manually anyhow, I might as wel create a more flexible binary format with some better provisions for downward compatibility.

Sofar I've made up a file format consisting of a block structure which allows to easily add more blocks once more data needs to be written (due to future features). The file format begins with a signature, then an info block which contains information on the editor version that wrote the file, the modification time and the name of the map. The next block is a field block which can grow as more fields are added. It might contain strings like "Author", "Description", etc. Then the map file block is needed to identify the map image which can be used as a background image for the editor (already available in Pre 6).

After that follow a number of blocks that contain the actual data. It contains info on the positions of all the nodes, the tracks they connect to, etc. These blocks will grow quite large. I expect the file to be a bit spacy (lots of zeros) due to the large data sizes I used. For example, each object (node, track, etc) will have a 4-byte identifier. Since a medium map will not have more than a few thousand objects, 2 bytes could be enough. However, try changing that in the future!!! Anyhow, spacy files are easily compressable.