Game Development Reference
In-Depth Information
5.2 Usual Metadata
We deal with intrinsic metadata first. Each type of game asset like textures, ge-
ometric models, animations, and sounds has its own set of metadata that can be
a frequent target of queries during development. All the metadata should be col-
lected and cached the first time the tool is run. This may be time consuming. Once
cached, that data should be saved in a persistent format and properly updated when
any asset changes. Also, this kind of operation should be fast enough, even with a
huge number of assets, so as not to block a developer's workflow. A plain file first
comes to a mind as a storage format.
5.2.1 Storage Format to Use
One should first choose whether to use a text or a binary file. Then, the exact file
format should be decided upon. Though a binary format can generally be more
compact and more ecient to parse, I'll discuss using a text format for the sake of
human readability and personal preference (Nonetheless, the overall concept is also
applicable to binary formats).
For a file format, I recommend XML [Wiki 11a] or JSON [Wiki 11b] because
both are quite flexible, battle-tested formats. Also, there are many public parser-
s/generators for these formats, and one of them can be easily incorporated into the
existing game/engine code; however, any reasonable text format will work. One
should keep in mind that the parsing speed should be fast enough for a 10 MB
or larger file in order to avoid doing harm to the overall loading time of the edi-
tor. This should be considered when choosing between an open-source/commercial
parser or implementing your own.
5.2.2 Don't Block the User
Parsing the metadata persistence file and applying the loaded data to the editor
may take a few seconds. Also, you should recompute the metadata for changed
or newly added assets. Above all, on the first run (meaning no asset metadata
has been previously cached), the editor should compute and cache metadata for all
assets before this system can be practically used by a level designer. Even for the
first time, the system must respond to user inputs like scrolling and then compute
metadata for visible assets first in order to be useful as soon as possible.
Thus, background processing or threading must be considered while designing
the system. Also, it'll be a great advantage if the underlying engine supports a
threaded or background loading of various types of assets. Otherwise, one should
resort to a nonideal timer-based approach for loading assets and caching their meta-
data.
Search WWH ::




Custom Search