en:games:star_trek_armada_1:modding:sod_files
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:games:star_trek_armada_1:modding:sod_files [2025-03-23-11-28] – [Polygon Mesh Data] 7saturn | en:games:star_trek_armada_1:modding:sod_files [2025-04-23-20-19] (current) – [File Header] 7saturn | ||
---|---|---|---|
Line 37: | Line 37: | ||
Every SOD starts with the ASCII string '' | Every SOD starts with the ASCII string '' | ||
+ | **Note**: There are two stock game files, // | ||
==== Lighting Materials ==== | ==== 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 second section of an SOD contains the characteristics of the vertex lighting materials. To understand this, we need some more definitions. | ||
Line 64: | Line 65: | ||
- LIGHTING_MATERIAL ARRAY(//< | - LIGHTING_MATERIAL ARRAY(//< | ||
+ | Note: Lighting materials are usually not unique to a specific SOD but used by multiple SODs. As this is the case, loading can be expedited considerably by not loading lighting materials anew for each SOD, but looking for already loaded materials from previously loaded SODs. One implication of that is, that the materials are consistent across SODs. One special aspect about this is the file // | ||
+ | |||
+ | **Note**: While the above definitions work just fine with colors, one thing that is not immediately obvious is how team colors are created. Any material whose name starts with //team_// will be colored with the team color. This means, there can be multiple, different materials, that will exhibit the team color. Applying such a material to a mesh will make it glow in the color of the team. | ||
==== Nodes ==== | ==== 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. | + | The third section in an SOD are the nodes, which have various implications on the behavior of a unit or station, including things like firing direction, damage indicators, mesh referencing |
NODE_TYPE: | NODE_TYPE: | ||
Line 100: | Line 104: | ||
| IDENTIFIER | Name of the emitter, as defined by the sprite file, see [[en: | | IDENTIFIER | Name of the emitter, as defined by the sprite file, see [[en: | ||
=== Polygon Mesh Data === | === Polygon Mesh Data === | ||
- | These nodes tie the mesh to the hierarchy. | + | These nodes tie the mesh to the hierarchy. Meshes consist of vertices, making up faces. Each face can have its own lighting properties. |
+ | |||
+ | The vertices in the SOD sense consist if two values, one for the actual mesh and one for the tied-to-it texture vertex. The coordinates are not stored directly but in form of the indices in the vertex arrays of mesh vertices and texture vertices. The combination of both makes it possible to map a texture onto a surface made up of faces very specifically. | ||
+ | |||
+ | FACE_VERTEX | ||
+ | ^ Data Type ^ Meaning | ||
+ | | UINT16 | Index of a vertex position from the vertex positions array | | ||
+ | | UINT16 | Index of a vertex position from the texture coordinate array | | ||
+ | |||
+ | A face is made up by three vertices. As such each face references three vertices: | ||
+ | |||
+ | FACE | ||
+ | ^ Data Type ^ Meaning | ||
+ | | FACE_VERTEX | First vertex position | | ||
+ | | FACE_VERTEX | Second vertex position | | ||
+ | | FACE_VERTEX | third vertex position | | ||
+ | |||
+ | The lighting of each face is basically a combination of all faces with the same lighting material tied with said material into one so-called lighting group. | ||
+ | |||
+ | VERTEX_LIGHTING_GROUP | ||
+ | ^ Data Type ^ Meaning | ||
+ | | UINT16 | Number of faces/ | ||
+ | | IDENTIFIER | Name of the lighting material, empty string if none | | ||
+ | | FACE ARRAY | Array of the faces using the same lighting material | | ||
+ | |||
+ | A mesh is then made up of vertex positions as well as texture positions and the texture name itself, as well as the material. The number of said vertices and texture positions as well as the number of lighting groups is stored in a mesh information, | ||
TYPE_SPECIFIC_DATA< | TYPE_SPECIFIC_DATA< | ||
^ Data Type ^ Meaning | ^ Data Type ^ Meaning | ||
- | | IDENTIFIER | Texture material name, can be an empty string for default. See also TEXTURE_MATERIAL in [[#animation_references|Animation References]]. | | + | | IDENTIFIER | Texture material name, can be an empty string for default. See also section |
| IDENTIFIER | Texture (can be an empty string, of none is applied) | | | IDENTIFIER | Texture (can be an empty string, of none is applied) | | ||
| UINT16 | Number of vertices | | | UINT16 | Number of vertices | | ||
Line 112: | Line 141: | ||
| VECTOR2 ARRAY | Texture coordinates | | | VECTOR2 ARRAY | Texture coordinates | | ||
| VERTEX_LIGHTING_GROUP ARRAY | VERTEX_LIGHTING_GROUP entries, see definition below | | | VERTEX_LIGHTING_GROUP ARRAY | VERTEX_LIGHTING_GROUP entries, see definition below | | ||
- | | UINT8 | Cull type (0 = no culling, 1 = backface | + | | UINT8 | Cull type (0 = no culling, |
| UINT16 | Always 0 | | | UINT16 | Always 0 | | ||
- | VERTEX_LIGHTING_GROUP | + | ==== Animation Channels ==== |
+ | The fourth section of an SOD contains the animation channels. An animation is basically the model altered in form and texture for each point in time, allowing for a series of meshes to be shown one after another, like in a movie, making up the animation/ | ||
+ | |||
+ | Animation channels are basically the animation of the mesh itself. If the textures on the faces are supposed to change as well, those would be the [[# | ||
+ | |||
+ | An animation channel consists of the following data: | ||
+ | |||
+ | ANIMATION_CHANNEL | ||
+ | ^ Data Type ^ Meaning | ||
+ | | IDENTIFIER | The node being referenced by the animation channel | | ||
+ | | UINT16 | Number of key frames used by the channel | | ||
+ | | FLOAT | Duration this channel lasts | | ||
+ | | UINT16 | Always zero (unused) | | ||
+ | | MATRIX34 ARRAY | Key frame data, the actual animation transformation, | ||
+ | |||
+ | The entirety of animations is stored like this: | ||
+ | ^ Data Type ^ Meaning | ||
+ | | UINT16 | Number of animation channels following | | ||
+ | | ANIMATION_CHANNEL ARRAY | The actual animation channel data of each element. | | ||
==== Animation References ==== | ==== Animation References ==== | ||
+ | The fifth and last section contains the animation references. In contrast to the [[# | ||
+ | |||
+ | The animation is made up as a list of animation references of this form: | ||
+ | |||
+ | ANIMATION_REFERENCE | ||
+ | ^ Data Type ^ Meaning | ||
+ | | UINT8 | Type of the reference, always 4 | | ||
+ | | IDENTIFIER | The node to which this animation belongs. | | ||
+ | | IDENTIFIER | Sprite animation used for this node. | | ||
+ | | FLOAT | Time offset (in seconds) used for this animation reference. | | ||
+ | |||
+ | The animation references are then stored as a list: | ||
+ | |||
+ | ^ Data Type ^ Meaning | ||
+ | | UINT16 | Number of animation references to follow | | ||
+ | | ANIMATION_REFERENCE ARRAY | The list of all animation references. | | ||
+ | |||
+ | ==== Texture Materials ==== | ||
+ | A texture material defines characteristics of a polygon rasterizer used to render the polygons of a given mesh. In case of //Star Trek: Armada//, there is a fixed set (hard coded) of allowed values: | ||
+ | ^ Material | ||
+ | | default | Standard material | | ||
+ | | additive | Utilize additive blending | | ||
+ | | translucent | Semi transparent | | ||
+ | | alphathreshold | Cut outs in objects can be realized with alpha channels. They have hard edges but are drawn faster. | | ||
+ | | alpha | Makes use of an alpha channel. In contrast to // | ||
+ | | wireframe | Uses only wireframe graphics | | ||
+ | |||
===== Web Links ===== | ===== Web Links ===== | ||
* [[http:// | * [[http:// | ||
* [[https:// | * [[https:// | ||
* [[https:// | * [[https:// | ||
+ | |||
+ | ===== See Also ===== | ||
+ | * [[en: | ||
{{page> | {{page> |
en/games/star_trek_armada_1/modding/sod_files.1742729295.txt.gz · Last modified: 2025-03-23-11-28 by 7saturn