BOD body syntax

From X-Wiki

Jump to: navigation, search


BOD body files are plain text files and can be modifed with common text editors (such as Microsoft Notepad).

Contents

Example of BOD body

Example of BOD file containing body as exported with DBOX2.

/# Exported with dbox2 at 6.6.2006 14:37:05
 
MATERIAL6: 0; 0x2000000; 1; argon.fx; 4; 
t_DiffuseTexture;SPTYPE_STRING;metal_argon_misc_tech_diff.dds; 
t_SpecularTexture;SPTYPE_STRING;NULL; 
t_BumpTexture;SPTYPE_STRING;NULL; 
t_LightMapTexture;SPTYPE_STRING;NULL; 
 
2353; // body size
// vertices (12)
-45952; -61497; -100000; // 0
45952; -61497; -100000; // 1
-45952; -61497; 100000; // 2
45952; -61497; 100000; // 3
-45952; 61497; -100000; // 4
45952; 61497; -100000; // 5
-45952; 61497; 100000; // 6
45952; 61497; 100000; // 7
-45952; -61497; -100000; // 8
-45952; -61497; 100000; // 9
-45952; 61497; -100000; // 10
-45952; 61497; 100000; // 11
-1; -1; -1; // end of verts
 
// ----- part Box01 (10 faces) -----
0;  3; 2; 0;  -17; 2; // 0
0;  0; 1; 3;  -17; 2; // 1
0;  7; 5; 4;  -17; 4; // 2
0;  4; 6; 7;  -17; 4; // 3
0;  5; 1; 0;  -17; 8; // 4
0;  0; 4; 5;  -17; 8; // 5
0;  7; 3; 1;  -17; 16; // 6
0;  1; 5; 7;  -17; 16; // 7
0;  6; 2; 3;  -17; 32; // 8
0;  3; 7; 6;  -17; 32; // 9
-99; 00000000000000000001; // end of part
// ----- part cockpit (2 faces) -----
0;  10; 8; 9;  -17; 64; // 0
0;  9; 11; 10;  -17; 64; // 1
-99; 00001000000000000001; // end of part
-99; 0000000000000000; // end of body
Note: The material6 definition was manually splitted across multiple lines

The above example is showing a simple "cube" with only 5 sides, the 6th side was detached and converted to a cockpit part. The cube has a texture applied on it. This body is functionally equivalent to Camera Dummy.

Syntax and structure

BOD body files are using the standard BOD syntax.

BOD body file

<material 1>
<material 2>
<material n>

<full body>
<reduced body level 1>
<reduced body level 2>
<reduced body level n>

Material

Example material block has following structure (this section needs to be rewritten to expain):

MATERIAL6: 0; 0x2000000; 
1; 
standard_lighting.fx; 
61; 
diffcompression;SPTYPE_BOOL;0; 
bumpcompression;SPTYPE_BOOL;0; 
speccompression;SPTYPE_BOOL;0; 
lightcompression;SPTYPE_BOOL;0; 
nofiltering;SPTYPE_BOOL;0; 
autofree;SPTYPE_BOOL;0; 
Tex2;SPTYPE_BOOL;0; 
TexAnimStartU;SPTYPE_FLOAT;0.0; 
TexAnimStartV;SPTYPE_FLOAT;0.0; 
TexAnimEndU;SPTYPE_FLOAT;0.0; 
TexAnimEndV;SPTYPE_FLOAT;0.0; 
TexAnimDuration;SPTYPE_FLOAT;0.0; 
TexAnimRotation;SPTYPE_FLOAT;0.0; 
TexAnimOriginU;SPTYPE_FLOAT;0.5; 
TexAnimOriginV;SPTYPE_FLOAT;0.5; 
Brightness;SPTYPE_FLOAT;1.0; 
contrast;SPTYPE_FLOAT;1.0; 
saturation;SPTYPE_FLOAT;1.0; 
hue;SPTYPE_FLOAT;0.0; 
colormatrix;SPTYPE_BOOL;0; 
g_ColorWriteEnable;SPTYPE_LONG;15; 
g_Wrap;SPTYPE_LONG;0; 
g_CullMode;SPTYPE_LONG;2; 
g_AlphaBlendEnable;SPTYPE_LONG;0; 
g_BlendOp;SPTYPE_LONG;1; 
g_SrcBlend;SPTYPE_LONG;2; 
g_DestBlend;SPTYPE_LONG;1; 
g_ZEnable;SPTYPE_LONG;1; 
g_ZWriteEnable;SPTYPE_LONG;1; 
g_ALPHATESTENABLE;SPTYPE_LONG;0; 
g_LightAmbientIntensity;SPTYPE_FLOAT4;0.0;0.0;0.0;0.0; 
LightDir_Dir0;SPTYPE_LONG;0; 
LightDir_Color0;SPTYPE_FLOAT4;1.0;1.0;1.0;0.0; 
LightDir_Dir1;SPTYPE_LONG;0; 
LightDir_Color1;SPTYPE_FLOAT4;0.0;0.0;0.0;0.0; 
g_MatSpecularStrength;SPTYPE_FLOAT;3.0; 
g_MatSpecularPower;SPTYPE_FLOAT;6.0; 
g_MatReflectionStrength;SPTYPE_FLOAT;0.5; 
g_MatReflectionBias;SPTYPE_FLOAT;1.0; 
g_MatReflectionBlur;SPTYPE_FLOAT;1.0; 
g_AlphaValue;SPTYPE_FLOAT;1.0; 
g_MatEmissiveColor;SPTYPE_FLOAT4;0.0;0.0;0.0;0.0; 
t_FilterTypeDiffuse;SPTYPE_LONG;2; 
t_SamplerAddressMode;SPTYPE_LONG;1; 
t_SamplerMaxAnisotropy;SPTYPE_LONG;8; 
t_MipMapLODBias;SPTYPE_FLOAT;0.0; 
t_DiffuseTexture;SPTYPE_STRING;metal_argon_simple_plating_diff.dds; 
t_MinFilterTypeDiffuse;SPTYPE_LONG;3; 
g_MatDiffuseStrength;SPTYPE_FLOAT;0.5; 
t_AlphaTexture;SPTYPE_STRING;metal_argon_simple_plating_diff.dds; 
t_BumpTexture;SPTYPE_STRING;metal_argon_simple_plating_bump.dds; 
t_MinFilterTypeBump;SPTYPE_LONG;3; 
t_BumpMipMapLODBias;SPTYPE_FLOAT;0.0; 
t_FilterTypeBump;SPTYPE_LONG;2; 
t_SpecularTexture;SPTYPE_STRING;metal_argon_simple_plating_low_bump.dds; 
t_LightMapTexture;SPTYPE_STRING;NULL; 
t_CubeMapTexture;SPTYPE_STRING;effects\others\envmap_test.dds; 
effectfile;SPTYPE_STRING;argon.fx; 
renderEnabled;SPTYPE_BOOL;1; 
renderMaterial;SPTYPE_LONG;2; 
technique;SPTYPE_LONG;1; 

Body

Every body block has following structure:

<body size>

<vertex 1>
<vertex 2>
<vertex n>

<part 1>
<part 2>
<part n>
<body flags>

Part

Every part has structure:

<face 1>
<face 2>
<face n>
<part flags>

Face

<vertex index 1> <vertex index 2> <vertex index 3>
<flags>
<smoothing group ID>
<UV for vertex 1> <UV for vertex 2> <UV for vertex 3>

Whether the face definition contains smoothing group ID and/or UV coordinates depends on value of the flags field:

flags:

Bit field. Only two bits are used:

  • FLAG_UV = 8 (UVW coordinates are present)
  • FLAG_SGID = 16 (smoothing group ID is present)

Empirical data (and how old X2BC worked):

-1 
no smoothing group ID, no UV
-9 
no smoothing group ID, UV
-17 
smoothing group ID, no UV
-25 
smoothing group ID, UV
Personal tools
sections