Shared asset format: store each asset once #5
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
An alternative to self-contained
.resonitepackagefiles: each asset is stored once, no matter how many items or world versions use it, and a normal package can be rebuilt without Resonite or the mod.Format
<name>.rlsitem: a.resonitepackagewithout the assets its records list inassetManifest. It keeps the records, the main object/world data and the thumbnails..assets/in the storage folder:Assets/<signature>,Metadata/<signature>.<type>,Variants/<signature>/<variant>. That's the layout inside a package, unzipped and shared..rlsitem, then add each manifest signature's files from.assets/that it doesn't already contain.Plan
ShareAssets(default off): new saves become.rlsitem; existing files keep their format, including when a world is saved over.assets/.rlsitemrefers to (trash included) move to.trash/tools/rebuild-package.py: standard library only, one file or a whole folder, verifies SHA-2566b39a8e, hot-loaded into the running game, no errors)ShareAssetson, spawn/open them, save the world overEvidence
RLS_ROUNDTRIP_DIR= the storage folder): all 6 packages come back entry for entry from both the C# and the Python rebuild. The 1.68 GB world becomes a 3.8 MB item file; "localstorage test" (a re-save of "(2)") and the clipboard image add nothing new to the store.In game: saving and loading shared items works. Found: assets of deleted items never left
.assets/, because the clean-up counted items in.trash/as users. Getting them out took emptying the trash by hand, a restart, and a second trip through the trash.Changed in 0.4.1 (
f7cb2ed): deleting a shared item turns it into a full.resonitepackagein the trash, then the store deletes what no remaining item needs. The same pass runs at startup, after every trash move and after saving over a shared world. Items that can't be rebuilt stay and keep their assets; an unreadable item stops the pass before anything is deleted.Verified:
rebuild-package.pyover the 6 real trashed items succeeded with all hashes checked.SM_Barrel.rlsitem. The 6 trash packages (1.29 GB) pass a zip integrity check.Still open: save a world with
ShareAssetson, open it, save over it.tools/rebuild-package.pychecked against the real storage folder (3065.rlsitemfiles, up to 6 folders below the root, 54 GB.assets). The storage folder was only read..assetsat the root, and no two outputs share a path.Fox V264/Gear(store four levels up): 57 of 57 rebuilt at their mirrored paths. Single-file mode from 6 folders down, run from another folder: works. Writing over an existing output without--forceis refused, exit 1.SharedPackage.Rebuildentry for entry and byte for byte, keeps every entry of the item unchanged, and holds every manifest asset. All 75,823Assets/entries hash to their names.packdb; cloud assets keep theirresdblink. 85,868resdblinks have their copy in the package. The 12 without one are a single.brsonthat theCloudSpawnavatars load from the cloud.neosdblinks in 1664 items have no copy, because vanillaPackageCreator.CollectAssetsonly packsresdbandlocal. Resonite can't load them anyway:SkyFrost.Base.GatherJobthrows "Unsupported scheme" for anything but http(s), ftp andresdb. Nothing is lost.The deep-subfolder cases are now in
PythonToolRebuildsTheSamePackages(0db9817). Suite: 87 passed, 1 skipped; tool tests also pass on Python 3.8.20.