|
|
Overview: The INI Compiler is the console application for converting files with text format to the files with binary format. It is useful to save settings for the application in binary format. Currently MobileDragon supports two types of such settings files: LOD settings file and Texture Animation settings file. Creating of these files is described bellow. You may to create your own settings files with unique formats.
Source file format: Source files can have any extension, but they have to
have content only in text format. [group_name] INI Compiler supports converting of few data formats:
String, Integer and Float. Value with Float format will be converted to
the value with Fixed point (16.16) format. Name of parameter defines its
data format. [s|i|f]_param_name The first symbol of parameter’s name defines value format
of this parameter. There is complete example of content of source file: [house1] [other_house]
Output file format: INI Compiler DO NOT saves names of parameters in the
output file, but it saves group’s name. Also every group in the output
binary file is separated by Header. Header defined as 4 bites hexadecimal
value 0xAAAAAAAA. After header that precedes every group in the file placed
file position of the data block of next group. This position is represented
as 4 byte integer value.
Every string value is saved as null terminated string.
Running: INI Compiler takes one startup parameter from the command
line. This parameter is the name of source ini-file (with any extension)
for converting. INI Compiler will create *.dat file with the same name
and in the same directory as source file. For example after converting
source file with name “settings.txt”, new file with name “settings.dat”
will be created in the same directory. This file is the output binary
file.
Creating of LOD settings file: Mobile Dragon 3D API provides support of Levels Of Details
(LOD) technology. To use LOD in the 3D application, it’s necessary to
create set of scenes with different LOD first (see 3D MAX Exporter documentation
for more details). After this it’s necessary to create LOD settings file.
This file describes how objects with different LODs will be linked. It’s important to name objects by unique names, even
if some objects belong to equal conception (for example all houses can’t
have equal names “house”, we have to name them “house01”, “house02” etc.).
But it’s possible to set common settings for these objects by replacing
unequal symbols of name with “?” symbol. For example if we need to set
common LOD settings for all objects with names “house01”, “house02” and
“house03”, we have to name the group for these objects like “house??”.
Here symbol “?” is a substitute of last two symbols of every name. [house01] //
name of settings group equals to object’s name Why we have set switch radius for the last (4-th) LOD
level if we have only 4 LOD levels? In fact it means that switch to the
next 5-th level will occur, but this 5-th level is dummy LOD level and
when distance from camera to the “house01” will reach 30, this object
will not be drawn (it’ll disappear). If we need this object to stay visible
after it will reach 4-th LOD level, we have to set switch radius for the
last (4-th) level to zero. In fact, zero-radius is the infinite switch
radius. [house01] //
name of settings group is equal to object’s name So, let’s create complete LOD settings file for the whole scene. We have a few objects in the scene and few requirements described in the table below:
Let us suppose that switch radiuses for corresponding
LOD levels (if they are available) for all objects are equal: Here is complete content of LOD settings file for this scene: [house??] [tree??] [well] [well] And the last feature. When MobileDragon loads LOD settings from *.dat file, it creates a list of switch radiuses for each object and then sorts this list by increment. It takes into account that zero-radius is the largest possible radius. Thus if you’ll make an error and set radiuses not by increment, MobileDragon will fix it. For example you’ll write the following: [tree??] MobileDragon will interpret it as: [tree??]
Creating of Texture Animation settings file: MobileDragon includes special features, which allow to play and control texture animation. It is a simple realization of texture animation that based on textures switching. To play texture animation MobileDragon needs to know the list of textures and delays for each of them. To create settings file for texture animation we have to use the INI Compiler application. In this file we have to define file names of textures and its delays. One settings file can define several texture animations. The name of settings group will be interpreted as the name of texture animation. Settings block for one texture animation have to correspond with following format: [animation_name] For example, we need to create two texture animation. Each of them has 4 frames – 4 textures in series. Now we have to create the following settings file for these animations. [face_animation]
// first texture animation (face animation) [water_animation]
// second texture animation (water animation)
Copyright 2005-2006 Herocraft Hitech Co. Ltd. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||