Overview of Assets in Civilization VII
Assets are the visual elements of your mod, including icons, portraits, textures, and other graphical resources. Properly importing and referencing these assets is crucial for creating polished and professional-looking mods. The TypeScript Modding Tools provide a streamlined workflow for importing and using custom assets.Importing Assets
The first step in using custom assets is importing them into your mod. This is done using theImportFileBuilder class:
Common Asset Types
Different game elements require different types of assets. Here’s how to import various common asset types:Referencing Assets in Game Elements
After importing assets, you need to reference them in your game elements. Here’s how to do that for different elements:Understanding File Paths
When referencing assets, you need to use the correct file path format:fs://game/- Prefix for game assets${mod.id}/- Your mod ID (creates a namespace)${assetName}- The name you specified when importing the asset
Asset Requirements and Best Practices
For the best results, follow these guidelines for your assets:- File Formats: Use PNG for icons and JPEG for larger images
- Resolution:
- Civilization icons: 256x256 pixels
- Unit icons: 128x128 pixels
- Leader portraits: 512x768 pixels
- Building icons: 128x128 pixels
- Transparency: Use transparency (alpha channel) for icons that should not be rectangular
- Naming Convention: Use descriptive, lowercase names with underscores
- Organization: Keep assets in an organized folder structure
Age-Specific Assets
For mods that span multiple ages, you can import age-specific assets:Importing Other Asset Types
Besides icons, you can import other asset types:Troubleshooting Asset Issues
If you encounter issues with your assets, check these common problems:- Incorrect File Path: Verify that the path to your asset file is correct
- Missing Asset File: Ensure the asset file exists at the specified location
- Unsupported Format: Check that you’re using a supported file format
- Wrong Action Group: Ensure the asset’s action group matches where it’s used
- Naming Conflict: Make sure asset names don’t conflict with existing game assets
- File Size Too Large: Overly large assets may cause performance issues