Introduction
DISCLAIMER: In the majority of my pictures, my PlayerControlObjects for the turrets and MG positions share the same name as the rotational bundle meshes they are parent of. This should not be the case! They should have different description names or else the BF2 editor will crash on loading the vehicle!
Lastly, you'll see I named by Engine "zMotor__Engine". It should be pre-pended with the vehicles name first as with any other mesh. Please keep that in mind, I'll update the pictures accordingly when I have time!
Hello again! This tutorial will teach you how to export a tracked vehicle. In this tutorial, I will be using a WIP version of PR:WW2's new M4A3 Sherman tank as an example of how to:
Set up the export hierarchy, complete with naming conventions,
Create "bones" for your mesh so that wheels and tracks behave realistically in the BF2 editor,
Set up your vehicle's tracks to make use of BF2's Animated UV system using the POE2 Tools,
How to skin your tracks to your vehicle's bones, and lastly
How to export your vehicle and test it before you begin coding.
For reference, I used the following tutorial when I exported my first tracked vehicle a while back. You will see a lot of similarities with it since it's what I learned from, so if you have any issues understanding what I'm explaining try checking this tutorial out as well!
Exporting a Tank for BF2/2142 - Battlefield SinglePlayer Forum
Also, I am assuming that at this point you already have your vehicle's mesh and textures (including your tracks) set up and ready to go. For help in setting up easy tracks, be sure to check my previous tutorial on the subject:
https://www.realitymod.com/forum/f189-m ... ost2159417
Lastly, special thanks to Zemciugas for the model being shown today, and to CTRifle for the current texture! The model of course being PRWW2's new version of the M4 Sherman, the M4A3. Now, without further ado, let's begin!
Naming Conventions
To begin, let's go over naming conventions for when you export your vehicle. There may be more than what I list here, so if anyone comes across any new ones let me know and I will add them!
The basic naming convention I go with for PR vehicles is: [faction]_[vehicle type]_[vehicle name]_[description]__[object type]. Emphasis on the double underscores just before object type! This is so the editor knows what type to assign your mesh when it is exported!
The one exception to this is your main mesh, in my case "us_tnk_m4a3_75mm__PlayerControlObject". You'll notice I don't include a "description", and that is because this name before the object type is what the exported vehicle is named. See the image below to get an idea of the different types, and then we'll go over what each object type is.
![Image](http://i.imgur.com/bH9H0FE.jpg)
"PlayerControlObject"
Also known as "PCO", this mesh is specifically used to control itself and children mesh by way of a player. In the case of our hull, the entire mesh is a PCO. In the case of other PCO's that control say, our hull MG or our turret, they are simple 3 sided faces that the player gives commands to which in turn control their children meshes. We'll get into that later.
![Image](http://i.imgur.com/bJkfVXI.jpg)
"RotationalBundle"
Specifies that the mesh can be rotated. For example, our turret of our tank is a rotational bundle. Later on our "road-wheels" will be turned into rotational bundles as well, but we'll come back to that. Our wheels that will spin but stay static (front and rear) will also be regular rotational bundles.
![Image](http://i.imgur.com/9IoPUg1.jpg)
"GenericFireArm"
Specifies that the mesh can be fired and cause recoil. For example, our cannon of our tank is a "GenericFireArm". As a note, you'll notice our Hull MG is only a rotational bundle. It will indeed shoot, but as we won't have it recoiling we won't worry about giving it this object type.
![Image](http://i.imgur.com/IbRKeKG.jpg)
"Spring"
Specifies that the mesh can be moved up and down in a spring motion. In this case, our wheels (for the time being) will be considered sprints as they will do exactly that.
![Image](http://i.imgur.com/DvDP5sH.jpg)
"Engine"
Specifies the object (usually a simple 3 sided face) that will control the vehicle's wheel movements and power.
This info should do for our tutorial for the time being.
Organizing Your Initial Hierarchy
Alright, now that we have our meshes named correctly, let's organize them!
Starting at the top of our hierarchy will be our main PCO, "us_tnk_m4a3_75mm__PlayerControlObject". This is what the driver of the tank will control.
Now, as I explained earlier, our other PCO's will be simple 3 sides faces. If you haven't made this yet, go ahead and do it now, and apply your vehicle's texture to it. No need for UV's since it won't be seen! This should be hidden inside of the mesh it will be controlling, as seen below:
![Image](http://i.imgur.com/twiNqU1.jpg)
What we'll do now is do the following links: Hull MG -> Hull MG PCO, then Hull MG PCO -> Main PCO. You can do this by clicking the button showed below, clicking and holding on the "child" mesh, then dragging your cursor to it's "parent" and releasing. If you select the wrong parent mesh, you can select your child and then click the "unlink" button showed below and try again.
Protip: Selecting your child, then clicking the "Select By Name" button described earlier lets you select a parent mesh to link to easily! Select the parent, press link, and done!)
![Image](http://i.imgur.com/zefyKqH.jpg)
Now, after doing what I've described, our hierarchy should look like this:
![Image](http://i.imgur.com/UZj2PdO.jpg)
Now, following the same rules, let's do the same with our turret, 50 cal mount, mantle and cannon. Doing so you should get this:
![Image](http://i.imgur.com/ITScL5H.jpg)
Alright, so now to the parts that will make our vehicle move! What I'm going to do first is create another triangular face and name it "us_tnk_m4a3_75mm_zMotor__Engine". The "z" is just so it shows up last in our hierarchy as it is sorted alphabetically. I'll hide it in the rear of the tank's mesh and link it to my main PCO, as seen below.
![Image](http://i.imgur.com/xZbEWhy.jpg)
Now what we'll do for the time being is link the rest of our wheels (both road wheels and rotation wheels) to our engine. What happens in code is the driver controls the engine, which in turn controls its children to turn. Now our hierarchy should be as seen below:
![Image](http://i.imgur.com/sljjKAW.jpg)
Creating Bones
Alright, now let's get on to creating bones for our vehicle. The bones will allow our vehicle's road wheels to move up and down, as well as deform our tracks later down the line once we skin the tracks to our bones.
As a quick definition, we are not creating a literal "Bone" object in 3dsMax, we are going to be using a regular "Pyramid" object that can be found by going to the "Create" tab, clicking the "Geometry" button, selecting "Standard Primitives" from the drop down menu, and then clicking the "Pyramid" button. Doing so will get you something like below:
![Image](http://i.imgur.com/HVhm02B.jpg)
Here is what we're going to do, and I'm sorry I didn't mention is earlier. There are two techniques for animating road wheels: the original I found from the reference tutorial in the intro animated the UV's for the road-wheels rather than animating the mesh. As such, the wheels themselves don't have to spin, and can be used as springs.
However, what we're going to do a technique where we animate our road wheels as rotational bundles. What that means is the following:
We are going to take our current road wheels and replace them with 3 sided faces (similar to what we used for our PCOs in our turret, or our Engine mesh). We will make 2 copies of our wheels (left facing and right facing) and export them as their own object. When we get to the editor, we will add these wheels in manually.
This may seem confusing but I'll walk you through this. First, let's do this. We will take one wheel, right click, clone it to a copy, name it "us_tnk_m4a3_75mm_rdwl_right__RotationalBundle". I will do the same thing with a wheel facing left. Assuming it's center-point is in the center of the mesh already, I'll go ahead and center both at 0,0 of my scene. See below.
Don't forget to unlink your new clones from any parental mesh at this point!
![Image](http://i.imgur.com/v97AEGS.jpg)
With this done, let's go back to our current road wheels. What I'm going to do is create a small 3 sided face to act as my "Spring", center it to one of my road wheels, clone it, center it to the next, etc. until I have a 3 sided face inside each of my road wheels. You can center your face to your wheels by having your face selected, clicking the "Quick Align" button, then selecting the road wheel you want to align to. See below:
![Image](http://i.imgur.com/4jSLTLU.jpg)
Alright, now that we've got our faces, let's go ahead and rename them all. What I'm going to do is first select the road wheel associated with the face, copy its name, delete it, then paste the name into the name of my face. Finally, I'll link all my new springs back to my engine. In the end, you should have the following:
![Image](http://i.imgur.com/Y72LYns.jpg)
Now, getting back to our bone discussion, we will do something similar to what we just did. What I'm going to do is create a small upside down pyramid, and give it the following name: "l1Bone" (My front left "spring's" bone). I don't believe naming convention matters here, but this keeps in organized.
Basically I'll create this first one, name it, quick align it to its associated spring face, clone it, and continue. I'm making my bone 1in X 1in x -1.5in.
Don't forget to give it your tank's texture!.
At the end, I'll go ahead and link each bone to whatever face it is related to. Do this until we reach this point:
![Image](http://i.imgur.com/xmafV8B.jpg)
And voila! Our bones have been created! We'll be coming back later to give these collisions, but I'll save all collision talk for later on.
VERY IMPORTANT NOTE: DO NOT convert your pyramids to anything! Leave them as pyramid objects! Converting them to anything else will cause your bones to export as mesh, not as bones!
Setting Up Our Animated UVs
Alright, let's work now on setting up our treads to animate correctly once we export them to the BF2 Editor! To, do this, we're going to select our main PCO (which should include your tracks). What we'll need to do first (if it isn't already) is convert our main PCO to an "Editable Mesh", then we'll select our tracks and teeth elements only. We'll go to our "BF2" menu item in the top bar, select "BF2 Utilities", and then click "Tank Wheels / Treads". And that's it! Easy right? Now, let's start skinning our tracks!
As a quick important note, if you ever have to make changes to the mesh in Editable Poly, your tread info will be lost! Be sure to convert back to Editable Mesh and do the same technique above to add the track information back.
![Image](http://i.imgur.com/bJTE1pM.jpg)
Skinning Our Tracks
Alright, so this part is a tiny bit tricky, but well worth the effort. What we're going to do is skin our track mesh to our bones. Basically, our collision mesh will affect our bones, which in turn affect our wheels and tracks causing them to bounce up and down with the terrain!
What we'll do first is add a "Skin" modifier to our mesh. We will then add our bones to it to let it know what to have affect our mesh. Finally, we'll set our "Bone Affect Limit" to 1. (See below).
![Image](http://i.imgur.com/HdsJgGJ.jpg)
Next, click the "Edit Envelopes" button, check the "Verticies" checkbox, and uncheck "Envelopes" and "Cross Sections" checkboxes.
![Image](http://i.imgur.com/DFPYFvu.jpg)
Next, we need to set what verticies from our tracks will affect our bones. To do this, we first neext to zero out all existing weights. To do so, click the "Weight Table" button, Click the "Edit" menu item, then go across the top row, inputting "0", then hitting tab. Doing so will zero out every weight below each column. After you do this, close the weight table, uncheck the "weight all verticies" checkbox, and click the "Remove Zero Weights" button.
![Image](http://i.imgur.com/Gn4FvVR.jpg)
Now, open up the weight table one more time. What we're going to do is select each bone in our skin modifier and one at a time, do the following:
Select all vertices we want to be affected by the bone,
In the drop down at the bottom of our weight table, select "Selected vertices",
Click "Edit" in the top menu and "Select All",
Input "1" into the column that is associated with our bone and hit tab,
Select the next bone and repeat.
Once we've done this for each bone, our skinning should be complete! Be sure not to collapse your Skin modifier, as you work will be erased with the collapse! See below for my example skinning my first bone.
![Image](http://i.imgur.com/Nc6WKB3.jpg)
And that's it! We have no completed our model! However, we do need to go into a few things regarding collision meshes. Let's hit that up first before doing out actual export to the BF2 Editor.
This is the end of part one! I will continue the rest in the next post when I've finished it, stay tuned! This will go over how to set up your textures, collisions, and how to export your vehicle! Cheers!
DISCLAIMER: In the majority of my pictures, my PlayerControlObjects for the turrets and MG positions share the same name as the rotational bundle meshes they are parent of. This should not be the case! They should have different description names or else the BF2 editor will crash on loading the vehicle!
Lastly, you'll see I named by Engine "zMotor__Engine". It should be pre-pended with the vehicles name first as with any other mesh. Please keep that in mind, I'll update the pictures accordingly when I have time!
Hello again! This tutorial will teach you how to export a tracked vehicle. In this tutorial, I will be using a WIP version of PR:WW2's new M4A3 Sherman tank as an example of how to:
Set up the export hierarchy, complete with naming conventions,
Create "bones" for your mesh so that wheels and tracks behave realistically in the BF2 editor,
Set up your vehicle's tracks to make use of BF2's Animated UV system using the POE2 Tools,
How to skin your tracks to your vehicle's bones, and lastly
How to export your vehicle and test it before you begin coding.
For reference, I used the following tutorial when I exported my first tracked vehicle a while back. You will see a lot of similarities with it since it's what I learned from, so if you have any issues understanding what I'm explaining try checking this tutorial out as well!
Exporting a Tank for BF2/2142 - Battlefield SinglePlayer Forum
Also, I am assuming that at this point you already have your vehicle's mesh and textures (including your tracks) set up and ready to go. For help in setting up easy tracks, be sure to check my previous tutorial on the subject:
https://www.realitymod.com/forum/f189-m ... ost2159417
Lastly, special thanks to Zemciugas for the model being shown today, and to CTRifle for the current texture! The model of course being PRWW2's new version of the M4 Sherman, the M4A3. Now, without further ado, let's begin!
Naming Conventions
To begin, let's go over naming conventions for when you export your vehicle. There may be more than what I list here, so if anyone comes across any new ones let me know and I will add them!
The basic naming convention I go with for PR vehicles is: [faction]_[vehicle type]_[vehicle name]_[description]__[object type]. Emphasis on the double underscores just before object type! This is so the editor knows what type to assign your mesh when it is exported!
The one exception to this is your main mesh, in my case "us_tnk_m4a3_75mm__PlayerControlObject". You'll notice I don't include a "description", and that is because this name before the object type is what the exported vehicle is named. See the image below to get an idea of the different types, and then we'll go over what each object type is.
![Image](http://i.imgur.com/bH9H0FE.jpg)
"PlayerControlObject"
Also known as "PCO", this mesh is specifically used to control itself and children mesh by way of a player. In the case of our hull, the entire mesh is a PCO. In the case of other PCO's that control say, our hull MG or our turret, they are simple 3 sided faces that the player gives commands to which in turn control their children meshes. We'll get into that later.
![Image](http://i.imgur.com/bJkfVXI.jpg)
"RotationalBundle"
Specifies that the mesh can be rotated. For example, our turret of our tank is a rotational bundle. Later on our "road-wheels" will be turned into rotational bundles as well, but we'll come back to that. Our wheels that will spin but stay static (front and rear) will also be regular rotational bundles.
![Image](http://i.imgur.com/9IoPUg1.jpg)
"GenericFireArm"
Specifies that the mesh can be fired and cause recoil. For example, our cannon of our tank is a "GenericFireArm". As a note, you'll notice our Hull MG is only a rotational bundle. It will indeed shoot, but as we won't have it recoiling we won't worry about giving it this object type.
![Image](http://i.imgur.com/IbRKeKG.jpg)
"Spring"
Specifies that the mesh can be moved up and down in a spring motion. In this case, our wheels (for the time being) will be considered sprints as they will do exactly that.
![Image](http://i.imgur.com/DvDP5sH.jpg)
"Engine"
Specifies the object (usually a simple 3 sided face) that will control the vehicle's wheel movements and power.
This info should do for our tutorial for the time being.
Organizing Your Initial Hierarchy
Alright, now that we have our meshes named correctly, let's organize them!
Starting at the top of our hierarchy will be our main PCO, "us_tnk_m4a3_75mm__PlayerControlObject". This is what the driver of the tank will control.
Now, as I explained earlier, our other PCO's will be simple 3 sides faces. If you haven't made this yet, go ahead and do it now, and apply your vehicle's texture to it. No need for UV's since it won't be seen! This should be hidden inside of the mesh it will be controlling, as seen below:
![Image](http://i.imgur.com/twiNqU1.jpg)
What we'll do now is do the following links: Hull MG -> Hull MG PCO, then Hull MG PCO -> Main PCO. You can do this by clicking the button showed below, clicking and holding on the "child" mesh, then dragging your cursor to it's "parent" and releasing. If you select the wrong parent mesh, you can select your child and then click the "unlink" button showed below and try again.
Protip: Selecting your child, then clicking the "Select By Name" button described earlier lets you select a parent mesh to link to easily! Select the parent, press link, and done!)
![Image](http://i.imgur.com/zefyKqH.jpg)
Now, after doing what I've described, our hierarchy should look like this:
![Image](http://i.imgur.com/UZj2PdO.jpg)
Now, following the same rules, let's do the same with our turret, 50 cal mount, mantle and cannon. Doing so you should get this:
![Image](http://i.imgur.com/ITScL5H.jpg)
Alright, so now to the parts that will make our vehicle move! What I'm going to do first is create another triangular face and name it "us_tnk_m4a3_75mm_zMotor__Engine". The "z" is just so it shows up last in our hierarchy as it is sorted alphabetically. I'll hide it in the rear of the tank's mesh and link it to my main PCO, as seen below.
![Image](http://i.imgur.com/xZbEWhy.jpg)
Now what we'll do for the time being is link the rest of our wheels (both road wheels and rotation wheels) to our engine. What happens in code is the driver controls the engine, which in turn controls its children to turn. Now our hierarchy should be as seen below:
![Image](http://i.imgur.com/sljjKAW.jpg)
Creating Bones
Alright, now let's get on to creating bones for our vehicle. The bones will allow our vehicle's road wheels to move up and down, as well as deform our tracks later down the line once we skin the tracks to our bones.
As a quick definition, we are not creating a literal "Bone" object in 3dsMax, we are going to be using a regular "Pyramid" object that can be found by going to the "Create" tab, clicking the "Geometry" button, selecting "Standard Primitives" from the drop down menu, and then clicking the "Pyramid" button. Doing so will get you something like below:
![Image](http://i.imgur.com/HVhm02B.jpg)
Here is what we're going to do, and I'm sorry I didn't mention is earlier. There are two techniques for animating road wheels: the original I found from the reference tutorial in the intro animated the UV's for the road-wheels rather than animating the mesh. As such, the wheels themselves don't have to spin, and can be used as springs.
However, what we're going to do a technique where we animate our road wheels as rotational bundles. What that means is the following:
We are going to take our current road wheels and replace them with 3 sided faces (similar to what we used for our PCOs in our turret, or our Engine mesh). We will make 2 copies of our wheels (left facing and right facing) and export them as their own object. When we get to the editor, we will add these wheels in manually.
This may seem confusing but I'll walk you through this. First, let's do this. We will take one wheel, right click, clone it to a copy, name it "us_tnk_m4a3_75mm_rdwl_right__RotationalBundle". I will do the same thing with a wheel facing left. Assuming it's center-point is in the center of the mesh already, I'll go ahead and center both at 0,0 of my scene. See below.
Don't forget to unlink your new clones from any parental mesh at this point!
![Image](http://i.imgur.com/v97AEGS.jpg)
With this done, let's go back to our current road wheels. What I'm going to do is create a small 3 sided face to act as my "Spring", center it to one of my road wheels, clone it, center it to the next, etc. until I have a 3 sided face inside each of my road wheels. You can center your face to your wheels by having your face selected, clicking the "Quick Align" button, then selecting the road wheel you want to align to. See below:
![Image](http://i.imgur.com/4jSLTLU.jpg)
Alright, now that we've got our faces, let's go ahead and rename them all. What I'm going to do is first select the road wheel associated with the face, copy its name, delete it, then paste the name into the name of my face. Finally, I'll link all my new springs back to my engine. In the end, you should have the following:
![Image](http://i.imgur.com/Y72LYns.jpg)
Now, getting back to our bone discussion, we will do something similar to what we just did. What I'm going to do is create a small upside down pyramid, and give it the following name: "l1Bone" (My front left "spring's" bone). I don't believe naming convention matters here, but this keeps in organized.
Basically I'll create this first one, name it, quick align it to its associated spring face, clone it, and continue. I'm making my bone 1in X 1in x -1.5in.
Don't forget to give it your tank's texture!.
At the end, I'll go ahead and link each bone to whatever face it is related to. Do this until we reach this point:
![Image](http://i.imgur.com/xmafV8B.jpg)
And voila! Our bones have been created! We'll be coming back later to give these collisions, but I'll save all collision talk for later on.
VERY IMPORTANT NOTE: DO NOT convert your pyramids to anything! Leave them as pyramid objects! Converting them to anything else will cause your bones to export as mesh, not as bones!
Setting Up Our Animated UVs
Alright, let's work now on setting up our treads to animate correctly once we export them to the BF2 Editor! To, do this, we're going to select our main PCO (which should include your tracks). What we'll need to do first (if it isn't already) is convert our main PCO to an "Editable Mesh", then we'll select our tracks and teeth elements only. We'll go to our "BF2" menu item in the top bar, select "BF2 Utilities", and then click "Tank Wheels / Treads". And that's it! Easy right? Now, let's start skinning our tracks!
As a quick important note, if you ever have to make changes to the mesh in Editable Poly, your tread info will be lost! Be sure to convert back to Editable Mesh and do the same technique above to add the track information back.
![Image](http://i.imgur.com/bJTE1pM.jpg)
Skinning Our Tracks
Alright, so this part is a tiny bit tricky, but well worth the effort. What we're going to do is skin our track mesh to our bones. Basically, our collision mesh will affect our bones, which in turn affect our wheels and tracks causing them to bounce up and down with the terrain!
What we'll do first is add a "Skin" modifier to our mesh. We will then add our bones to it to let it know what to have affect our mesh. Finally, we'll set our "Bone Affect Limit" to 1. (See below).
![Image](http://i.imgur.com/HdsJgGJ.jpg)
Next, click the "Edit Envelopes" button, check the "Verticies" checkbox, and uncheck "Envelopes" and "Cross Sections" checkboxes.
![Image](http://i.imgur.com/DFPYFvu.jpg)
Next, we need to set what verticies from our tracks will affect our bones. To do this, we first neext to zero out all existing weights. To do so, click the "Weight Table" button, Click the "Edit" menu item, then go across the top row, inputting "0", then hitting tab. Doing so will zero out every weight below each column. After you do this, close the weight table, uncheck the "weight all verticies" checkbox, and click the "Remove Zero Weights" button.
![Image](http://i.imgur.com/Gn4FvVR.jpg)
Now, open up the weight table one more time. What we're going to do is select each bone in our skin modifier and one at a time, do the following:
Select all vertices we want to be affected by the bone,
In the drop down at the bottom of our weight table, select "Selected vertices",
Click "Edit" in the top menu and "Select All",
Input "1" into the column that is associated with our bone and hit tab,
Select the next bone and repeat.
Once we've done this for each bone, our skinning should be complete! Be sure not to collapse your Skin modifier, as you work will be erased with the collapse! See below for my example skinning my first bone.
![Image](http://i.imgur.com/Nc6WKB3.jpg)
And that's it! We have no completed our model! However, we do need to go into a few things regarding collision meshes. Let's hit that up first before doing out actual export to the BF2 Editor.
This is the end of part one! I will continue the rest in the next post when I've finished it, stay tuned! This will go over how to set up your textures, collisions, and how to export your vehicle! Cheers!