Catalog.json: Difference between revisions
mNo edit summary |
Grzesiek11 (talk | contribs) m Use proper Wikipedia interwiki suffix |
||
(2 intermediate revisions by one other user not shown) | |||
Line 2: | Line 2: | ||
[[Category:Unity]] | [[Category:Unity]] | ||
'''catalog.json''' is a [[Wikipedia:JSON|JSON]] file used by the [[com.unity.addressables]] package in the [[Unity]] game engine. It is a list of all assets used in a game. | '''catalog.json''' is a [[Wikipedia:JSON|JSON]] file used by the [[com.unity.addressables]] package in the [[Unity]] game engine. It is a list of all assets used in a game. | ||
__TOC__ | |||
The name of the file can be different in each game. Most often it is <code>catalog_data.json</code>, but other options like <code>catalog_catalog.json</code> have also been found. The suffix (like <code>data</code> or <code>catalog</code>) can be chosen by the game developer, and some games can even have multiple content catalogs with different suffixes. | The name of the file can be different in each game. Most often it is <code>catalog_data.json</code>, but other options like <code>catalog_catalog.json</code> have also been found. The suffix (like <code>data</code> or <code>catalog</code>) can be chosen by the game developer, and some games can even have multiple content catalogs with different suffixes. | ||
Line 23: | Line 25: | ||
{{DataStructureField||string|An internal ID. May be a weird path, for example: <code>{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/crilocaldata_assets_all.bundle</code>; a 32-character-long hexadecimal string, for example: <code>033f3660efceadd40b8cd2845b485652</code>; an asset path, for example: <code>Assets/CriData/Addressables/dice20.daily.0.acb{{=}}4493e0.asset</code>; a short name, for example: <code>EfficientBlur</code>; a {{Tooltip|URL|The URL does not have to be reachable; it is not used for downloading assets, it is only used as an ID.}}, for example: <code><nowiki>http://rizastcdn.pigeongames.cn/default/Android/1a2a40bd550976c58c842045215f204e.bundle</nowiki></code>; and it probably can be any other UTF-8 string.}} | {{DataStructureField||string|An internal ID. May be a weird path, for example: <code>{UnityEngine.AddressableAssets.Addressables.RuntimePath}/Android/crilocaldata_assets_all.bundle</code>; a 32-character-long hexadecimal string, for example: <code>033f3660efceadd40b8cd2845b485652</code>; an asset path, for example: <code>Assets/CriData/Addressables/dice20.daily.0.acb{{=}}4493e0.asset</code>; a short name, for example: <code>EfficientBlur</code>; a {{Tooltip|URL|The URL does not have to be reachable; it is not used for downloading assets, it is only used as an ID.}}, for example: <code><nowiki>http://rizastcdn.pigeongames.cn/default/Android/1a2a40bd550976c58c842045215f204e.bundle</nowiki></code>; and it probably can be any other UTF-8 string.}} | ||
}} | }} | ||
{{DataStructureField|m_KeyDataString|string|[[ | {{DataStructureField|m_KeyDataString|string|[[wikipedia:Base64|Base64]] encoded string containing binary data. See [[#Key data binary format]] for details.}} | ||
{{DataStructureField|m_BucketDataString|string|[[ | {{DataStructureField|m_BucketDataString|string|[[wikipedia:Base64|Base64]] encoded string containing binary data. See [[#Bucket data binary format]] for details.}} | ||
{{DataStructureField|m_EntryDataString|string|[[ | {{DataStructureField|m_EntryDataString|string|[[wikipedia:Base64|Base64]] encoded string containing binary data. See [[#Entry data binary format]] for details.}} | ||
{{DataStructureField|m_ExtraDataString|string|[[ | {{DataStructureField|m_ExtraDataString|string|[[wikipedia:Base64|Base64]] encoded string containing binary data. See [[#Extra data binary format]] for details.}} | ||
{{DataStructureField|m_resourceTypes|array|A list of all of the types of assets in the catalog. (This field ''is'' lowercase.)| | {{DataStructureField|m_resourceTypes|array|A list of all of the types of assets in the catalog. (This field ''is'' lowercase.)| | ||
{{DataStructureField||object type object|An object type, for example: <code>{"m_AssemblyName": "UnityEngine.CoreModule, Version{{=}}0.0.0.0, Culture{{=}}neutral, PublicKeyToken{{=}}null", "m_ClassName": "UnityEngine.TextAsset"}</code>. See [[#Object type object structure]] for details.}} | {{DataStructureField||object type object|An object type, for example: <code>{"m_AssemblyName": "UnityEngine.CoreModule, Version{{=}}0.0.0.0, Culture{{=}}neutral, PublicKeyToken{{=}}null", "m_ClassName": "UnityEngine.TextAsset"}</code>. See [[#Object type object structure]] for details.}} | ||
Line 50: | Line 52: | ||
== Binary formats == | == Binary formats == | ||
''Note:'' All values are in [[ | ''Note:'' All values are in [[Wikipedia:little endian|little endian]]. | ||
=== Key data binary format === | === Key data binary format === | ||
Line 62: | Line 64: | ||
{{DataStructureField|key_type|uint8|1-byte number, indicating the type of the key. Known key types are: <code>0</code> - [[Wikipedia:UTF-8|UTF-8]] key; <code>1</code> - [[Wikipedia:UTF-16|UTF-16]] key; <code>4</code> - int32 key.}} | {{DataStructureField|key_type|uint8|1-byte number, indicating the type of the key. Known key types are: <code>0</code> - [[Wikipedia:UTF-8|UTF-8]] key; <code>1</code> - [[Wikipedia:UTF-16|UTF-16]] key; <code>4</code> - int32 key.}} | ||
{{DataStructureField|key_content|union|| | {{DataStructureField|key_content|union|| | ||
{{DataStructureField|text_content|sized string struct|Only present if key type is <code>0</code> or <code>1</code>. The type of the string is UTF-8 if <code>key_type</code> is <code>0</code> and UTF-16 (little | {{DataStructureField|text_content|sized string struct|Only present if key type is <code>0</code> or <code>1</code>. The type of the string is UTF-8 if <code>key_type</code> is <code>0</code> and UTF-16 ([[wikipedia:little endian|little endian]]) if <code>key_type</code> is <code>1</code>. This field is the key's name. See [[#Sized string binary format]] for details.}} | ||
{{DataStructureField|numeric_content|uint32|Only present if key type is <code>4</code>. This field is the key's name.}} | {{DataStructureField|numeric_content|uint32|Only present if key type is <code>4</code>. This field is the key's name.}} | ||
}} | }} | ||
Line 117: | Line 119: | ||
{{DataStructureField|class_name_length|uint8|1-byte integer, length of the following string.}} | {{DataStructureField|class_name_length|uint8|1-byte integer, length of the following string.}} | ||
{{DataStructureField|class_name|string|UTF-8 string, the length is stored in the <code>class_name_length</code> field.}} | {{DataStructureField|class_name|string|UTF-8 string, the length is stored in the <code>class_name_length</code> field.}} | ||
{{DataStructureField|payload|sized string struct|A little | {{DataStructureField|payload|sized string struct|A [[wikipedia:little endian|little endian]] UTF-16 string containing [[wikipedia:JSON|JSON]] data. The JSON structure is described below. See [[#Sized string binary format]] and [[#AssetBundleRequestOptions object structure]] for details.}} | ||
}} | }} | ||
}} | }} | ||
Line 124: | Line 126: | ||
==== AssetBundleRequestOptions object structure ==== | ==== AssetBundleRequestOptions object structure ==== | ||
''AssetBundleRequestOptions'' is a [[ | ''AssetBundleRequestOptions'' is a [[wikipedia:JSON|JSON]] document embedded within the extra data entry. It provides more information about downloadable asset bundles, for example, the [[asset bundle name]], [[asset bundle hash]], the size of the bundle and, other information. | ||
{{DataStructure| | {{DataStructure| |