• Hello and welcome to MSFC. We are a small and close knitted community who specialises in modding the game Star Trek Armada 2 and the Fleet Operations modification, however we have an open field for discussing a number of topics including movies, real life events and everything in-between.

    Being such a close community, we do have some restrictions, including all users required to be registered before being able to post as well as all members requiring to have participated in the community for sometime before being able to download our modding files to name the main ones. This is done for both the protection of our members and to encourage new members to get involved with the community. We also require all new registrations to first be authorised by an Administrator and to also have an active and confirmed email account.

    We have a policy of fairness and a non harassment environment, with the staff quick to act on the rare occasion of when this policy is breached. Feel free to register and join our community.

New SOD Exporter for 3DS Max =ALL VERSIONS=

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
Hi everyone

I have some good news :)

After putting this off many times, I decided to sit down and write a new SOD exporter for 3ds max. The good news is that the exporter works, with only a few more details left for me to iron out.

Now, before I release the exporter, I need a little input from anyone that will find this exporter useful.

First:
I have little experience with Armada II models, so I'm not sure what the differences are between the A1 and A2 sod formats. Is it just the hierarchy? Are there additional texture material properties? (ie, bump maps, borg textures, lightmaps.. etc).

Second:
Does anyone actually use team colours, and if so, how is this done at present. I have never tried, and the info on this appears to be scarce.

Third:
I will need to test the script in various versions of 3ds max. Anyone interested, please tell me which version of 3ds max you use, and I will email you back with details and a copy of the exporter. I might just set up a beta version for everyone in a few days, but I'm still ironing out a few details.

At present, I only have 3ds max 5, so testing for me is not exactly ideal as the current exporter works there too. However, the exporter is written in MaxScript, rather than as a pluggin. This should hopefully imply that it'll work in all future versions of 3ds max.

Ok, you can cheer now :p

Mr. V
 

Dominus_Noctis

Lasciate ogni speranza...
Joined
18 Aug 2010
Messages
409
Nice work :thumbsup:

I believe that team colors is done via the team_ materials settings (The process of assigning the materials to an object). Other than that though, I'm useless on this front :)
 

Adm_Z

Gettin' down and GUI!
Joined
23 Nov 2009
Messages
2,745
Hi everyone

I have some good news :)

After putting this off many times, I decided to sit down and write a new SOD exporter for 3ds max. The good news is that the exporter works, with only a few more details left for me to iron out.

Now, before I release the exporter, I need a little input from anyone that will find this exporter useful.

First:
I have little experience with Armada II models, so I'm not sure what the differences are between the A1 and A2 sod formats. Is it just the hierarchy? Are there additional texture material properties? (ie, bump maps, borg textures, lightmaps.. etc).

Second:
Does anyone actually use team colours, and if so, how is this done at present. I have never tried, and the info on this appears to be scarce.

Third:
I will need to test the script in various versions of 3ds max. Anyone interested, please tell me which version of 3ds max you use, and I will email you back with details and a copy of the exporter. I might just set up a beta version for everyone in a few days, but I'm still ironing out a few details.

At present, I only have 3ds max 5, so testing for me is not exactly ideal as the current exporter works there too. However, the exporter is written in MaxScript, rather than as a pluggin. This should hopefully imply that it'll work in all future versions of 3ds max.

Ok, you can cheer now :p

Mr. V


team colors are not possible in the current export/importers I believe. Few people know how they work and I don't know if anyone can recreate them. That could all change however, if you can make them work:excited:

As for the differences between a1 and a2 models, all I know is that the material settings are changed, but I don't know much about it.

also, will your exporter handle animations?
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,348
Age
39
First:I have little experience with Armada II models, so I'm not sure what the differences are between the A1 and A2 sod formats. Is it just the hierarchy? Are there additional texture material properties? (ie, bump maps, borg textures, lightmaps.. etc).

A1 models don't support lightmaps, bump-maps and have to have 8 characters if I recall no more.

Second:
Does anyone actually use team colours, and if so, how is this done at present. I have never tried, and the info on this appears to be scarce.

I like to use them but like many do not know how. I do know that it's actually parts of the mesh and not textures but I don't know the exact details. FOr this information I would contact DocaCola from the FO Site as his team have done team colours in their earlier models.

Third:
I will need to test the script in various versions of 3ds max. Anyone interested, please tell me which version of 3ds max you use, and I will email you back with details and a copy of the exporter. I might just set up a beta version for everyone in a few days, but I'm still ironing out a few details.

I am interested while I run v5 only for the exporter I also have Max Design 2010.
 

Starfox1701

Master of the Arwing
Warrant Officer
Joined
29 Jan 2008
Messages
2,560
Age
48
SOD INFO

Storm3D Object Definition (SOD) File Format
===========================================
Author: Steve Williams
Storm3D Graphics Engine Lead.
Copyright (c) Activision 2000.

Modifications: Fixed node specification error.

Audience
========
This document is intended for use by experienced 3D tools programmers for the purposes of writing exporters, importers and conversion tools to/from the .SOD format. A good understanding of real time 3D graphics principles is assumed. The reader is expected to be familiar with real time 3D geometry concepts such as lighting, animation & scene graph hierarchies.


Introduction
============
The SOD file format is a binary file format describing the 3D directed scene graph hierarchies used by the Storm3D rendering engine. Each .SOD file describes one such hierarchy.

The SOD file format has evolved through several versions. This document describes the latest format, 1.8. Documentation of previous formats is not available at this time.


Datatypes used in this document
===============================
UINT8 unsigned 8 bit integer
UINT16 unsigned 16 bit integer
UINT32 unsigned 32 bit integer
FLOAT floating point (4 byte) value
VECTOR2 {FLOAT u, FLOAT v}
VECTOR3 {FLOAT x, FLOAT y, FLOAT z}
MATRIX34 { VECTOR3 RIGHT, UP, FRONT, POSITION } MATRICES MUST BE ORTHOGONAL.
COLOUR { FLOAT red, FLOAT green, FLOAT blue } Component range 0.0 - 1.0

Other local datatypes are defined where appropriate.

Additional Syntax
=================
TYPE ARRAY(nentries) - A contiguous array of nentries of type TYPE

Identifiers
===========

IDENTIFIER
{
UINT16 strlen(string), string (8 bit ascii values) including terminating '0'
OR
UINT16 0 - Indicates null string.
}

File Structure
==============

Section 1 : File Header
Section 2 : Lighting Materials
Section 3 : Nodes - Written recursively from the root.
Section 4 : Animation Channels
Section 5 : Animation References

Section Description
===================


Section 1 : File Header
=======================

HEADER Storm3D_SW File identification header (8 bit ascii values) - no strlen or terminating '0'.
FLOAT version Current version is 1.8, older formats are not described at this time.


Section 2 : Lighting Materials
==============================
Defines the characteristics of the vertex lighting materials defined in this .SOD file.

UINT16 count - The number of lighting materials defined in this file.

LIGHTING_MATERIAL ARRAY(count) Array of lighting materials.

LIGHTING_MATERIAL
{
IDENTIFIER identifier Name of the lighting material.
COLOUR ambient Real time lighting ambient component
COLOUR diffuse Real time lighting diffue component
COLOUR specular Real time lighting specular component (only used by the phong illumination model)
FLOAT specular power Specular exponent, used to determine the 'shininess' of material using the phong illumination model.
UINT8 lighting model (constant=0, lambert=1, phong=2)
}


Section 3 : Nodes
=================

The nodes consist of 5 types NULL, LOD_CONTROL, SPRITE, MESH and EMITTER which together form
a scene graph which describes the object's hierarchy.

UINT16 count - The number of nodes in the hierarchy.

<Update: Note node_type & identifier order has been switched to correct error in initial specification.>

NODE
{
UINT16 node_type (0 - null, 1- mesh, 3 - sprite, 11 - LOD control node, 12 - emitter) DO NOT USE OTHER VALUES.
IDENTIFIER identifier
IDENTIFIER parent (which will be null for root node)
MATRIX34 local transform
TYPE_SPECIFIC_DATA<node_type> Type specific data field as defined below.
}


Null Nodes
==========

TYPE_SPECIFIC_DATA<NULL>
{
No addtional data required.
}

Null nodes are used for two purposes :
1. As &apos;glue&apos; to stick the rest of the hierarchy together
2. To mark specific locations in the hierachy, for example, hardpoints.


LOD Control Nodes
=================

TYPE_SPECIFIC_DATA<LOD_CONTROL>
{
No addtional data required.
}

Storm3D uses discrete (rather than dynamic) LODs for level of detail control. Each
child of an LOD control node indicates a discrete LOD that the graphics engine may
use when rendering this object. LOD selection is based on visible on-screen area.


Sprite Nodes
============

TYPE_SPECIFIC_DATA<SPRITE_NODE>
{
None: The appropriate sprite node definition to use is determined from the
identifier. The sprite node definition is defined in the .spr files.
}

Examples of sprite node usage include running lights in ST:Armada.

TYPE_SPECIFIC_DATA<PARTICLE_EMITTER>
{
IDENTIFIER Emitter used by this node as defined by an @emitter description in the .spr files.
}

Polygon Mesh Nodes
==================

TYPE_SPECIFIC_DATA<MESH>
{
IDENTIFIER texture material (0 for default) - Defines the TEXTURE_MATERIAL to be used by this mesh.
IDENTIFIER texture (0 if untextured)
UINT16 nvertices : Number of vertices
UINT16 number of texture coordinates (ntexcoords)
UINT16 number of vertex lighting groups (ngroups)

VECTOR3 ARRAY vertex positions (nvertices entries)
VECTOR2 ARRAY texture coordinates (ntexcoords entries)

VERTEX_LIGHTING_GROUP ARRAY (ngroups entries)

UINT8 cull type (0 - no cull, 1- (backface cull)

UINT16 0 - unused must be 0.
}

VERTEX_LIGHTING_GROUP
{
UINT16 num_faces (all faces are triangles)
IDENTIFIER lighting_material (0=default)
FACE ARRAY (num_faces entries)
}

FACE_VERTEX
{
UINT16 index into mesh vertex positions array
UINT16 index into mesh texture coordinate array
}

FACE
{
FACE_VERTEX ARRAY(3) 3 entries describing a triangular face.
}

Section 4 : Animation Channels (Defines transform animation)
============================================================

UINT16 count // Number of animation channels

ANIMATION_CHANNEL ARRAY(count) Array of animation channels.

ANIMATION_CHANNEL
{
IDENTIFIER node : The node to which this animation channel refers.
UINT16 nkeyframes : The number of keyframes used by this channel.
FLOAT channel_period : The length of time one loop of this channel lasts.
UINT16 0 : Not currently used. Must be 0.
MATRIX34 ARRAY(nkeyframes) keyframe_data : The actual animation transforms, evenly spaced over time &apos;channel_period&apos;.
}

Section 5 : Animation References (Defines texture animation)
============================================================

Animation references are a way of linking texture (flipbook) animations defined in the
.spr files to the geometry of a .SOD mesh node. An example of their usage is the
flipbook animation applied to the geometry for the various shield effects in Armada.


UINT16 num_animation_references

ANIMATION_REFERENCE ARRAY(num_animation_references)


ANIMATION_REFERENCE
{
UINT8 type : Must be 4
IDENTIFIER node : The node to which this animation applies.
IDENTIFIER anim : The animation (as defined in .spr files) that is to be applied to this node.
FLOAT playback_offset : Time offset in seconds to be applied to this animation reference.
}

Additional Information
======================

Vertex Lighting Material Sharing
================================

Vertex lighting materials are shared between objects, when parsing a .SOD file,
Storm3D searches for a match in all previously loaded files. If a match is found, that
material is used. This prevents artists from having to ensure the material characteristics
of commonly used materials are correct in each file, and also saves memory.

A &apos;palette&apos; of commonly used materials can be found in materials.sod
In Armada, this file is loaded prior to most other SOD files & so defines the
characteristics of many common materials.


Hierarchy Structure (Armada Specific)
=====================================
Armada uses various nodes in a Storm3D hierarchy for special purposes.
These include hardpoints, damage nodes, running lights, borgification.
When generating new artwork, the artist must pay careful attention to the
structure of the hierarchy for the new object to function correctly in Armada.
A definition of the hierarchy structure required by Armada is beyond the scope
of this document. For the time being, existing artwork can be used as a reference.


TEXTURE_MATERIAL Definition
===========================
A texture material defines the characteristics of the polygon rasterizer used to
render the polygons in a given mesh. The texture materials are currently fixed
and defined within the executable.

Useful values are :

default - Standard material
additive - Use additive blending
translucent - Semi transparent
alphathreshold - Use for objects using alpha channel &apos;cut outs&apos; - alpha
channels will have hard edged &apos;threshold&apos; but objects will be
drawn quickly.
alpha - Uses entire alpha channel. Object will require sorting, so
will have performance implications.
wireframe - Use wireframe graphics.

PDF included
 

Attachments

  • storm3d_object_definition.pdf
    169.7 KB · Views: 1

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
Right now I'm trying to extend the exporter to produce A2 SODs, but work is a little slower than expected. No worries, making progress. Once this part is done, I will provide a beta.

Nice work :thumbsup:

I believe that team colors is done via the team_ materials settings (The process of assigning the materials to an object).

I have heard of this, but wasn't able to reproduce the result in my tests. I shall give it another try :)
I suspect that I can get something by dissecting the stock models.

Adm_Z said:
also, will your exporter handle animations?

It will handle animations at least as well as the current exporter. I may be able to add a few extra features to the animations :D

Majestic said:
A1 models don't support lightmaps, bump-maps and have to have 8 characters if I recall no more.

My understanding is that the lightmap is just the alpha channel (transparency) of the original image. This should not require any additional info in the actual SOD (will verify).
However, I don't know anything about how bump maps work. Do you specify this in the materials editor? If someone can direct me to some literature on this, I would appreciate the help in avoiding the hassle of having to look for the info :p

EDIT:
Starfox, thanks for the file. This is the A1 sod description which I was using to write the exporter (Sod version 1.8). A2 uses Sod version 1.93, which is slightly different. Thanks though :)
 

K_merse

Star Trek: Evolution
Joined
22 Feb 2008
Messages
438
Team colors work like the damage textures and the Borg nodes, but instead of having a texture, they are colored to the color of the player.
 

Dominus_Noctis

Lasciate ogni speranza...
Joined
18 Aug 2010
Messages
409
If you have a detailed list of questions I would also propose sending it off to Optec, or you can post it here and I can send it to him, as he knows the ins and outs of A1 and A2 modeling and has made exporters in the past if I recall correctly :).
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
Just a quick update on the progress:

- Team colours are supported by adding "team_" in front of the material name.
- Multiple lighting materials are supported on a single mesh. Ie, a single mesh can have parts that are glowing, parts that have specular reflections, or parts that have team colour applied.
- Rotation and position of all hardpoints is properly recorded. You do not have to specify "hp##" for the hardpoint to work properly. Since any alphanumeric name will work, you can now have "dock" and "repair" hardpoints.

Also made progress with extracting the animation channels in 3ds max. Now it is just a matter of writing the animations to the SOD file.

Lastly, I dissected the A2 SODs and discovered that the format is very similar to A1 at the SOD coding level. Extending the exporter to A2 format will be piece of cake. I also obtained a copy of A2, so I can test the exporter there as well.
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
A bit of an update on the progress...

All SOD features are now in place. Key highlights from the day:

- Animations are working.. for the most part. There is one minor problem with rotations right now that's making things rotate around the wrong axes sometimes. I have to go over the math to fix this.

- You can animate any node/joint in the hierarchy. Attach any number of nodes and meshes to that node and they will move along with the animated node (as is expected). This is optimized to substantially reduce file size compared to the current SODs.

- Specify animation length. Animation length can be different for every animated node/joint. For example, node_1 can have animation length of 5 seconds, while node_2 can have animation length of 50 seconds. You do not have to add key frames for node_1 to fill the entire 50 seconds of the animations track.

- You can turn off back face culling so that the "back" side of a face remains visible. For example, if you have some kind of plane, empty box or hollowed out shape, you do not have to model both sides of the surfaces. Instead, just turn off the back face cull. You can see this in action when you look at the wormhole; you can see the clouds going around the back of the wormhole. Minor point, but someone might need to use this. I know I do

-Hardpoints should not be animated. Hardpoints can be animated on the SOD, but will not be animated in game. This is due to a limitation of the game engine rather than the SOD format. My guess is that the game doesn't sync SOD animations in multiplayer games. A simple fix was to prevent hardpoints from animating altogether. I decided to allow hardpoint animations in the SOD, but users should be aware of the limitations in Armada.

- Many many bug fixes.

Mr. V
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,348
Age
39
Outstanding work, this sounds to be shaping up quite nicely. This will hopefully see an increase in animated models since not many people have 3DS Max v5 anymore.
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
I decided to release as an open beta since only a few people have shown interest. It really wouldn't make sense to have a closed beta.

Progress was a bit slow lately as I was dealing with the flu, but now the exporter is almost ready.

- Animations are fully working with no problems.
- A1 and A2 formats are supported

The SOD format does not appear to support smoothing groups properly. There is a workaround, and I am working on that at the moment. :)
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,348
Age
39
Indeed excellent news, that fact that this will work on later versions is awesome and really helpful. :thumbsup:
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,348
Age
39
I'll be sure to check this out when I get to hardpointing as I really want to learn to hardpoint correctly and become efficient at it in 3DS Max. I have Max Design 2010 and so this exporter will really come in handy I think. Thanks for taking the time in producing it.
 

Blade

Cadet Junior
Joined
22 Jan 2012
Messages
59
Age
37
good news is just tried it on 3d max 2012 and works great (slightly different to the old version but still nice) saves me having to keep a xp vm
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
I have updated the exporter with a few things. Please download the new version for testing attached with this post.

View attachment SOD_Exporter_V1.1.zip

Also, I would appreciate immensely if someone could test the bump maps and lightmaps. They appear to work on my end, but I my experience with A2 models is nearly nill. If you have a ready model with bump maps and lightmaps, please try exporting it as is with the new script and let me know if all goes as expected.

Changes:

Armada 2 model hierarchy no longer requires a “root†or “scene_root†node at the top of the hierarchy. This should improve compatibility with existing artwork.

The default save path name was changed to reflect the 3dsMax installation directory. The save path is now “*\3dsMaxRoot\meshesâ€

Texture coordinate vertices are welded upon export. This does not affect the mesh quality, but can reduce the file size considerably. The 3dsMax5 plugin exporter contained this feature.
 

Blade

Cadet Junior
Joined
22 Jan 2012
Messages
59
Age
37
dont know if its to do with the sod format or armada2 coding but would it be possible for the nodes to be animated when exported?
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
Nodes can be animated just fine. You can animate objects (mesh and point helper) by setting key frames in 3dsMax. You can animate the position, rotation and scale in A2

Hardpoints can not be animated due to limitations in A2 engine.

Have you tried exporting a model with animation and the animation didn't work? If so, you may have found a bug in the script...
 

Blade

Cadet Junior
Joined
22 Jan 2012
Messages
59
Age
37
well was meaning for strobes and emitters (and hps) as it can be bit annoying that some animations can not be dne due to the parts having to be static but looks like must be an a2 issue
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
I have tested animations extensively in A1, and could certainly animate strobes (sprites) and emitters. Mesh animation worked just fine in A2, but I haven't tested sprites and emitters. I might be able to test this in A2 tonight. Hoping that there isn't a limitation in A2 on node animation.. that would be unfortunate.
 

MrVulcan

Crewman 2nd Class
Joined
17 Aug 2011
Messages
142
I was testing this just as you posted :p

Good news on the strobes being animated; you can have animated strobes and emitters.

However, you did inadvertently point out a small bug in the code. Right now you can not apply animation directly to the sprites/emitters. You have to attach the sprite/emitter to a point helper, and animate the point helper. Normally, I have anywhere between 10-20 strobes and a few emitters that need to be animated together. So I would just attach the whole set to a single point helper, and animate it instead. Saves having to animate the 20 sprites individually.

Still, I'll have a fix for this issue soon.
 

Blade

Cadet Junior
Joined
22 Jan 2012
Messages
59
Age
37
thats good news so that means strobes and emitters will move along with the mesh parts
 

Majestic

Administrator
Staff member
Administrator
Seraphim Build Team
Joined
17 Apr 2006
Messages
18,348
Age
39
That's good news, you're doing an amazing job getting this to work and now fine tuning it. :thumbsup:
 

Blade

Cadet Junior
Joined
22 Jan 2012
Messages
59
Age
37
errrr just tried doing an animated strobe (made the light move up and down) but it ctd fo
 
Top