Sins of a Solar Empire : Real-Time Strategy. Unrivalled Scale.
© 2003-2016 Ironclad Games Corporation Vancouver, BC. All rights reserved.
© 2006-2016 Stardock Entertainment

SOASE 3dsmax importer and exporter tool - Updated for Rebellion

We don't need no stinkin' subtitle

By on February 8, 2008 10:44:48 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Stannum

Join Date 02/2006
+2

New (beta) exporter!

-Support for Rebellion and maybe older expansions.

-Exports to the BIN format. Imports both BIN and TXT models.

-Much, much more improved mesh processing.

-'Tangent map problems' fix. This was an error with vertex normals that weren't being flipped when the model was.

TODO:

-Add model flipping on export so modeling in max is more natural.

-Import points too, so far its just importing the mesh.

-Stuff?


New version:
http://janvanderweg.com/SOASE/SOASE_Rebellion.zip

Installation:

Extract contents of the zip, except the example model, to: ../3dsmax/scripts/

Like with the old tool, run 'SinsOfASolarEmpire_Rebellion.ms' from the utilities tab and it should appear in the dropdown box.

Model setup:

Mesh as normal. Multi material works by applying max materials to the faces you want them on.
I haven't put in any y axis = up correction stuff so ships should be pointing upwards. (check the example file)
Instead of dummies for points you'll have to apply a skin modifier and use bones. See below for more info.

Material setup:

The new model format requires 5 textures per material:
    Diffuse map  
    Data (specular, self illumination) map
    Normal map
    Displacement map
    Teamcolor map

From what I've seen so far, the last two maps (displacement and teamcolor) aren't used so you can leave them blank. The tool uses the material map name, not the assigned bitmap for export. Here's a table to see which 3dsmax map is used for what:

        SOASE material map                                         3dsmax material map
        DiffuseTextureFileName                                    diffusemap
        SelfIlluminationTextureFileName                     specularmap
        NormalTextureFileName                                   bumpmap
        DisplacementTextureFileName                        displacementmap
        TeamColorTextureFileName                              filtermap

Point setup:

Instead of dummy objects the script now uses bones. Create the bones with the correct orientation and place them where you want. Name them as required by the game. Apply a skin modifier to the ship object and add all the bones to it.

A word on normal maps:

Since the gamemesh processor takes smoothing groups into account when generating vertex normals you can use smoothing groups. If you're using smoothing groups make sure the utility you're using to bake normals also supports them.

What is GameMesh?:

GameMesh is a max object preprocessor that calculates pretty much anything about models. It supports overly complex model setups, multiple materials, bone hierarchies for animated models, etc. It even takes smoothing groups into account!

 

 

 

 

 

 

OLD STUFF:

 

Not sure if many of you use 3dsmax but I started writing a maxscript tool that will export/import BIN/TXT soase .mesh files

Should work with most max versions since this is a maxscript tool, not a compiled one.

Current version: 2.0a

Download link:
http://janvanderweg.com/SOASE/SOASE_Maxtoolv2.0a.zip

WHATS NEW:

Lots!....
I rewrote the mesh splitting algorithm into a semi-modular meshsplitting maxscript file, splitmesh.ms
It should be a lot faster now and it supports more features such as:
-Smoothing group support
-Multitexturing support
-Much faster (I think)

Readme:
http://janvanderweg.com/SOASE/index.html

OLD INFO, still might be usefull:

Obligatory pic:
http://janvanderweg.com/SOASE/soase_pic.jpg

Installation:
Unzip the contents of the zip into your 3dsmax\scripts\ directory.

To run the script:
-Goto the utilities tab (hammer icon on the right)
-In the utilities rollout click on MAXscript
-Click on run script
-Find the SINS_Tool.mzp file and run it
-In the utility dropdown box select SOASE Maxtool
-Click on import/export

Note:
Soase uses an Y-up system. This means:
Max y = above -y = down
Max z = forward -z = back
Max x = left -x = right

Adding points:
-Use dummy objects for points, rotate them so they face in the direction you want.
-Link them to the main object. If you don't link them they will not be exported.

Materials:
-Diffuse texture uses the diffuse slot (really)
-Data texture uses the specularlevel slot
-Normal texture uses the bump slot
-Set the glossiness with the glossiness controller in the specular highlights area

Add a bitmap to each slot but don't point to an image file. Instead change the slot name to the filename:



Your final texture should look like this:

Locked Post 202 Replies
Search this post
Subscription Options


Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 10:59:28 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Sweet!
Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 12:08:39 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
What version of max does this support? I have tried it on Max 5 and Max 7 and I get the same thing... a Runtime Error. --Runtime error: fileIn: can't open file - "help.ms"
Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 12:26:44 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums


Forgot to add a generic helper script file into the mzp. Redownload the file, should work now.
Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 12:47:52 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
works now, you rock
Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 1:35:09 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Sweet, I will have to give this a try.
Reason for Karma (Optional)
Successfully updated karma reason!
February 8, 2008 5:10:28 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
This is excellent because 3dsmax is my weapon of choice for modeling (many others too).

I use 3dsmax version 6. Ill give this script a try later. However you should specify which version/s this script is intended for.

Good luck with the tool, and good job for getting this far with it

Guys you still may need Softimage to set the tangents in the models correctly. If anyone figures out a work around in Max or Lightwave it would be greatly appreciated. The "Tangents" seem to be a proprietary softimage thing that tells the models how to use its shaders correctly in game. I hope i am wrong.
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 10:16:13 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
I don't have 3ds max and I'm no 3d-modeller, but there's nothing "proprietary" about tangents. I won't try to explain it because it still kinda confuses me myself. In the end the tangents and the normal define an orthonormal basis, which corresponds to texture coordinates. This allows us to store normalmaps in "tangent-space" and reuse those normalmaps on different objects (or a different part of the same object), so the (main) point behind all this tangent stuff is saving texture memory.
And adding tangents to the model when exporting from max shouldn't be hard

*edit* @Stannum: Your nick looks familiar. Are you also contributing to "Infinity" ?
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 1:06:08 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

This is excellent because 3dsmax is my weapon of choice for modeling (many others too).

I use 3dsmax version 6. Ill give this script a try later. However you should specify which version/s this script is intended for.

Good luck with the tool, and good job for getting this far with it

Guys you still may need Softimage to set the tangents in the models correctly. If anyone figures out a work around in Max or Lightwave it would be greatly appreciated. The "Tangents" seem to be a proprietary softimage thing that tells the models how to use its shaders correctly in game. I hope i am wrong.


It should work with 3dsmax r6. As far as I know I'm not using any max 7/8/9/2008 specific functions. If you do run into anything please post it and I'll try to find a work around.

As FleischWesen said, tangents aren't something specific to xsi. A tangent is part of the vertex normal (normal, tangent, binormal/bitangent) basically it's just a bunch of orientation vectors (x,y,z) for the vertex so that you can use tangent space normal maps. If you know the vertex normals for a triangle you can calculate the normals for a specific point on that triangle (per-pixel shader stuff) Together with the vertex normals and the normalmap normals you get a new vector for the fancy lighting.

It isn't hard to calculate all the vertex normals, it's just a bunch of vector calculus.

FleischWesen: Yes, I'm the same Stannum as on the infinity boards.

Just a small update: Already have a large portion of the exporter written. Hopefully I'll have a working beta sunday-ish
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 2:17:17 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
This is excellent because 3dsmax is my weapon of choice for modeling (many others too).

I use 3dsmax version 6. Ill give this script a try later. However you should specify which version/s this script is intended for.


It works with My version of Max 5 so it should work with 6, especially being that its a script and not an importer. you did great work, and cant wait to try your export feature out.

EO
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 2:32:04 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
It works! the ability points seem messed up (all above the mesh), but the model itself imported nicely. I learned that Sins doesnt use any separate LOD (level of detail) meshes.

Can the dev's clue us in if meshes auto lod, or not?

Anyways NICELY done! We will be keeping an eye on this one.

Edit: It seems the UVs dont import right as well. Texture comes out all messed up on model. Just an fyi if you didnt already know This is still a good tool because i learned some valuable info needed for my mod.
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 3:59:28 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
talking to Tristan he said no lods are used. Now I've picked up the XSI mod tool to get familiar with it, the important point to make here is that the xsi mod tool is free, you don't have the have other apps to use it. It is a learning curve even if you've used other packages, but I applaud star docks decision to allow a fully featured modeler (most of the other stuff is disabled in xsi) as their default pipeline because this makes it a lot easier for people to get their content in the game.

That being said there may be interesting things we can do with a .mesh exporter from max that exploit functionality that may not be in the forge xsi tools . I also have most of my content in max and I am most familiar with its tools so I would like to export directly without conversion.
Reason for Karma (Optional)
Successfully updated karma reason!
February 9, 2008 5:33:33 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
It will certainly be nice to have a 3ds max exporter. Im more comfortable with max than XSI.

I agree that it is great Ironclad/Stardock chose to use the free version of XSI. More companies who want to promote modding need to use free programs like these. That in the end makes the game last longer modding wise because the programs are free and easy to get.
Reason for Karma (Optional)
Successfully updated karma reason!
February 10, 2008 10:21:40 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

It works! the ability points seem messed up (all above the mesh), but the model itself imported nicely. I learned that Sins doesnt use any separate LOD (level of detail) meshes.

...

Edit: It seems the UVs dont import right as well. Texture comes out all messed up on model. Just an fyi if you didnt already know This is still a good tool because i learned some valuable info needed for my mod.


I know about the ability points not importing correctly. It isn't that important for importing.

Which model are you getting wrong UV's with? So far I haven't had any problems with incorrect UV's. Could you check if the UV's aren't just flipped in the v axis?
Reason for Karma (Optional)
Successfully updated karma reason!
February 10, 2008 4:23:05 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
It was the Kol battleship. Ill retry an import. What i did was export it from max to .3ds to view it in deep exploration. I probably should have reassigned the material 1st. Its not that important to me, because i just wanted to see how the sins meshes were built, and view poly counts.
Reason for Karma (Optional)
Successfully updated karma reason!
February 10, 2008 4:32:26 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

It was the Kol battleship. Ill retry an import. What i did was export it from max to .3ds to view it in deep exploration. I probably should have reassigned the material 1st. Its not that important to me, because i just wanted to see how the sins meshes were built, and view poly counts.


I checked out the TEC ships polycounts; http://forums.sinsofasolarempire.com/?forumid=443&aid=175327


Polycounts;
(approx; TEC seems to have largest polycounts by a big margin)
Fighter/Bomber/Gunship= 550-1300

Frigate
Arcova scout = 1486
Cobalt light = 1539
Javelis LRM = 1837
Garda Flak = 1480
Krosov seige = 1494
Protev colony = 1459
(rough range of 1000-2000 methinks)

Constructor = 1988

Tradeship = 2700-3200

Cruiser
Perchirien Light Carrier = 1484
Hoshiko Robotics Cruiser = 2119
Cielo Command Cruiser = 1699
Kodiak Heavy Cruiser = ?
(range is about 1500-2500 I think)

(NB: there are a couple of 'frigate_turret' models, I'm not sure what they are; 1 is ~2100 and the other ~900. I've not seen enough of the game to determine, but I'm guessing maybe fixed guns?)

(NB2: pirate ships seem to have generally higher polycounts by 500-1000 than the main race equivalents)

Capship
Marza dreadnaught = 3104
Kol Battleship = 4021
Sova carrier = 3689
Akan battlecruiser = 4355
Dunov battlecruiser = 3847
(randomly selected a few other species, range appears about 2900-4500 polys?)

Planet modules have varying polycounts; the highest I've seen so far is over 7000 for the frigate yard. Installations seem to be about 3000-5000.

(intersecting faces are allowed, handily, which should make things a lot more sensible)

I think each model (ship) has an associated shield mesh object as well. Orientation - from the importer - is to have the front of the ship facing up in 3ds max.



HTH

Reason for Karma (Optional)
Successfully updated karma reason!
February 10, 2008 8:14:04 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

It was the Kol battleship. Ill retry an import. What i did was export it from max to .3ds to view it in deep exploration. I probably should have reassigned the material 1st. Its not that important to me, because i just wanted to see how the sins meshes were built, and view poly counts.


I checked the model in max, no errors with the uv. My guess is that the uv data is lost when you export to 3ds from max.

Reason for Karma (Optional)
Successfully updated karma reason!
February 10, 2008 9:39:06 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Yea it was. Sorry 'bout that. Now i know better than to export before i assign material.

So basically cap ships shouldn't go above 5000 polys. 7000 is the highest poly model in the game? I would say you can make a few 10k models, but you dont want too many high poly meshes on the map at one time.
Reason for Karma (Optional)
Successfully updated karma reason!
February 11, 2008 3:56:16 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums

Yea it was. Sorry 'bout that. Now i know better than to export before i assign material.

So basically cap ships shouldn't go above 5000 polys. 7000 is the highest poly model in the game? I would say you can make a few 10k models, but you dont want too many high poly meshes on the map at one time.


I didn't check all of them (I think planets may be higher, being spheres et al), but the highest I saw was slightly over 7000. I think with bumpmaps, and considering the relative scale of what you see on screen 99% of the time, 5000 is a good max for the big ships. It seems that frigates and cruisers have similar limits, though; I guess they must be expected to be seen in roughly equal numbers.
Reason for Karma (Optional)
Successfully updated karma reason!
February 11, 2008 2:05:39 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Small update:

I've completed pretty much everything but the NumCachedVertexIndicesInDirection:* part.

Have to figure out how to find out which direction a vector is pointing to (up/down etc) and then sort them.
Reason for Karma (Optional)
Successfully updated karma reason!
February 12, 2008 5:19:23 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
New version up.

-- Fixed the importer not importing points correctly
-- Now exports models

http://janvanderweg.com/SOASE/SOASE_Maxtoolv1.0.zip

Check OP for more info.
Reason for Karma (Optional)
Successfully updated karma reason!
February 12, 2008 6:07:36 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Sweet, I will have to give this a try when I have some models to export.

Keep up the great work.
Reason for Karma (Optional)
Successfully updated karma reason!
February 12, 2008 7:17:52 PM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
will try this tonight and let you know the results.
Reason for Karma (Optional)
Successfully updated karma reason!
February 13, 2008 1:18:32 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
can we have an export to TXT for debugging?
Reason for Karma (Optional)
Successfully updated karma reason!
February 13, 2008 2:12:00 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
I dont know if anyone else has played with this yet, but anytime I try to run the script it ends up with an error. here it is:


--Syntax error: at ),, expected ]
-- In line: texture.v_diffuse=[1.0,1.0,1.0,1.0]
-- In file: mzp.run in patckage C:\3dsmax\scrips\SINS_Tool.mzp
Reason for Karma (Optional)
Successfully updated karma reason!
February 13, 2008 2:24:12 AM from Sins of a Solar Empire Forums Sins of a Solar Empire Forums
Looks like its something to do with the textures. Are you sure you followed the texture directions in the original post? There might be an error there like a wrong texture name or something.
Reason for Karma (Optional)
Successfully updated karma reason!
Stardock Forums v1.0.0.0    #101114  walnut1   Server Load Time: 00:00:00.0000094   Page Render Time: