Asset Definition Files
From Multiverse
| Asset Management |
|
Overview and Setup • Download an Asset Repository • Using Asset Importer • Using Asset Packager • Team Development |
| Reference |
|
Anatomy of a Repository • Asset Definition Files • Asset List Files |
Contents |
Overview
An asset definition file is an XML file with a .asset filename extension. It contains the definition of a single game/world asset. The Multiverse Tools use asset definition files to manage assets and dependencies among them.
All assets with asset definition files refer to other asset definitions. For example, a Mesh asset definition refers to a Material asset definition. This enables a material to be used with multiple meshes, and dynamically change the material used to paint a mesh. Likewise a material asset definition refers to a texture; so, textures may be referred to by multiple materials.
Assets that never refer to other assets, such as fonts, shaders, and scripts, do not have asset definiton files.
Runtime restrictions
The Multiverse Client will read all assets from any of the directories shown in the table below, with the following restrictions:
- Python scripts must be in
/Scripts. - Shader programs must be in
/GpuPrograms. - UI files and event handler scripts must be in
/Interface/FrameXML. - Imagesets must be in
/Interface/Imagesets.
Otherwise, asset files can go anywhere. However, the the Client will not load assets from:
- Nonstandard asset repository sub-directories, in other words, sub-directories other than
/Font,/GPuPrograms,/Icons, and so on. - New subdirectories of the asset repository sub-directories. For example, the Client won't read files from a
/Meshes/MyMeshsubdirectory.
Asset types
Each asset that references other assets has an asset definition file. Every asset requires one or more types of files, and each type of file goes into a sub-directory of the asset repository, as described below:
| Asset Type | Directory in Asset Repository | Description | Asset Definition File |
|---|---|---|---|
| Fonts | Fonts | Font files (such as TrueType .TTF files) for displaying text. | No asset definition file; only referenced by others. |
| Shaders | GpuPrograms | Programs for vertex and pixel shaders on Graphics Processing Units (GPUs) written in Cg. | No asset definition file; only referenced by others. |
| Icons | Icons | Image for an icon. | Refers to an icon (.ico) file. |
| Images | Imagefiles | Binary targa (.tga) image files. | No asset definition file; only referenced by others. |
| User Interface (UI) Files | Interface/FrameXML | XML files defining the client UI and associated Python event handlers. See Overview of Developing Client UI for more information. | Refers to a UI file, Imageset, and Image file. |
| Key Binding Files | Interface/FrameXML | Files to create key mappings (bindings), Bindings.xml and bindings.txt. | Refers to key binding files. |
| Imagesets | Interface/Imagesets | XML files containing imagesets. See Imageset Files for more information. | No asset definition file; only referenced by others. |
| Material Scripts | Materials | Files with .material extension written in OGRE material script language. Specifies attributes of a model's appearance, such as lighting and texturing. See Creating Material Scripts for more information. | Refers to a .material file, textures, and shaders. |
| Meshes | Meshes | Defines 3D models. | Refers to other .mesh files, a .skeleton file, and a .material asset definition. |
| Miscellaneous | Misc | Files that don't fit anywhere else. | |
| Videos | Movies | Video files such as .wmv files. | |
| Particle Scripts | Particles | Particle script files. For more information, see the Particle Scripts. | Refers to a .particle file, material asset definition |
| Physics / Collision Volumes | Physics | XML files that define collision volumes for models. | No asset definition file; only referenced by others. |
| Plant Type | N/A | Defines a plant type for World Editor. | Refers to an imageset and a material asset definiton. This is an unusual asset definition. |
| Python Scripts | Scripts | Python scripts. | Refers to a .py file |
| Skeletons | Skeletons | Binary files defining models' bones, the bone hierarchy, and animations expressed in terms of the bones. | No asset definition file; only referenced by others. |
| Sounds | Sounds | Audio files for music and sound effects. | Refers to a binary .ogg or .wav file. |
| SpeedTree | SpeedTree | Tree model from SpeedTree. | Refers to a binary SpeedTree (.tre) file, texture files. |
| Textures | Textures | Binary image files such as .dds and .png files. | No asset definition file; only referenced by others. |
| Wind | SpeedTree | SpeedTree wind file | Binary image files such as .dds and .png files. |
Example
The following is an example of an asset file for a mesh asset. Notice how it references a material asset, human_house_stilt_Material.asset.
<?xml version="1.0" encoding="utf-8"?>
<AssetDefinition>
<Name>human_house_stilt_Mesh</Name>
<Description>Human Stilt House</Description>
<Type>Mesh</Type>
<Category>Buildings</Category>
<Files>
<AssetFile>
<TargetFile>Meshes\human_house_stilt.mesh</TargetFile>
<FileType>Mesh</FileType>
</AssetFile>
<AssetFile>
<TargetFile>AssetDefinitions\human_house_stilt_Material.asset</TargetFile>
<FileType>AssetDefinition</FileType>
</AssetFile>
</Files>
</AssetDefinition>
