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>).