1. Modelling a basic tank for C&C 3.
A
good target polygon count for a C&C3 vehicle is about 2500. I would aim for about 2000 since rigging later will add more to that count. Avoid getting too close to 3000 and don't waste polys in detail that is too small or wont be seen from the game angle. It's not that the engine can't handle a few extra polys in as much as it is in building up strong modeling skills.It's 'easy' to just pump out models without concern for optimalism, but that can result in degrading quality, performance issues and other visual problems. Remember in games these days the players can zoom in to take a look at your model, so take the time to make it a good one. Remember to trim, cut and clean up as you go to save polys for those last finishing details and also to avoid going over it all again to tidy up at the end.
S
ome things to watch out for while you're modelling:- Coplanar faces, - this is when 2 or more faces occupy the same space on a surface. Not only an inefficient use of polys, but it causes surface shimmering and in some cases shadowing errors.
- Internal faces, - a surface inside an object that you wouldn't see from the outside. This could easilly be an accidently flipped face, which would look like a hole in the mesh from the outside.
- Non-closed surfaces, - sometimes you end up with a very fine gap between faces if you don't, or can't, weld them together. These line bleeds can cause smoothing and shadow problems.
S
o, let's start modelling. Here I'm going to make a Challenger 2 tank. Since I'm modeling a factual vehicle, there is a need for accuracy and detail. Making a model from "eyeballing"photos is not as easy it seems, so it is essential to get a 3-view blueprint drawing and use it in the modeling process. Also make sure you have plenty of photos at hand to refer to, just to check on any details that may not be clear in the drawing. A google image search for your chosen vehicle is usually good enough. To set up your 3-view drawing in Max is fairly straightforward.
C
reate a Plane in top view, 1 seg in length and width.Open the Materials Editor and click the box on the right of the diffuse colour. In the Material/Map Browser, double click on Bitmap and navigate to your 3-view drawing.
Click the Show Map in Viewport button, and apply to selection.
Apply a UVW Mapping modifier to the plane. Drag the panel up a bit until you see the Bitmap Fit button. Click it, and select your 3-view drawing.
The image on your plane will now stay the same size, while you change the length or width of the plane.
Click on Plane under the UVW Mapping to adjust the length and width. If you need to move the drawing to centralize the top drawing on your plane, click the plus sign on the left of the UVW Mapping and select the Gizmo and use the Move tool.
Now clone, rotate and adjust until your setup is like the following. Do your best to keep the drawings lined up (not all are 100% spot on) and set all viewports to Smooth and Edged Faces. I would also suggest setting your perspective viewport to smooth + highlights and turning off transparency.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
2. Modelling continued.
A
s you model, set all objects you create as see through by right clicking on the object and going to Properties, then checking the See Through box. Or if like me you like working in colour, try adjusting the Visibility under Rendering control to about 0.2. You should then be able to see the drawings through the objects. Also, since you disabled transparency in your Perspective view, you can see the solid model too!Keep the objects as close to the drawings as you can. Sometimes you may find faults in the drawings, some edge lines not lining up in the different views for example. Should this happen, it's good to have references to look at to help you get it to look right.
Try and use as few objects as possible to make the shapes. Make use of the extrude and chamfer tools to add those extra faces to the end of your object for that extra curve or detail. Weld the vertices of any adjacent faces you attach together to seal gaps and reduce the vertex count.
T
hese may make your object look a bit blocky though, so remember to select all faces and Auto Smooth it (You will find the button at the bottom of the modify tab on the right panel when you have faces selected). If that produces undesirable results, you can try setting the smoothing groups manually.Any adjacent faces with the same smoothing group number will be smoothed. If the numbers are different, they will appear to have a hard edge between them. A face can have more than one number of smoothing group to smooth with other faces around it, which may be in different groups. The examples in the pictures here show the smoothing group number applied to the faces, with the result.
S
o, fast-forward a bit. There's my model. I'm happy with the detail there, and the polygon count is good too. This would be a good time to texture it!Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
3. Texturing basic.
F
or now I'm going to apply a simple W3D Material to the tank, just so I can see what I'm doing with the texture and UVW Map. We can go back to materials later to add shaders, specular and normal maps when we are ready to export.Select the main body of your tank and open the material editor.
Pick an empty slot and change the material type to W3D. You will then see the material settings list change to a set RenX users will be familiar with.
Open up the Pass 1 rollout and click the Textures tab.
Tick the box Stage 0 Texture and the button under it labeled None to choose your texture file (use a tga).
Click Display and assign material to selection.
Here I've already UVW mapped the model for the texture. If you haven't, the texture will appear as a mess.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
4. Rigging basic.
N
ow to set up the tank for C&C3. There are more than one way to do this, I will go over the basic method first. This method is recommended for very basic models.F
irstly, we must orientate and align our model. Make sure it is sat on the ground (unless your model hovers) and rotate it so it faces to the right in the Top viewport. Center your vehicle above absolute zero (where the two thick lines on the grid meet, aka the 'Origin') as best as you can.Select the meshes for the turret and detach it from the main body. Name it Turret.
Select your turret and go to the hierarchy tab. Click the Affect Pivot Only button and Align to World. Now move the pivot point to the center of the turret's rotation. Test it by clicking the Affect Pivot Only button again (turning it off) and rotate the turret.
Select the meshes for the barrel and detach them, remember to include the parts that elevate with it (the mantlet for example). Name it Barrel.
Select the barrel and go to the heirarchy tab again. Click Affect Pivot Only and Align to World. Now move your pivot to the center of rotation (elevation) for the barrel. Click Affect Pivot Only again to test it.
What we have done here is positioned and correctly aligned the pivots for the turret and barrel that the game will use. The turret rotates on the Z (blue) axis and the barrel elevates on the Y (green) axis. The X (red) axis points to the front of the vehicle, and will be the direction of travel for warheads fired from the weapon.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
5. Rigging Basic continued - Treads.
T
reads work somewhat differently from Generals. Instead of stopping the linear offset effect, the devs seem to have opted to use the HideSubObject approach to show only the appropriately animated treads for the tank's movements. This requires the treads to be cloned 4 times.Detach the treads from the main body if they are not already. Both left and right treads should be attached as one object. Name it TreadsStop.
Assign it a tread texture in a W3D material. Name the material as TreadsStop to avoid confusion later. The texture should ideally be small and show the tread sideways.
Under the Vertex Material tab, change the Stage 0 Mapping type to Linear Offset.
Leave the Args: as their default settings. Assign the material to the tread.
Map the treads so they are continuous. This is so that when the texture rotates around the mesh, the movement appears seamless and no faces will be going backwards.
Now clone the tread mesh as a Copy (not instance). Do not move it. Name the clone TreadsMove.
Open the material editor and clone the TreadsStop texture by dragging it to another slot.
Re-name the clone texture to TreadsMove. In the Vertex Material tab, change the Linear Offset setting UPerSec to 1.0. Assign the material to the TreadsMove mesh.
We now have 2 tread meshes. One with forward moving treads and one without. We can now make one for reverse.
Clone the TreadsMove mesh as a copy. Name the clone TreadsBack. On the Edit UVW screen, turn your tread's UVWs by 180 degrees.
Now we need to make sets for turning.
When a tank pivot-turns left, the left treads roll backwards and the right treads roll forwards.
When the tank pivot-turns right, the right treads roll backwards and the left treads roll forward.
What we did for reverse was rotate both tread's UVWs, only here we just want to rotate just one.
Clone the TreadsMove mesh again, name it TreadsLeft.
Detach the left tread mesh and name it TreadsLeftL. Rotate it's UVW.
Select TreadsLeft and re-attach TreadsLeftL, you may want to use the Select By Name tool (keyboard shortcut H) when doing this.
Now clone TreadsMove again, name it TreadsRight and repeat the last step, this time rotating the right tread.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
6. Rigging Continued - Muzzleflash.
T
he muzzleflash is a simple mesh to show a flash of flame out the end of the barrel when the tank fires. You can make your own or use the one from EA's sample models. Here I have made my own mesh, named FXMuzzleFlash, and given it a material with the Add blend mode.Pickbox
T
he Pickbox is a simple box mesh, which just covers the main bulk of the tank. It's used to by the game for collision detection (prevents units moving through eachother), weapon strike detection and direction and can even assist the game cursor to select smaller units.It should only cover the main bulk of the tank, any bigger and near misses may be taken as a hit. Once you've made the box, right click on it and go to Properties and check the See Through box. Name it OBBox.
Tread effects Bones.
B
ones are simple objects whose pivot point is used to mark a specific location, such as a center of rotation or, in the case of tread effects, a creation point. Tread effects bones are used to kick up dust and leave track marks in the game.Create two on the ground and place one in the middle of each tread. You can use any primitive, but I prefer using 4 segment spheres (which appear as diamonds). The advantage of that is the pivot point is automatically in the center of the object. Name the one on the left FXTracksL and the one on the right FXTracksR.
Heirarchy Subtree.
N
ow we can link everything up, so when the turret turns, the barrel goes with it, etc.To link one object to another, simply select the child object (example; Barrel), click the Link button, press H on your keyboard and double click on the parent object from the list (example; Turret). The parent object flashes white to indicate that a link has been set. Now click the cursor button to select the next child object and link until everything has been linked.
Your chassis should be the highest parent in the list. FXTracks, OBBox, all the Treads and Turret should be linked to the chassis, aswell as any chassis upgrades should you have any.
The barrel and any turret upgrades should be linked to the Turret and finally the Muzzleflash should be linked to the barrel.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
7. Shaders.
B
efore exporting, we need to apply the shaders. Since everything has a basic W3D Material, we've already given ourselves a nice head start on this step.O
pen the material editor and select the main unit texture, then click the Select by Material button. The Select Objects tool should come up showing the objects using this material highlighted. Click Ok to select them.Pick an empty slot in the material editor and click the button labeled Standard. Pick the DirectX 9.0 Shader and discard the old material.
You should see a button with a directory path written all over it, pointing to a default FX shader. Click on that button and choose a shader. The ObjectsGDI.fx shader in the C&C3 folder is suitable for my needs. You should see the parameters panel change.
The Diffuse Texture is your main texture for the model, you then have a Normal map (for depth), specular (for shading or glow) and a House Color Tex for the house color. How to make these images is explained in the SDK documentation.
You must have all of these for the exporter to work!
Note that all of my texture file names start with GU. Below them is a checkbox labeled Preview House Color Enable, this switches on housecolor in the viewports, using the colour set below. Also if your Diffuse texture has an Alpha channel on it for transparency, check the Alpha Test Enable. Apply the shader material to the selected meshes, the tank should now look shiny.
S
elect the muzzleflash mesh and create a new DirectX 9.0 Shader material for it. Select the MuzzleFlash.fx shader and find the Muzzleflash texture for the diffuse texture. Apply the material to your muzzleflash mesh leaving the rest of the settings defaultPrevious | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
8. Animated Shaders.
S
elect the Stop Tread mesh and create a new shader material. Pick the DefaultW3D.fx shader in the C&C3 folder. Put your tread texture as both the Base and Secondary textures (you cannot leave either as None).Scroll down to the bottom and click the button next to Material: labeled Default_renderstyle.
You will now see a default Max material. This is actually a Sub material. Click the material type button labeled Standard. In the Material/Map browser, check browse from Scene and select the TreadStop W3D material we created earlier and apply to the mesh.
N
ow create a new shader material for the moving tread meshes, again using the DefaultW3D.fx shaders. Select your tread textures again as Base and Secondary textures and scroll to the bottom.Set TexMapper0 to 1, and UV0 Scl/Move settings to 1.0, 1.0, 1.0, 0.0.
Leave everything else to default settings and select the Move W3D material under Software Render Style. Apply to the moving tread meshes.
Test the treads by selecting one and hiding all other meshes. Move the animation frame slider and you should see the treads moving. (If they're going the wrong way, rename the meshes)
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
9. Exporting.
T
he final step before exporting is to set the Export Settings. Go to the Utilities tab on the right toolbar and click the W3D Tools button (if this hasn't been added to your buttonset, you need to click the More... button to find it.The W3D Export Settings section is the only part of the toolset we need to use. The options we need to focus on are:
Export Transform (-pivot position and orientation) Export Geometry (-mesh)
Normal (-a normal object) OBBox (-the pickbox)
Hide (-for when you need a surface that should not be shown, like the Pickbox) Shadow (-objects that cast shadows)
E
nsure your objects have the following:- Chassis, Treads, Turret, Barrel : Export Transform, Export Geometry, Normal, Shadow - MuzzleFlash (flame doesn't cast a shadow) : Export Transform, Export Geometry, Normal - OBBox : Export Transform, Export Geometry, OBBox, Hide
- FXTrack bones : Export Transform (note when Export Geometry is unchecked, all other options are blanked out. Transform is the only option you need for bones)
W
e are now ready to export!Click on File>Export...
Change Save as type to W3D XML Asset (*.W3X) and type in a file name. It can be anything you want, however it is a good idea to use a naming convention to keep things clear and organized.
The devs use [FACTION][OBJECTTYPE][NAME][EXTRA], giving GUPredTank (where G is faction GDI, U is objecttype Unit).
I'm naming mine GUChally. Click Save.
The W3X Export Options panel pops up. I'm exporting a simple Hierarchical model with no animations and no reference to other XML files, so I pick the Hierarchical Model option.
If your model is animated, you would pick the Hierarchical Animated Model option.
The Skeleton option is for exporting a character boneset, Pure Animation is for animated character bonesets and Simple mesh is... erm... a simple mesh (no animations, no hierarchical subtree)
Also note the Export Using Existing Skeleton: option. This is used when exporting infantry models, refering to a skeleton set you've exported earlier.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
10. Getting the model into C&C3
T
o test it, we can simply replace the GDI Predator tank.In the MOD SDK folder, there is a folder named Art. Within this folder we need to create a folder named with the first two letters of our art files, in my case GU. Inside this folder I have placed all my texture files and the w3x file for my challenger. All these filenames begin with GU. Now we need to create xml files for each texture file. These are simple files we can create in Wordpad that link the texture IDs to the texture files. They contain the following lines:
<
?xml version='1.0' encoding='UTF-8'?><AssetDeclaration
xmlns="uri:ea.com:eala:asset"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<Texture id="[TEXTURENAME]" File="[TEXTURENAME].[EXTENTION]" />
</AssetDeclaration>
N
ow back in the Mod SDK folder, there is a folder named Mods. Inside this we need to create our Mod folder. I'm calling mine CHALLYMOD. You should notice there is also a SampleMod folder in the Mods folder. Go into this folder and look in its Data folder. Copy the file Mod.xml. Go back to your mod folder and create a data folder and paste your copy of Mod.xml in your data folder.Now go back to the Mod SDK folder and look in CnC3Xml \ GDI \ Units folder. Copy GDIPredator.xml.
Go back to your mod folder again and create the GDI \ Units folders and paste your copy of GDIPredator.xml in the Units folder.
Open GUPredator.xml in Wordpad and use the replace tool to swap all cases of GUPredTank_SKN with the name you exported your model to, in my case GUChally. Save and close the file.
Go back up and open your copy of Mod.xml in Wordpad. Delete everything between the
<Includes> and </Includes> tags apart from the two lines:
<
Include type="reference" source="DATA:static.xml" /><Include type="reference" source="DATA:global.xml" />
U
nder them, we need to add an Include tag for our copy of GUPredator.xml. Note the source path.<
Includetype="reference"
source="DATA:CHALLYMOD\DATA\GDI\Units\GDIPredator.xml" />
N
ow we can build the mod. Click Start and Run. Type cmd and click Ok. Command prompt will open.Change to your Mod SDK directory.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
Note the mod-game line value is C&C3's version number. Update it when you get a new C&C3 patch.
Now insert your C&C3 disc. When the autorun pops up, click the Game Browser button and go to the mods tab. Select your mod from the list and click the Launch Game button.
Congratulations. From now though every time you wish to make changes to your model or textures, you will need to go through the buildmod process again.
Previous | Next
Copyright 2005-2007 © - all rights reserved.
11. Advanced rigging.
N
ow we have got to grips with the basics I'm going to take you through the more complicated method of setting up the tank.The sage engine renders geometry by giving each object it's own "chunk" or draw call. So it takes about the same processing power to render an object weighing 100 polys as an object weighing 1000.
It is the number of draw calls that have an effect on performance; the key is to have as few objects as possible. It's best to have fewer more detailed meshes than more low detail meshes. Just watch out for the vertex count; try not to let that go higher than it really has to for the object. Some Generals objects ended up with loads of separate meshes and massive overall vertex counts, what you should aim for is something like 10 meshes or less. The predator is made of 9 meshes, each object being it's own bone. The Mammoth on the other hand is set up differently. Using the same method as the predator, it would have too many chunks, so they've made the body all one object and used the WWskin to allow bones to control turret and barrel movement.
This is what I'm going to take you through now.
G
oing back to the tank model in 3DS Max, select the chassis, turret and gun barrel and hide everything else.Create a bone, name it Bone_Turret. Click the Align tool button and click on the turret mesh.
What this will do is align the pivot of the bone you have created with the pivot of the turret mesh we positioned earlier on in the basic rigging. Make sure X, Y and Z positions are checked and that both current and target are set on pivot points, click ok.
Create bones for the barrel and chassis and align them. Now link the bones in their own hierarchy (not to any meshes).
Select you chassis mesh and attach your turret and barrel meshes to it to form one object.
Go to the Create tab on the right toolbar, click the Space Warps button and select Westwood Space Warps from the dropdown list. Click WWskin and create one anywhere in your scene. It will show in all viewports as a very small wireframe crossbones.
With the WWskin selected, goto the modify tab and click on Add Bones. Drag-select your
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11
Here's where we link them to the bones. It's a good idea to save often during this bit as it can be unstable.
Select all the vertices for the chassis only (not the turret or barrel vertices). Click the Link to Bone button and click on the chassis bone. You will hear the windows error sound, DO NOT PANIC! If you don't see an error message, it hasn't crashed. It's a very poor choice of sound to play to indicate a successful link, probably the devs showing some humor.
Now select the vertices for the turret only and link them to the turret bone. Do the same for the barrel.
Wondering how to de-select your mesh? Well, you're not permanently stuck. Click the + next to WWskin Binding and de-highlight Vertices or more easily you could just hit H on your keyboard and select another object.
Now that your vertices are linked to bones, you should test them. Select the turret mesh and click the Auto Key animation button. Move the animation slider forward a few frames and rotate the Turret bone. You should see the barrel bone turn with it, aswell as the turret and barrel parts of the tank mesh. Now elevate the barrel bone (ensure the reference coordinate system is set to local), you should see just the barrel part of the tank mesh raise with it.
Excellent! It works! Remember to de-select the Auto Key animation button and delete the keys for the turret and barrel bones.
Unhide everything else. The treads and Pickbox will now need to be Hierarchically linked to the chassis bone, the muzzleflash linked to the Barrel bone. The main tank body and WWskin don't need to be linked to anything. Remember to uncheck Export Geometry in the W3D Tools export settings for your bones and that's it! You're ready to export again!
And that's it!
Previous
Copyright 2005-2007 © - all rights reserved.
That's all folks!
T
hat's all there is to it!I
hope you find this tutorial a great help. If you want to you can leave feedback on the forums. I'm open to any suggestions to make these tutorials better, or even any praise to my glory.You may place a link to my tutorial on your site if you wish, but please to not copy it onto your site. Doing so will get the mob sent after you.
M
y thanks go to:Me! killakanz, for putting so much time and effort into figuring this stuff out and writing about it.
Accele (For the chally's texture. Yep, the right person's finally been named! :p ) Flyby (for moral help while gazing at sample models trying to figure it all out)
Phoib (for his help with my aimless ramblings and keeping my dumbass on the right line with the modbuilding and xml code)
Smurfbizkit (for his handy hints) Mastermind (for his help) k4l4sh (@ burst.cc for site design) Mooshoo (html help!)
And everyone else who's been eagerly waiting for this. My fingers aint quite bleeding yet but they ache now. ;)
-killakanz-
Copyright 2005-2007 © - all rights reserved.
Derelict Studios Forums killamods Home Gmax Tank Tutorial Tank Setup Tutorial (Generals)
C&C3 Tank Tutorial Page 1 2 3 4 5 6 7 8 9 10 11