The International Simutrans Forum

 

Author Topic: Pakset name for save file name  (Read 3209 times)

0 Members and 1 Guest are viewing this topic.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Pakset name for save file name
« on: July 28, 2014, 04:00:26 PM »
I have a such idea - to add paksetname into file name of save.


Some time ago, someone called idea that save files could be filtered in a way that if I would play (for example) pak96.comic, I could see only saves from this pakset.

I don't know why this idea was rejected.


... but this my idea would be way how to filter save files by pakset. And in game would be displayed only save name and date and time of creation (or last change) of save, without pakset name.

And two or more saves would have the same name, because pakset name would be included into file name.

So, while current file name is (for example) VMa-Arabie-31.sve or VMa-Aland-10.sve, new filenames would be VMa-Arabie-31.pak96comic.sve or VMa-Aland-10.pak128.sve.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5478
  • Languages: EN, NO
Re: Pakset name for save file name
« Reply #1 on: July 28, 2014, 04:14:54 PM »
I don't want to clutter my savegame file names with pak set names. The pak set is apparently (kind of) stored in the save game and shown in the loading screen. But I like the idea of being able to filter on that.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: Pakset name for save file name
« Reply #2 on: July 29, 2014, 07:56:45 PM »
The save and loading dialogues sort files that those with matchin pakset comes first. Then all games are first pakset and then name sorted already.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Pakset name for save file name
« Reply #3 on: August 02, 2014, 07:57:08 AM »
... so, even if game reads somewhere in sve file, what pakset it belongs (if I understood correctly), when deleting of games is done from OS, it would be good to see what pakset game belongs also in OS - and it may be done only with adding of name of pakset into name of file

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5478
  • Languages: EN, NO
Re: Pakset name for save file name
« Reply #4 on: August 02, 2014, 08:34:23 AM »
... so, even if game reads somewhere in sve file, what pakset it belongs (if I understood correctly), when deleting of games is done from OS, it would be good to see what pakset game belongs also in OS

But what if the user changes the name of the save game, in the OS, to not include the pak set name? What about all the countless save games that already exist without this format? Should the game automatically rename these save games? That will create a mess in my backup routines. And the game would either way have to deal with both naming schemes for a long time to come.

and it may be done only with adding of name of pakset into name of file

No. It is also possible to write an extension that displays extended information about a file in the file manager, but it must be done for every shell on every platform Simutrans can run on, and will only work when Simutrans is installed using an installer.

Offline DrSuperGood

  • Dev Team
  • Devotee
  • *
  • Posts: 2642
  • Languages: EN
Re: Pakset name for save file name
« Reply #5 on: August 07, 2014, 02:25:13 AM »
Simutrans could dump the Pakset info for a save into a simple text file in the main save folder. Each save would have an entry in this file. This would give an external way to look at the Pakset. Entries do not really need to be deleted from the file as it could represent a log of created saves.

As for in-game filtering of save list by pakset. This would suffer similar problems to Warcraft III taking 30+ seconds opening the custom game list with thousands of maps present. As it is having to parse information from the files itself to generate the list this means that opening the save game list becomes an O(n) file I/O operation as it reads the pakset info from each save file. This makes scalability a real issue forcing users to limit the number of valid files to prevent excessive time wastage.

The obvious solution would be some kind of caching save database which holds the pakset information from saves. Chances are a query would return considerably faster and scale considerably better than reading from a ton of files. You could also perform various types of filtering, such as completely excluding different foundation paksets (pak64 and pak128 save games are likely completely incompatible, as such it does not even allow the user to open them and instead when trying could mention the require pakset). Obviously this is a pretty large implementation challenge and chances are not worth the effort.

As for the save list itself, it should always have incompatible saves (wrong foundation pakset) at the bottom and default hidden to avoid clutter with a reveal flag somewhere in the dialog in case people want to find out what pakset a save was. Then saves made with different addons that are missing/present are shown above and the user is allowed to try and load them as they may or may not be compatible but is shown a warning what addon is missing. Above that are legacy saves, which are the correct pakset and addons but one or more is an older version. Finally at the top would be fully compatible saves, which were saved by the exact pakset with addons and revision that is being used.

I fear that pakset metadata might not be sufficient to do this. Each addon should have a name/unique identifier and a revision number in the save on top of the base pakset. This would be especially useful for multiplayer as currently you get all kinds of nonsense like "the following are missing or different". Having a clean dialog saying "You are missing X addon" or "Expects version X of addon, you are using Y" would be a ton more helpful.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5478
  • Languages: EN, NO
Re: Pakset name for save file name
« Reply #6 on: August 07, 2014, 09:14:11 AM »
Simutrans could dump the Pakset info for a save into a simple text file in the main save folder.

It sort of does. _cached.xml contains this information, although it's a little more complex than a simple text file. Pak set directory is in the second CDATA element in each save_game_info element.

The obvious solution would be some kind of caching save database which holds the pakset information from saves.

_cached.xml contains all the game needs to show the loading dialog.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9460
  • Languages: De,EN,JP
Re: Pakset name for save file name
« Reply #7 on: August 07, 2014, 03:42:31 PM »
Saving all addon information in the savegame would increase the payload dramatically, especially for stuff like the 128 paks with lots of buildings and vehicles. It would add another 25-50 MB to the savegame which needs to be transferred each time you join.

Furthermore, you cannot join (at least via GUI) if the hashes of you addons deviate. You can still join manually to get a list (and then be kicked out with a quick desync immediately) also this will annoy any one on the server.

Offline Václav

  • Devotee
  • *
  • Posts: 3230
  • formerly VaclavMacurek
  • Languages: CZ, EN
Re: Pakset name for save file name
« Reply #8 on: August 08, 2014, 07:43:39 PM »
So, why not to make adding name of pakset into file name unneccessary (only tied to decision of player) and let to be pakset filter as is. Simply: player would enable or disable adding pakset name into save file name in simuconf.tab. And this would be displayed as part of file name in game list or not.


config commands would be:

include_paksetname = 1
display_paksetname = 1


And in list of available games would be displayed for example (column with name of pakset would be available)

VMa-CZS-01.pak96comic
VMa-CZS-01

but file name would be still

VMa-CZS-01.pak96comic.sve

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5478
  • Languages: EN, NO
Re: Pakset name for save file name
« Reply #9 on: August 09, 2014, 07:20:23 AM »
I think stripping the pakname from the filename will be prone to fail. At least when one renames or deletes pak sets. The game can't know what to remove. This can even lead to multiple pak sets in the name.