News:

Simutrans Sites
Know our official sites. Find tools and resources for Simutrans.

Explicit savegame format

Started by Fabio, March 16, 2012, 12:23:13 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Fabio

(From this thread: http://forum.simutrans.com/index.php?topic=9514.0)

Why do all savegames need to have .sve extension?
I want to suggest a new naming convention for savegames:





.sveuncompressed binary
old saves in any format
.sve.bz2
(or .svez)
bzipped binary
.svxuncompressed xml
.svx.bz2
(or .svxz)
bzipped xml

This way, saving in one format will NEVER overwrite another format and its explicit in the saves folder which file is which format.




Additionally, I also believe the format should be selectable in a combo box in save dialog (default being that in simuconf).

And in load dialog the save format should be listed together with version info.

prissi

Why should a normal user care on the format? Even the old ASCII format was in SVE extension. And a checkbox will only confuse normal user. The standard is bz2 binary. A normal user should not change this. For the same reason: Diplaying the internal format of a save qill equally confuse a user. Simutrans will load all files it produces; actually simutrans will load any savegame made since version 84.00.

If you have one extension, OS like windows can associate SVE with simutrans save games ... That way you know what is in.


Fabio

Well, the purpose is to avoid something like what happened in the linked thread. I think same format should have same extension and conversely different form should have different extension.

On a different level, could the command line -load save.sve recognize the pakset of the savegame supplied? It would be very nice, because you could have a windows shell association so that double clicking on save.sve starts simutrans (with the appropriate pakset if installed) and loads the save. It could be done with a "<simutrans_folder>\simutrans.exe -load=%1" association in Windows and possibli also in other OSes.

An_dz

#3
Rather than this, I would say Simutrans create a backup right when you save your file. You save over an existing game, Simutrans change the original file name to .bksve and save a new file as .sve. If already have one .bksve, this file is destroyed and the existing save is changed to .bksve.

With backups being .bksve it would be easier to make that request from months ago about making an area in save dialog for backups. I would just extend that request to make this as a new tab. Saves and Autosaves. And to make the autosaves use this name: OriginalSaveNameX.bksve. So every savegame will have his own autosaves that won't be wrote over. For instance, an standard of 3 backups every 2 months would be great, plus the backup when you save. This special save could be named OriginalSaveName-LastSave.bksve.

Ters

If there are two files with the same name, but different extensions, I will assume that there is some fixed relationship between them. This may either be that one of them is a backup like in An_dz's proposal, or that one file contains the vehicles and another the map. In any case, the name alone should uniquely identify a game (the backup file isn't directly loadable, it must be renamed first, or loaded if the current version can't be loaded because it's broken).

I like the idea of automatic backups when saving.

Fabio

@ters:

I can work in GIMP with thisimage.xcf, then export it as thisimage.png. The relation is that latter is an export of the former. After that I can post-process the png (e.g. with SHADES or TileCutter) and the relationship slackens, but originally they were different formats for the same image. So would be with savegame formats.

I also automated backup idea, too ;)

Ters

True, but for images there is the notion of an original. With Simutrans savegames, no format is more original than the other, in relation to the game.

prissi

A backup is easily done; one could for instance use ".old" as extenesion or ".bak". However this would increase the savegame folder quite substancially. And shoudl teh cross delete or just rename a file to to backup?

An_dz

I already wrote in my first post, but it's a little confusing, so here's a more detailed idea:

Simutrans keep autosaving every n months, standard values should be every 3 months with max of 3. This autosaves will receive .bksve extension. And their names will be SaveNameX, where X is the number of the autosave, starting with 0 than going to 1 and 2 and than back to 0, and keep saving over.
But when you manually save, if that save already exist, Simutrans could change the name of the original file to SaveName-LastSave.bksve. And if that backup already exist, deletes it and remane the last save again.
Since those files are .bksve Simutrans can easily see it's a autosave and can show them just in a autosave tab in Load dialog.