Complete Tutorial

Part 5: A complete model- With Hardpoints

Preperation

This part of the tutorial is intended as a "rigging" tutorial, not a modeling tutorial. I assume that you have some basic knowledge of 3ds max and that you have a model ready that has been skinned. Nothing else is required.

Okay here we go! Today I will be using the Assault Frigate model made by EvilleJedi so next time you see him, Thank him :p

To start out use any importer you like to open the OBJ from the warlords pack and get it into max.

To start out we look at our model. If our model is not centered or is on its side we can correct that with our rotate/move tool. Select everything and move it so that the ships center point is around 0,0,0. If you move these all at the same time you can prevent the pieces from coming out of alignment.

Now i suggest pressing the "H" key in max and it brings up a box that you can use to select objects by name. Select the main object. (in most warlords models the name of the meshes is HULL_LOD0 ect ect..

I try to rid of the stuff that i will not be using.. so i suggest you take the time now and rename those meshes that will be used.. then delete those that wont

Some Commonly used names are

MESH_LODX -Replace X with the LOD-remember 0 is highest poly then going down from there.

COLLISIONMESH - This should be a mesh that is a simplified version of the original ship's shape. The MeshCollision.fx will be placed on this later so no other preperation is necicary

SHADOWMESH - The shadow mesh of the object. Basically another Similar Collision meshy style mesh. A warning here Collision meshes should be closed (meaning there is no holes or anything of that sort) or it may cause an irregular shadow in the game.

These are only some basic names. They should get you past this section. The more organized we start the better we are. It helps with coding as well. We are now ready to continue

Putting some skins on the model

As you may have read above skins only work if they are with an assigned shader. This is no diferent. There are many diferent shaders for many diferent parts of the model. So lets start with the most obvious part. The model itself. Now if you have a skin on this model already this is going to be extremely easy. If not go ahead and uv unwrap the model and skin the mesh. Otherwize just read on.

This being a capital ship, we should problably use a shader that has bump maps since most big ships need and have them. So for my model I choose mesh bump colorize. This is one of the only shaders i use for the main part of a capital ship mesh and it is very good at it. There are other ones that can be used, just experiment. (its fun anyway..)

So i choose mesh bump colorize.fx

Unfortunately for us the warlords models come in photoshop format. We need to change it to dds-DXT3 format. This is a very simple task as i will show below.

Open the skin in photoshop or in your favorite editor.

We need to make sure that the texture is a good size. Not too big and not too small. I am going to use a 512x512 sized map. The skin originaly came at a size of 1024x1024.

We resize and make any necicary adjustments.

Now we save as a DDS. I have already explained this above so if you dont know just look up.

But We also need a bump map. Well here im going to show you a fast and easy way to make bump maps. This lesson will be very handy in making your own bump maps.

Bump Maps

Open the skin file we just made and turned into DDS. (open the DDS file). Then hit save as. Resave it as a standard DDS dxt3 file. This is just a precautionary measure from overwritin anything we have previously made.

Method 1: The easy way

This is the fast and easy way to do it. All we have to do is let the dds "exporter" do the work for us.

So save as and this time save it as Assaultfrigateb.dds (just an example since im doing the AF) Then you get to the DDs screen do not click finish yet. Use the following settings.

Then click on 2d preview on the main dds save screen and you should get something similar to this.

Looks like a bump map to me. It also looks very detailed and good. The one downside: we dont have much control over what it calls bumpy and what it does not. Its in the way you shade it /color it.

Method 2: Controll

You have more controll. The downside, Its harder. Not too much harder but it does take some time to get fine details. I think you could get higher details with this method in the end but here we go.

Okay so again open the main DDS file and save as. Then re open the DDs file. I mean re open it since if we dont we cant continue. Once you open the new dds file we may begin.

The reason i asked for you to re open is becuase this gives us an alpha layer that we can work with now. Sure you can put it in yourself while working with a PSD image but for some reason it does not let you export it. So this is the way to get it in.

Okay so go to the alpha layer. Notice how its all white. Let me make this simple. White=low Black=High.(that may be backwards so anyone check me please) Like any other height map. Basically you want to sketch out the parts that you want raised and lowerd. Shades of gray will be hieghts inbetween.

Again im not going to go into this much more than that becuase of my lack of time. Besides there are other photoshop tutorials out there that may help you.

Once you have your height map made save as dds file and save as Assaultfrigateb.dds (again.. im doing AF)

The only diference here is that we will not be using the default average RGB. This time use alpha layer. Then click on 2d preview. This time we should be seeing your height map but this time we made it with an alpha layer. We have specific controll over what we make. Yay!

Wrapping this up

This part should be applied to both bump and color maps. Re open both of their DDS files. Go to both of their alpha layers and fill them with black.

After the bump map is made and the color map is done the alpha layers serve as a way for the game to controll some other features such as glow and refectiveness. So until you know how to use them I suggest keeping it off. (black)

WARNING!

Every time you save you must make sure that you have your options set up right. Under most circumstances you should use the default settings which means no tangent map bump map.. settings.. ect ect.

Even if you are saving an already made bump map use color. Since its already made you dont need to create another bump map.Actually if you change the alpha layer to black like I said and save it like you did to make the bump map you will ruin it.

You should only use tangent space option and the other options to convert to bump map if you are CREATING a bump map.

After that initial save Do not re save the same way. Always check the 2d preview to make sure your settings are correct.

You may now go back to your model.

Now that you have a bump map and a color map apply add them to the right boxes then click and drag it to your mesh.

Using these settings normally works. If you need more help check on the shaders tutorial and the shader use tutorial.

Okay so now your mesh is shadered

Collision Mesh

this is actually very easy. Soo easy that i will not show pictures for it. The collision mesh should be a mesh that has less polies than the original (less of those nice details) but has most of the original shape. It just tells the game where this ship is "concrete"

Once you have it named, make a new shader. This time use MeshCollision.fx and click and drag it to the model. Simple right?

We are not done yet. Now we go to the alamo tools.

These are the setting to be used.

Look at the right side

Now for shadow mesh. Same as the collision mesh. Shader use Meshshadowvolume.fx.Then click and drag to the shadow volume.

Use these settings for the shadow mesh.

Hard points

Ah Yes the tutorial we have all been waiting for.

Here are some things to know before we start.

1- Hardpoints may contain any or all of the following: A hardpoint mesh, A collision Mesh, or a light mesh.

2- Hardpoints must be each in their own ALO file.

3- No bone should be placed in the HP. They should be in the model instead

Also remember that your main mesh should not contain any of the HP meshes at all.

Okay Well that being said this tutorial is rather easy.

First we grab our model, and grab the mesh that we want to use as a hardpoint.

I suggest that the names be consistant. Saves a lot of code time. Such as HP_01.. ect ect. Then using FIRE_01.. ect ect. as the fire bone for HP_01. It save time because then in the code you know what names correspond with which hardpoints.

Okay so select the hardpoint model like I said.

Now go to the hierarchy tab. Then click on Affect pivot only.

Okay so once you click on affect pivot point only you should get some bigger arrows. These arrows are your pivot point location and orientation. If your pivot point is not near the center of the model, then do so now. Click on center to object. Once that is done and your pivot point is centered you must now place a bone that will tell the game where to place this model.

To do this place a bone anywhere.

Now click on align while you have your bone selected. Notice my bone name is called ATTACHMENTBONE. That is a rather long name. Normally i would use ATTACH01..ect ect, but since my model is already done I dont want to mess anything up like that. So once you click on align while you have your bone selected click on the hardpoint. A small window will pop up. Use these settings.

What does this do? This places the attachment bone right on the pivot point of the model. This game uses pivot points for various reasons. The front of the pivot point (the red arrow or the x axis) is the front. This game uses firing bones but it detirmines which way its orientation is by which way that red arrow is pointing. For hardpoints and attachment bones this does not matter. For firing bones its essential.

Back on topic, now that we have the attachment bone in place we get to export the hardpoint. If you click unhide all you can double check to see if your model is in the proper position and that your attachment bone is in position as well. Once you double checked it, click on the hardpoint and hide everything else. Remember that the hardpoint should be skinned and shadered like any ordinary mesh. Once its ready move it to 0,0,0.

The reason we hid all the models and moved it to 0,0,0 is becasue we have to export he hardpoint. The game will place the hardpoint on the attachment bone. Right on its pivot point. So if we are at 0,0,0 and the bone is in your desired location, your HP will show up right where it was originally.

So make sure you have everything ready and click export. I just named mine AF_HP01.alo

So its now exported, but as you may know we are not done yet. We must now place firing bones on the model so that the game knows where to fire from. They do not go in the hardpoint model. They go on the original main model. So place firing bones. Change their pivot point so that the X arrow (the red one) points the way you want it to point. Name it "FIRE01" or something similar

So you have firing bones now.

Exporting the main model is qute simple. Here are some guidelines.

All bones must be exported this way. Do not export geometry. No collision ect ect. They are just bones.

The main mesh should export geometry. No collision. (thats what the collision mesh is for)

Delete (i just hide them in max) the hardpoint meshes so they dont show up in game. Anything you exported in the hardpoint should not be exported with the model. Right clicking and then hitting hide will work fine since alo exporter does not export these but just places them as bones.

To make any other types of hardpoints just follow what the original models have. Check their attachment bones their other bones ect ect.

Okay so once you make all your hardpoints and have a model fully coded. You need to make those hardpoints fall off. So how do we do this?

Go to spaceprops.xml Look for the code on hardpoint break off. You only have to change the model to your hardpoint. That is all. Then add it to the code in hardpoints.xml