Skip to content

Commit

Permalink
Resource graph documentation (#379)
Browse files Browse the repository at this point in the history
* update input

* update

* update code sharing in getting-help.md

* Export Compliance

* update on file i/o

* pi / 4

* inputs

* forum url

* read only user

* html5 gamepad

* sdk api update

* update

* image properties

* update editor

* defold sdk update

* animation updates

* animation fix

* run as admin

* update bob

* update about AndroidX support

* software render

* linux-faq.md update

* 4.28.2021 updates

* Basis Universal format

* sound & mesh

* gamepad event mapping

* admob url

* Minor edit to building blocks intro text

* update gamepad & ios

* project settings

* libffi version

* scaling

* image compression

* update gamepads

* increase memory

* caching assets

* update 2021/10/6

* update 2021/10/16
blend-modes.md

* update 2021/11/12

* allow dynamic transforms update

* Bundle update

* update faq

* bullet & bob

* script properties update

* editor-styling

* build server url

* editor templates

* spine extension update

* Fix typo in the "optimizations" word in Chinese docs

* Update to material.md - Constants buffers

* Verify Graphics Calls

* H5 parameters

* OpenJDK downloads

* cn update corresponds to [pull 259](#259)

* application security

* porting guidelines

* update for 8f1651f

* cn update for 094bf6f

* cn update for 20fdfc5 & 6263317

* cn update for 7/19/2022

* title

* profiling update

* update editor.md

* update bob.md

* update shortcuts

* update fixed update note

* Update properties.md

* Update material.md

* Updates links

* Update bob help with the latest info

* camera & renderer

* Updated android keystore info zh_cn

* bundling.md release vs debug zh_cn

* update bob.md & gui-clipping.md

* contentless bundle

* consoles update

* model animation link

* gamepad & faq

* remove a camera lib

* font shadow render mode fix

* updates about app-manifest and others

* Update script.md

* includes in shaders

* editor scripts

* material updates

* Added dynamic atlas and texture creation

* fixes for atlas and some others

* update screenshots and add explanations (CN)

* add a line about Dynamic Prototype (CN)

* remove "inline" marks in pics

* de-translate the subtitle "Running the debugger" & images fix

* bundle identifier restrictions

* node properties Enabled and Visible (CN)

* release checklist & slice-9

* Update project-settings.md (CN)

* Update camera.md (CN)

* Update project-settings.md (CN)

* culling of meshes (CN)

* Update project-settings.md (CN)

* gltf model file support (CN)

* updates about factory (CN)

* Update bob.md (CN)

* Update bob.jar help (CN)

* Update about renderer and other things

* Update PS4 development and other things

* Dynamic prototype part of the collection factory.

* sync to atlas.md

* sync to design.md

* sync to gpgs.md

* sync to hot-reload.md

* sync to linux.md

* sync to live-update.md

* sync to lua.md

* sync to networking.md

* sync to physics-shapes.md

* sync to push.md

* sync to test.md

* sync to working-offline.md

* update material.md

* update zerobrane.md

* all done

* Splitting .zip archives in live-update.md
  • Loading branch information
CocosGames authored Jan 27, 2024
1 parent 685694b commit 4181546
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions docs/zh/manuals/live-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,24 @@ brief: 热更新允许游戏运行时获取和存储编译时并不存在的资

我们目前的方法只支持单个 .zip 文件, 但是实际上把它分成若干小 .zip 文件是可行的. 这会让游戏下载更小的卷: level 包, 特典包等等. 每个 .zip 文件包含 manifest 文件描述了 .zip 文件里包含的资源的元数据.

## 拆分 .zip 卷

通常希望将被排除的内容拆分为几个较小的卷, 以便更精细地控制资源的使用. 一个实例就是把基于关卡的游戏拆分成多个关卡包. 另一个例子是将不同节日主题的 UI 装饰放入单独的存档中, 并仅加载和挂载当前节日的主题.

资源表保存在 `build/default/game.graph.json` 中, 该文件在项目打包时自动生成. 该文件包含项目中所有资源的列表及每个资源的依赖情况. 例如:

```json
{
"path" : "/game/player.goc",
"hexDigest" : "caa342ec99794de45b63735b203e83ba60d7e5a1",
"children" : [ "/game/ship.spritec", "/game/player.scriptc" ]
}
```

每个条目都有一个 `path` 代表项目中资源的唯一路径. `hexDigest` 代表资源加密指纹, 它在热更新 .zip 卷里作为文件名使用. 最后 `children` 项是该资源所依赖的其他资源的列表. 上例中 `/game/player.goc` 依赖于一个 sprite 和一个脚本文件.

你可以解析 `game.graph.json` 文件, 并以此来标识资源表中的条目组, 并将其相应的资源与原始清单文件一起存储在单独的卷中 (清单文件将在运行时进行修剪, 以便它仅包含卷中的文件).

## 内容验证

热更新系统的一大特性, 是可以使用多个数据卷, 而不管它来自哪个版本的 Defold.
Expand Down

0 comments on commit 4181546

Please sign in to comment.