Tuesday, November 13, 2012

GaDaBaMa 3.0 for F3 – sync options, thinking out loud

Since F3 the images are saved/packed in a new file: GameDataFolder.assets

Overwrite if dds file newer
In GaDaBaMa 2.x for FSD2 there was an option to overwrite the file (image) if dds file was newer. That was useful when doing a full sync and became - from my point of view - obsolete when SyncQueue was introduced. This function used filedate to determine wether to overwrite or not.
As .assets files only contains the image data without creation dates it is not possible to check which file would be newer. So this option will be gone.

Save dds files locally
In GaDaBaMa 2.x for FSD2 there was an option to save the converted JPG files as DDS locally. F3 still uses DDS format but does not save them as individual files. It would make more sense to give an option to save the .assets file locally but then again all dds files within that .assets file would need to be extracted to rebuild a new file with the changes. Changes done in STEP3 automatically deleted the old converted DDS file. Saving .assets files locally is also not an option.

My favourite way of syncing. But in F3 you can’t replace individual images. And to avoid blowing up the .assets file a rebuild of that file makes perfect sense.

F3 Sync
Because of that I’m thinking of using only one option to sync: SyncQueue + rebuild .assets file. To achieve a fast & practical sync I thought of this:
All images (JPG/PNG) in the SyncQueue are converted to DDS and saved locally (GaDaBaMa\DDS\GameId_Folder\*.dds). All files in that folder will be overwritten.

The.assets file header of the current game will be read and analyzed. Images that are not present in GaDaBaMa\DDS\GameId_Folder\*.dds will be extracted from the .assets file and saved locally.
All DDS files in the current game folder (GaDaBaMa\DDS\GameId_Folder\*.dds) will be packed in a new .assets file and saved (overwrite existing file) under F3\Data\GameData\GameId_Folder\GameId_folder.assets
  • Those having used GaDaBaMa since the beginning and saved all DDS files locally will certainly appreciate the fact that all previous work done was not in vain.
  • If you migrated to F3 through 2.2.1 you’ll see that each cover.dds was also saved this way.
  •  If you haven’t used GaDaBaMa before or you did not use the Save DDS locally option but you migrated to F3 through 2.2.1 you can copy FSD2\Data\GameData\*.* to GaDaBaMa\DDS\*.*. This way you’ll already have all images in DDS which have been used during migration to build .assets files. So next time you sync a game with new content there is no need for GaDaBaMa to extract those files from the .assets file.
Release date
STEP1/2/3 are already done. Build .assets file was already coded in the migration function. Extract images from .assets file is done as well. Only STEP4 is left. Comment if there is something I missed, otherwise I’ll proceed with STEP4 with the above logic.

1 comment: