New SOD Exporter for 3DS Max =ALL VERSIONS= -1 reply

  • 1
  • 2

Please wait...

Guest

I didn't make it!

0 XP

 
#1 6 years ago

Hi everyone

Some of you might know me from other Armada forums, but even if you don't, I have some good news for ya :P

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.

Originally, I posted this on AFC and MSFC forums. Thought that I should post here as well to get wider audience.

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.

Why exactly am I writing the exporter? - Bugs in the current exporter driving me nuts sometimes - 3ds max 5 only runs on XP

For the most part I'm writing the exporter because my XP machine is about to run out of steam and I will be moving on to Win7. I thought it would be easier to write a new exporter for SOD rather than trying to get 3ds max 5 to run on Win7. lol. Up to now, that really was the only reason I still have XP on my machine.

I will provide a detailed list of features and improvements with the release. However, one should be able to export their current models without any changes.

Ok, you can cheer now :p

Update:

- Team colors are supported by adding "team_" in front of the material name. (Current exporter does this too) - 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 color 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.

Mr. V




Freyr VIP Member

A2Files Staff

46,875 XP

6th February 2005

11 Uploads

4,275 Posts

0 Threads

#2 6 years ago

Interesting, good job.

Spoiler: Show

If your working on a converter, I suspect you will have already seen this. However, there is some chance that nobody else has pointed it out to you, so just in case:-

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. color { 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. color ambient Real time lighting ambient component color diffuse Real time lighting diffue component color 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.

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 Type specific data field as defined below. }

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

TYPE_SPECIFIC_DATA { No addtional data required. }

Null nodes are used for two purposes : 1. As 'glue' 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 { 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 { 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 { IDENTIFIER Emitter used by this node as defined by an @emitter description in the .spr files. }

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

TYPE_SPECIFIC_DATA { 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 'channel_period'. }

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 'palette' 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 'cut outs' - alpha channels will have hard edged 'threshold' but objects will be drawn quickly. alpha - Uses entire alpha channel. Object will require sorting, so will have performance implications. wireframe - Use wireframe graphics.




Guest

I didn't make it!

0 XP

 
#3 6 years ago

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




Fireball_VI

I follow teh Moo!

50 XP

6th June 2008

0 Uploads

626 Posts

0 Threads

#4 6 years ago

This is awesome news. If I don't have to use virtual xp (which is giving me trouble on the new pc) it would be awesome!

I have max 2010 and mod Armada II

pm to follow




Guest

I didn't make it!

0 XP

 
#5 6 years ago

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




Fireball_VI

I follow teh Moo!

50 XP

6th June 2008

0 Uploads

626 Posts

0 Threads

#6 6 years ago

Sounds great.

I'll give feedback once I give her a go!




Guest

I didn't make it!

0 XP

 
#7 6 years ago

Hi Everyone,

SOD Exporter is ready. I would attach it here for people to start testing, but the forums are not letting me upload the file. Probably thinks its a malicious script. If anyone wants to test the exporter, send me an email at tpankov (at yahoo dot ca) and I will get back to you.

Thanks for your interest :)

Mr. V




Messaline

Slightly cooler than a n00b

50 XP

5th September 2002

0 Uploads

411 Posts

0 Threads

#8 6 years ago

Fantastic News! Count me in . and the other SOD exporter that people could use would be a Maya plugin exporter, if you'd ever give that a shot. I don't think a Maya to SOD has ever been done. I'm going to email you for the 3DSM exporter. thanks again !




Guest

I didn't make it!

0 XP

 
#9 6 years ago

Hi :)

Thanks for your interest. I replied to your email with the download link.

Both Maya and 3dsMax are currently being developed by the same company. I would be really surprised to know that there isn't an exporter between the two formats (or a common format that both support). Might be wrong as I never really looked into it.

The maya script should be not too different from maxscript, so I might just write the exporter for Maya at some point :)

Anyone know whether posting external download links is permissible on these forums? I will be submitting the exporter to A2files at some point, but I still want to improve the way I'm handling texture vertices. The script works just fine right now, but there's room for improvement in optimization of the resulting SODs so that they're actually more compact than the SODs made by the current exporter. So, I'm holding off submitting the exporter to A2files for now.




StarBlade

www.starbase34.net

50 XP

7th January 2006

0 Uploads

1,705 Posts

0 Threads

#10 6 years ago

You could always submit it as is, then submit an improvement later as a 1.1 or 2.0 version. That's happened lots of times and I think there's more than enough interest to warrant getting this into peoples' hands through the main site, where more people will see it, rather than a forum link that might be viewed by far fewer.




  • 1
  • 2