update final game assets structure

This commit is contained in:
dungdq 2025-06-12 14:23:40 +07:00
parent ade36e4a46
commit 73e27c2a6b
9 changed files with 117 additions and 11 deletions

View File

@ -196,6 +196,8 @@ Main game assets are stored in the `main-game` folder, organized by platform and
When a feature is activated, its assets are loaded directly, bypassing the main game asset folders.
:::
---
#### Feature Game Asset
##### Overview
@ -229,28 +231,132 @@ Feature game assets (e.g., free-game, pickup, bonus, gamble) are stored in a fol
|:-----------:|:-----------------:|:---------------:|
| ![Feature Game](./img/feature-assets.png) | ![Desktop Asset Structure](./img/feature-assets-desktop.png) | ![Mobile Asset Structure](./img/feature-assets-mobile.png) |
#### Localizes Asset
---
`localizes/` là nơi lưu trữ assets của các ngôn ngữ khác nhau như : ZH, TH, ID..v.v
#### Localized Assets
The `localizes/` folder contains assets tailored for different languages (e.g., ZH, TH, ID). This ensures that fonts and textures can be displayed appropriately for each supported locale.
##### Folder structure:
```plaintext
assets/
└── game-assets/
├── fonts/
│ ├── localizes/ # Localized font files
│ └── preloads/ # Fonts loaded at startup
│ ├── localizes/ # Fonts for each language
│ └── preloads/ # Default fonts (usually English) loaded at startup
└── textures/
├── desktop/
│ ├── localizes/ # Localized textures for desktop
│ ├── postloads/ # Desktop textures loaded after startup
│ └── preloads/ # Desktop textures loaded at startup
│ ├── localizes/ # Desktop textures for each language
│ ├── postloads/ # Desktop textures loaded after startup (default: en)
│ └── preloads/ # Desktop textures loaded at startup (default: en)
└── mobile/
├── localizes/ # Localized textures for mobile
├── postloads/ # Mobile textures loaded after startup
└── preloads/ # Mobile textures loaded at startup
├── localizes/ # Mobile textures for each language
├── postloads/ # Mobile textures loaded after startup (default: en)
└── preloads/ # Mobile textures loaded at startup (default: en)
```
sprite trong `preloads`, `postloads`: defaut là en
- Assets in `localizes/` are organized by language code (e.g., `zh`, `th`, `id`).
- Sprites in `preloads/` and `postloads/` use English (`en`) as the default language.
![Location](./img/localizes-assets.png)
---
#### Meta JSON Merger (Cocos Creator Editor Extension)
##### Purpose
Merges multiple JSON metadata files from `library/imports/` into one consolidated file (`fullMetaData.json`) to streamline asset management and build optimization.
![Purpose](./img/merge-json-assets.png)
##### Features
- Recursively collects `.json` files (excluding `fullMetaData.json`)
- Filters out:
- `cc.SceneAsset`
- `cc.Prefab`
##### Example
- **Input**: `{Project}/library/imports/**/*.json`
- **Output**: `{Project}/library/imports/fullMetaData.json`
```json
{
"asset1.json": { /* metadata */ },
"asset2.json": { /* metadata */ }
}
```
---
#### Texture Compression Tool (Cocos Creator Extension)
##### Purpose
This editor extension manages texture compression settings for game assets to optimize performance and build size.
![Compression](./img/compress-over.png)
##### Compression Settings
| Description | Action Compress Texture |
|:----------- |:----------------------:|
| Compresses all textures in:<br/>- `assets/Core`<br/>- `assets/game` | ![Compression](./img/compress-texture.png) |
| Compresses all textures in:<br/>- `assets/game` only | ![Compression](./img/compress-texture1.png) |
| Removes all compression settings | ![Compression](./img/compress-texture2.png) |
**Example:**
Compression settings for PNG and JPG formats:
![Compression Settings](./img/compress-setting.png)
##### Workflow
1. **Query** texture assets by UUID
2. **Apply** compression settings to their meta data
3. **Save** updated meta files
4. **Log** progress and handle errors in console
##### Benefits
* Reduces texture file sizes
* Speeds up builds and runtime loading
* Supports platform-specific formats
* Batch processing for efficiency
---
#### Remove Packable Texture Cocos Creator Tool
##### Overview
This editor extension removes the `packable` flag from all texture assets in your project, preventing them from being packed into texture atlases.
![Remove Packable](./img/remove-packable-texture.png)
##### Why Remove Packable
Removing the `packable` flag gives you:
- **Better memory management** load/unload textures individually
- **Prevents automatic atlas generation** useful for large or dynamic textures
###### Use Cases
- Large background images
- Special effects (particles, dynamic textures)
- Render textures
- Dynamically loaded assets
- High-res UI elements with custom compression needs
##### Query Texture
- Scans `db://assets/**/*` for all texture assets.
**Example:**
Compression settings for PNG and JPG formats:
![Remove Packable](./img/remove-packable.png)
---

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB