-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Assets and authoring
Game assets are extremely important for the quality of a good game. Not only do the game assets need to be fitted for the game design, but they also need to load as quickly as possible and at the highest quality within the platform hardware limitations.
A very practical way to ensure that you're being efficient is to always bundle and load all your game assets as binary formats. Common assets include images, fonts, audio, and 3-D scenes. Most game engines will always include some sort of authoring tool to allow developers to encode and process their content to be game-ready. The gameplay framework also includes an executable tool for this called the gameplay-encoder.
For fonts and 3-D scenes, you will want to support industry-standard file formats, such as TrueType for fonts and popular modern 3-D scene formats such as COLLADA and the FBX formats.
Although these formats are popular and have the widest support in tooling options, they are not considered efficient runtime formats. The gameplay library requires that you convert these formats to its documented gameplay bundle format (.gpb) using the gameplay-encoder executable.
The gameplay-encoder executable tool comes pre-built for Windows 7 and Mac OS X and can be found in the <gameplay-root>/bin folders
. The general usage is:
gameplay-encoder <options> files
Even though the gameplay-encoder tool comes pre-built, you make want to customize it and built it again yourself. To build the gameplay-encoder project, open the gameplay-encoder project in Visual Studio or XCode and build the executable.
Although the FBX format is supported by the gameplay-encoder tools, FBX is not allowed to be re-distributed as part of our framework. However, it is free for you to use. Simply download the FBX SDK and then re-build the code in the gameplay-encoder using the USE_FBX preprocessor directive and ensure that you include the header and library paths in the project to the FBX SDK paths. README.md in the gameplay-encoder directory explains how to compile with FBX enabled.
The content pipeline for fonts and scenes works like this:
- Take any TrueType fonts or COLLADA/FBX scene files.
- Run the gameplay-encoder executable passing in the font or scene file path and optional parameters to produce a gameplay binary version for the file (.gpb).
- Bundle your game and include the gameplay binary file as a binary game asset.
- Load any binary game assets using the
gameplay::Bundle
class.
Use the gameplay::Bundle
class from your C++ game source code to load your encoded binary files as bundles. The class offers methods to load both fonts and scenes. Scenes are loaded as a hierarchical structure of nodes, with various entities attached to them. These entities include things like mesh geometry or groups of meshes, and cameras and lights. The gameplay::Bundle
class also has methods to filter only the parts of a scene that you want to load.
When releasing your game title, all of the images should be optimized and converted to the compressed texture format that is supported by OpenGL (ES). Audio should be encoded to save space on storage.