Unity-Technologies / Unity-Technologies/UnityDataTools

Support repacking Archives (Lz4 compression configuration)

未关闭
#64 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

主要语言
C#
星标
821
派生
71
平均合并
3 小时 13 分钟
30 天内合并 PR
9

描述

With #62 the archive command is exposing the blocks and directory section of the archive metadata.
This task is to add an option for "repacking" an existing Archive file (e.g. an AssetBundle) into a freshly compressed Archive that has the same content.

Unity already has AssetBundle.RecompressAssetBundleAsync which can handle some transformation, for example compressed to uncompressed.

However currently there is no way to influence how files are split into individual blocks for the block based compression (LZ4 and LZ4HC). Unity always uses 128KB block size and will span over file boundaries.

This task is to add a command for repacking an archive. It could take the following configuration parameters:

  • more variability for the block sizes (max block size uncompressed (input) data, max block size compressed data)
  • how file boundaries are handled (span or always split)
  • padding between files
  • minimum compression factor (at what ratio to fallback to uncompressed) - avoiding on a block by block based an extra layer of compression when the data is already compressed.

This would allow some optimization, including picking configurations specifically fine tuned to the target platform's characteristics.

In my understanding so long as the Block and Directory data structures are properly populated then the Unity Runtime will be able to load the archive data properly, e.g that it already could support reading a wider range of blocking.

贡献指南

这个仓库没有索引到贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 archive 命令以及 #62 暴露的块和目录元数据开始。定义如何读取并重新打包现有的 Archive,同时保留其内容,然后指定块大小、文件边界、填充和压缩回退的配置;当 Unity 能够加载生成的归档时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
csharp, unity
领域
cli, tooling
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
冷清
描述清晰度
需要澄清
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。