Table of Contents
This is an old revision of the document!
SOD Files
What is an SOD?
Star Trek: Armada is based on the Storm3D Engine which was introduced with Battlezone. As such it uses basically the same technology. Storm3D Object Definition files, or SODs for short, are Battlezone's/Armada's means of defining three dimensional objects, including their texture/material use, mesh definition and model hierarchy. In essence, they form the models of units, stations and other 3D objects of the game.
Location and Contents of SODs
They are placed in SOD folder of the game installation folder. They do not come with the texture files included in themselves. Those are still placed in folder Textures\RGB in form for TGA files. But their names are referenced by the SODs. Together with sprites and emitters they form the full model, that can then be used by ODF Files.
The 3D mesh part of the model must be created/modified with some sort of 3D modeling tool, such as Storm3D Tool, Milkshape 3D or 3DS Max. But usually they require some sort of importer and exporter to make SODs usable. The application of textures is also very often done with the same tools, while the creation of such textures is done with graphics programs such as GIMP.
The node hierarchy is also applied by the modeling tools, but depending on which you use, you might need another one to get it working properly. (E.g. Milkshape 3D is not particularly well suited for the directing of nodes, but at least you can create and place them.) The sprites and emitters are described somewhere else, but must be made referenced by the hierarchy by name.
Format of SODs
The following is taken from the document created by Steve Williams. You can find this original source in section Web Links.
Data Types Used
SODs are for the most part binary content files. This article describes version 1.8 of the SOD format. To understand how SODs work, you need to know the following data types:
Datatype Name | Format |
---|---|
UINT8 | unsigned 8 bit integer |
UINT16 | unsigned 16 bit integer |
UINT32 | unsigned 32 bit integer |
FLOAT | 4 bit floating point number |
VECTOR2 | two FLOATs, u and v |
VECTOR3 | three FLOATs, x, y and z |
MATRIX34 | four VECTOR3s, Right, Up, Front, Position, note: Matrices must be orthogonal |
COLOR | three FLOATs, red, green and blue, each with values between 0.0 and 1.0 |
TYPE ARRAY(number) | An array of number values of type TYPE |
IDENTIFIER | one UINT16, making up the length of the following string, then UINT8 ARRAY(length of the string), the actual string. Note: The length of the string is mandatory, but for a string of length 0 the contents following ware of course of length zero (nothing). So the shortest IDENTIFIER you may encounter is of 2 bytes length. |
File Structure
An SOD consists of five sections:
- File header,
- list of lighting materials
- node hierarchy definition (recursively, starting with the root node).
- animation channels and
- animation references.
File Header
Every SOD starts with the ASCII string Storm3D_SW
, followed by the version of the used format in form of one FLOAT value. So the header always has the length of 14 bytes. For Star Trek: Armada the version is 1.8, making the 4 version bytes always be 0x66 0x66 0xE6 0x3D.
Lighting Materials
The second section of an SOD contains the characteristics of the vertex lighting materials. To understand this, we need some more definitions.
The surface lighting can use Phong reflectivity model or Lambertian reflectance. The model used can be one of the following three:
LIGHTING_MODEL:
Type | Number |
---|---|
Constant | 0 |
Lambert | 1 |
Phong | 2 |
Each surface can use a lighting material, which is defined like this:
LIGHTING_MATERIAL:
Data Type | Meaning |
---|---|
IDENTIFIER | Name of the lighting material |
COLOR | Ambient lighting component |
COLOR | Diffuse lighting component |
COLOR | Specular lighting component (using Phong reflection model]]) |
FLOAT | Specular power exponent, the »shinyness« of the Phong reflection material |
UINT8 | LIGHTING_MODEL |
The full list of lighting materials consists of the following information:
- UINT16: The number of materials defined in the SOD.
- LIGHTING_MATERIAL ARRAY(<number of materials>).
Nodes
Nodes have various implications on the behavior of a unit or station, including things like firing direction, damage indicators or LODs used. They come in five different types.
NODE_TYPE:
Type | Number |
---|---|
null | 0 |
mesh | 1 |
sprite | 3 |
LOD control | 11 |
emitter | 12 |
A node as such can be of the described type and may need additional information, depending on the type. But the general node definition looks somewhat like this:
NODE
Data Type | Meaning |
---|---|
UINT16 | NODE_TYPE |
IDENTIFIER | Name of the node |
IDENTIFIER | Name of its parent node. In case of the root node, that has no parent, it's an empty string |
MATRIX34 | Local transform |
TYPE_SPECIFIC_DATA<Type> | Data specific to nodes of the given type. See below specifications on this data. |
Null Node Data
This particular type has no additional data. It is solely used to mark locations and directions, e.g. for hardpoints and to function as grouping points for other child nodes making up the hierarchy.
LOD Control Data
Similar to Null nodes, this node has no data. It serves as a grouping node for child LOD nodes. Depending on distance and size of a mesh used for LODs, the corresponding mesh is used for display or not.
Sprite Node Data
Those come in two flavors, actual sprites and particle emitters.
Actual sprite nodes do not have any actual data by themselves. The IDENTIFIER of the node itself contains the information. They serve as a localization means, including direction for sprites to face at. The actual sprite information comes from the sprite itself.
The emitters on the other hand need an additional IDENTIFIER for emitter sprites:
TYPE_SPECIFIC_DATA<PARTICLE_EMITTER>
Data Type | Meaning |
---|---|
IDENTIFIER | Name of the emitter, as defined by the sprite file, see Emitter Names on stock game emitters. |
Polygon Mesh Data
These nodes tie the mesh to the hierarchy.
TYPE_SPECIFIC_DATA<MESH>
Data Type | Meaning |
---|---|
IDENTIFIER | Texture material name, can be an empty string for default. See also TEXTURE_MATERIAL in Animation References. |
IDENTIFIER | Texture (can be an empty string, of none is applied) |
UINT16 | Number of vertices |
UINT16 | Number of texture coordinates |
UINT16 | Number of vertex lighting groups |
VECTOR3 ARRAY | vertex positions |
VECTOR2 ARRAY | Texture coordinates |
VERTEX_LIGHTING_GROUP ARRAY | VERTEX_LIGHTING_GROUP entries, see definition below |
UINT8 | Cull type (0 = no culling, 1 = backface culling) |
UINT16 | Always 0 |
VERTEX_LIGHTING_GROUP