A guide for getting working static props to NS2

WhiteDevilWhiteDevil Join Date: 2012-09-16 Member: 159559Members, Reinforced - Shadow
edited October 2013 in Mapping
So I've been trying to get some of my own models into the game and I'd like to share my methods since these are one of the less documented things. I'm not going to show any basics how to make a model or texturing, I'm just going over the things how to get a static prop model working correctly in NS2.
For animated props watch Brian's video: youtu.be/rdIM_YoxZFQ

I must warn you though, you will need to use 3dsmax09 since that is the only program which can use the Collada plugin UWE had shared that can export all the information a fully working model needs. At least that's what I've noticed so far. OPENCOLLADA does get the work done, but it won't work for getting a correct collision model or other advanced things, such as animations.

For this guide to be useful I expect you to have a mod setup for your map, know how make textures for NS2 and know how to use 3dsmax.

Step 1 - File structure:

So first step is getting your file structure right. Since getting your model to load the correct texture at first try has always been my worst enemy. There are few rules to follow.

- The texture file you're using in 3dsmax for your model has to have the same name as the .material file.
- The folder structure for the texture file in 3dsmax also has to be the same as the .material file.

This means that in 3dsmax your model has to use a texture from your mod folder, with the same name and folder structure as the .material file it is going use or it will not show. It does not matter where your mod folder is located unless you have some special characters in it.

Example for saving the .psd file ".../mymod/source/modelsrc/models/mytexture.psd"
Then you should have the .material file with the same name in ".../mymod/output/models/mytexture.material"

Once you use that file as the texture in your 3dsmax model, youre good to go.
Yeah this requires a lot of thinking ahead.

Step 2 - Modeling:

Base model:
Export the model file, such as ".../mymod/source/modelsrc/models/mymodel.DAE"
Standard stuff for the base model itself. Just make sure the texture file you're using is how I described in step1.

Collision model:
Export the collision model as a separate file, such as ".../mymod/source/modelsrc/models/mymodel_collision.DAE"
I've noticed the compiler only reads the geometry for the collision so smoothing groups and textures doesn't matter here.
Enclose the base model with convex shapes with as few polygons as you see necessary. If your model needs concave shapes, use smaller convex shapes to translate it.

Here's a crude example:
q80fkDa.jpg

And here is where the 3dsmax09 comes into play. If you want your collision model to include more than 1 parts you need to use the NS2 Collada plugin which is located in the Natural Selection 2 root folder. The compiler treats every part of the collision model as 1 convex shape if you export the collision model with OPENCOLLADA.
In 3dsmax09 you need to create a rigid body collection from the REACTOR toolbar and add every part of the collision model to it. After you've exported the collision with the NS2 Collada plugin, the model should have multiple collision parts. What I've noticed is that OPENCOLLADA cannot read the information from the rigid body collection and so the compiler cannot see the different parts from the collision.

Step 3 - Exporting and Compiling:

This is super important: Before exporting to .DAE, check that your units setup in 3dsmax is using inches!
The scale of the models in NS2 will go haywire if you are not exporting with inches.
You can change the units from [ Customize -> Units setup -> [ System Units Setup ] ] and from there change it to inches.

For exporting I'm using these settings:
l3tvIyU.jpg

Before running builder you need a .model_compile file:

This file should have the same name as your .DAE file, but it's not necessary. The file name of this file will tell the compiler what name the model should ultimately have.
inside the file should have 2 lines, one for the base model and one for the collision model.

example of .model_compile file:
geometry "mymodel.dae"
physics "mymodel_collision.dae"

I don't think you need to write any folders when all the files are in the same place.

After all these steps the builder should compile you a model with working textures and collisions.

Example of a workflow that might save some time:
  • Save the ALBEDO texture as .psd in the "../mymod/source/modelsrc/.../mytexture.psd"
  • Assign the .psd file to your model in 3dsmax.
  • Finish your model.
  • Save your .DAE file to the same place as the .psd file in "../mymod/source/modelsrc/.../"
  • Create your .model_compile file.
  • Run builder.
  • Create .material file with the same name as the ALBEDO texture.
  • Done.

I hope this guide helps those who wants to get some of their own stuff in NS2.

Comments

  • SamusDroidSamusDroid Colorado Join Date: 2013-05-13 Member: 185219Members, Forum Moderators, NS2 Developer, NS2 Playtester, Squad Five Gold, Subnautica Playtester, NS2 Community Developer, Pistachionauts
    I use 2012 3ds max and I can get models to work just fine. I can't remember if I had to download a special plugin, or if the one UWE gave worked, but maybe that explains why animations didn't work.
  • WhiteDevilWhiteDevil Join Date: 2012-09-16 Member: 159559Members, Reinforced - Shadow
    edited October 2013
    SamusDroid wrote: »
    I use 2012 3ds max and I can get models to work just fine. I can't remember if I had to download a special plugin, or if the one UWE gave worked, but maybe that explains why animations didn't work.

    Yeah, you can get stuff working just fine using OPENCOLLADA. But if you want animations and correct collision models working you need to use 3dsmax09 for the reactor tools and the collada plugin UWE had made.

    edit:

    Here's a better example what is the difference between the two plugins.

    colllision model exported with OPENCOLLADA:
    coll.JPG

    collision model exported with UWE collada plugin:
    coll2.JPG
  • McGlaspieMcGlaspie www.team156.com Join Date: 2010-07-26 Member: 73044Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, Squad Five Gold, Reinforced - Onos, WC 2013 - Gold, Subnautica Playtester
    @WhiteDevil Good stuff sir! Thanks for taking the time to put this together. It could be useful to have a "Possible problems and how to fix them" type section too.
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    I've exported a couple of custom models from Blender with no trouble at all. Haven't checked to see how good collision is though...
  • InsaneInsane Anomaly Join Date: 2002-05-13 Member: 605Members, Super Administrators, Forum Admins, NS1 Playtester, Forum Moderators, NS2 Developer, Constellation, NS2 Playtester, Squad Five Blue, NS2 Map Tester, Subnautica Developer, Pistachionauts, Future Perfect Developer
    Nice guide! I've added it to the sticky collection of tutorials.
  • HowserHowser UK Join Date: 2010-02-08 Member: 70488Members, NS2 Playtester, Squad Five Blue, Reinforced - Shadow, WC 2013 - Shadow, Subnautica Playtester, Retired Community Developer
    Lovely tutorial! though I'm stuffed as I cant get the UWE plugin to work for 3d max 9...
    Anyone know of a work around for getting the collision models working in with 3d max 2013+ Open Collada?
  • BeigeAlertBeigeAlert Texas Join Date: 2013-08-08 Member: 186657Members, Super Administrators, Forum Admins, NS2 Developer, NS2 Playtester, Squad Five Blue, Squad Five Silver, NS2 Map Tester, Reinforced - Diamond, Reinforced - Shadow, Subnautica Playtester, Pistachionauts
    Howser wrote: »
    Lovely tutorial! though I'm stuffed as I cant get the UWE plugin to work for 3d max 9...
    Anyone know of a work around for getting the collision models working in with 3d max 2013+ Open Collada?

    I would also like to know this, as Blender has the same problem with collision models. Why does this happen? Why is it throwing out all that extra geometry and making everything convex?
Sign In or Register to comment.