CFS3 Attack in the West '40 Campaign

CFS3 Attack in the West '40 Aircraft

Viso's Aircraft Tutorial for Gmax
Viso's Vehicle Tutorial for Gmax


From Bitmap to Vroom-Vroom-Vroom in 60 Minutes:
An Overview of gmax Vehicle Design for CFS3

By Craig "Viso" Murray
Last Updated: 11-Apr-2007
Send an email to Craig

Introduction


  Vehicle Selection
Diagram Preparation
Basic Shaping
Armament
Virtual Cockpits
Damage Boxes
Emitters
Hierarchy & Wrecks
Texture Design
Texture Mapping
Exporting to CFS3
Test Driving
 
 

In Conclusion

Bonus: Animated Tracks

 

Introduction

An Introduction to the Overview
If you've read my aircraft tutorial, then you'll see a lot of similarities in this tutorial. Part of that is for the sake of convenience, but much of it is due to the similarity of the subject matter. In fact, building vehicles is quite a bit like building aircraft, except that vehicles are generally much simpler. If you've thought about trying modeling, this is probably the best way to get started.

Of course, there's a catch.

I've spent years refining my aircraft tutorial. It covers a lot of territory, and much of that ground is touched on here. So rather than repeat those sections here, I'm going to send you over to the aircraft tutorial to learn about a variety of basic concepts. On the bright side, if you've already done the 'crash course' in aircraft modeling - that's the one you complete in 60 minutes or so - then you should have no problems with this tutorial.

Given the subject matter, this tutorial won't go as deep as the aircraft tutorial. There also won't be a step-by-step tutorial, although you won't do too badly if you build a vehicle as you move through each of the steps.

I hope you will find this helpful.

What Equipment You Will Need
Quite simply, you will need exactly the same equipment to create a vehicle as you will need to create an aircraft. Please refer to the aircraft tutorial. See the section titled What Equipment You Will Need and follow the instructions listed there.


Step 1: Vehicle Selection
You probably have a particular vehicle in mind that you'd like to build. But before you begin, I'd like to suggest that you consider your choice in light of the following criteria:

 

Historical Significance

Do some research so that you understand the role this vehicle played. Where was it used? By which nations? In which theatres? For what types of missions? Against which enemy? Which exact versions were used and in what quantity?

   

Availability of Data

This may be the most frustrating task of all. Some vehicles have gobs of available data. Others have very little. For best results, you'll need lots of data - as well as a reasonable basis for making educated guesses to fill in the gaps.

   
Also, you'll need to obtain a good three-dimensional view of the vehicle. These can be found at several sites.
   

Step 2: Diagram Preparation
As part of your data collection, you will have located the best three-dimensional diagram that you could find. When you start working in gmax, each of the viewports (top, front, left, or whatever) can hold one of these diagrams. As you build, you will use these diagrams as templates to "trace" the image of the vehicle.

However, before you load them to gmax, you should prepare the diagrams (which I'll assume you've converted to bitmaps). To make things easier for gmax to handle, I recommend that you use 1024x1024 bitmaps. You'll need three separate bitmaps: Top, Side, and Front.

Regardless of how you build your vehicle, gmax will assume that the centre of gravity is at 0,0,0. Yes, you can adjust this later. However, it might be easier to arrange your bitmaps so that - when they appear in gmax - the vehicle's centre of gravity will inherently line up at 0,0,0. To configure your bitmaps in this manner, follow these steps:

  • Start with a single image that includes top, side, and front views. This will ensure that all three views are scaled identically.
  • Using a 2-pixel wide red stripe of about 10 pixels in length, mark each of the centers of gravity. Each view will need two CoGs marked as follows:

For the overhead view:
  1. The lateral (side-to-side) centre of gravity should cut the hull cleanly in half.
  2. The longitudinal (front-to-back) centre of gravity can fall anywhere but should be roughly near the midsection of the vehicle.

For the side view:
  1. The longitudinal (front-to-back) centre of gravity can fall anywhere but should be roughly near the midsection of the vehicle.
  2. The vertical (top-to-bottom) centre of gravity should be where the wheels or tracks touch the ground.

For the front view:
  1. The lateral (side-to-side) centre of gravity should cut the hull cleanly in half.
  2. The vertical (top-to-bottom) centre of gravity should be at ground level.
  3. Bear in mind that some diagrams are not scaled identically. Compare the length/width/height in each diagram and adjust as needed.
Having marked the CoGs, you can now copy-and-paste each view into a separate bitmap.

  • Overhead View Bitmap: Create a new 1024x1024 bitmap. Copy and paste the overhead view here. If necessary, rotate the image so that the nose is pointing to the top. Then, carefully move the image around until the vertical CoG stripe falls on the 511th and 512th vertical pixels and the horizontal CoG stripe falls on the 511th and 512th horizontal pixels. In other words, if the vertical and horizontal CoG strips were extended from top to bottom and from left to right, they should divide the image into four equally-sized quadrants. Be patient. This can take quite a bit of nudging. Save the bitmap as vehicle_Top.bmp.
  • Note that the image of the vehicle will not sit in the middle of the bitmap. You should have quite a bit of "white space" in front of the nose if you've placed it correctly.

  • Side View Bitmap: Create another new 1024x1024 bitmap. Copy and paste the side view here. As with the overhead image, carefully move the image until the vertical and horizontal CoG strips fall on the respective 511th and 512th pixels. Save the bitmap as vehicle_Left.bmp.
  • Front View Bitmap: Create another new 1024x1024 bitmap. Copy and paste the front view here. As with the overhead image, carefully move the image until the vertical and horizontal CoG strips fall on the respective 511th and 512th pixels. Save the bitmap as vehicle_Front.bmp. If you like, you can also do a back view.
  • Now that you've created the images, you can open gmax, and load the bitmaps into the backgrounds of the respective TOP, LEFT, and FRONT viewports.

    Once you've loaded the images in to the viewports, you'll want to create a dimensions box. This box should be precisely as long and as wide and as high as is your actual vehicle. Get the dimensions from one of your reference sources.

    Next, you'll need to Zoom Extents in All, and then separately zoom each viewport until the edges of the vehicle all touch the boundaries of the dimensions box. After you make adjustments and Lock View, Zoom Extents in All to see where the image wants to rest. Keep adjusting until everything lines up.

    When you're happy with everything, save the project as vehicle_v001_Bitmap. Save it again as vehicle_v002_Hull and then you can start working on the hull. Incrementing your files in this manner will make it much easier to go back a few steps when you mess up something later on.

    For some more tips on bitmap placement, see Hugh Shoult's "The Stupid Idiots' Guide to starting with gmax" at http://www.simviation.com/gryphon/tutorials/gMax_00.htm.


    Step 3: Basic Shaping
    Here's where we start the creation process. In the aircraft tutorial, I talked about differing approaches and such. In this tutorial, we can pretty much just dive right in and start building. Most of it's pretty simple, but there are some important things you need to do first.

    1. Before you do anything else, create a dummy object in the shape of a small box called MyVehicle or whatever you want to call your model. This will be the top node in your entire hierarchy.

    2. Make sure that the pivot points of your dummy object are the same as your gmax scene, so green should point forward, red to the right, and blue straight up to the sky.

    3. Place your dummy object at coordinates 0,0,0 so it's in the dead centre of your model. Next, slide it forward so that it is lined up with the point where your vehicle's front tire (or front part of the tread) touches the road. This placement is critical because this will determine where CFS3 places your model during vehicle spawns.

    4. Clone the MyVehicle object and name it Vhcl_Normal. Make another clone and call it Vhcl_Damaged. Link both of these objects to MyVehicle.

    5. Make some more clones of MyVehicle object and name them as Vhcl_Normal_LOD_10, Vhcl_Normal_LOD_100, Vhcl_Damaged_LOD_10, and Vhcl_Damaged_LOD_100. Link both 'Normal' ones to Vhcl_Normal and both 'Damaged' ones to Vhcl_Damaged.

    6. Create a box and call it Hull_100. Stretch and shape this box so that it fits the appropriate space relative to your diagrams. Feel free to cut, slice, extrude, and otherwise mold this object to fit your needs. Also, feel free to add other boxes, cylinders, and whatever else you might need. This will entail quite a bit of work if you're going for a detailed model so don't let the brevity of this paragraph fool you. Link Hull_100 to Vhcl_Normal_LOD_100.

    7. Create a box and call it Turret_100. Shape this so that it looks like the turret of your vehicle, assuming that you're building a tank. Add a long cylinder for the gun and any other bits that you care to add. Later on, we'll add the necessary components to make the turret rotate. We'll link the turret in later.

    8. Yet again, clone the MyVehicle object and name it F_axle_100. Make another clone and call it R_axle_100. Link both of these objects to Hull_100. These objects are the front and rear axles and CFS3 uses them to position the vehicle properly. Line them up with the front and rear wheels (or drive sprockets in the case of tracks).

    9. If you're building a tracked vehicle, create a pair of identical cylinders named Tread0_100; don't worry that they have the same name. Stretch and shape the cylinders so they look like the treads of the tank. You might find it easiest to create one tread, shape it correctly, and then clone it to create the other tread. Place these objects at the left and right sides of the vehicle where the treads would be located. You can get quite a bit more detailed with treads by adding ridges, knocking out the facing polygons and adding suspension detail and so forth. It's up to you. In my models, I generally create a rubber-band like object that I stretch around the suspension detail. Link your treads to Hull_100.

    10. If you're building a wheeled vehicle, you'll need two sets of cyclinders names F_wheel_blurred, F_wheel_still, R_wheel_blurred, and R_wheel_still. F and R stand for front and rear. When you're all done, you should have at least eight wheels, left and right versions of each of the four types mentioned. If your vehicle has more wheels (as with a 6-wheeled truck or an 8-wheeled armoured car) then you'll need more. Note that F_wheel objects are able to pivot left and right while R_wheel objects stay fixed. Also, if you're building a tracked vehicle, your drive sprockets should all be R_wheel objects. Link your wheels to F_axle_100 or R_axle_100 as is appropriate.


    Step 4: Armament
    If you haven't already added some skinny, machine-gun shaped objects, please do so. Once you've done that, you'll need to add some dummy objects to indicate where the muzzle flashes should originate and in which direction the bullets should fly. This is what we'll do now.

    Fixed Guns
    Fixed guns are more common in aircraft. Guns, including both machine guns and cannons, are mounted by creating a dummy object and orienting it so that it fires in the proper direction. Guns are labeled as follows: gun_grp#b# (e.g. gun_grp0b0)

    Groups (grp) refer to the number of guns identified in the XDP file, where "grp0" is the first group. The next group is "grp1", and so on. Barrels allow you to create multiple flashes from a single group of guns by simply adding more barrels.

    Flexible-Mount Guns
    Typically, these are defensive guns mounted either at the rear of the cockpit or in a turret. There are created in much the same manner as fixed guns, except that they require two additional dummy nodes. From a hierarchy perspective, you will need the following:
       

    gun0_l_r

    Dummy node with axes positioned such that (a) green axis points in line with barrel and is lined up so that it is 'shooting' at the gunner and (b) blue axis points up. Links to the vehicle fuselage or the cockpit.

    The gun will rotate wherever you place this object, so place this node at the base of the gun mount. The dummy object needn't be very large, so feel free to shrink it down to size.

     

    gun0_fore_aft

    Dummy node with axes positioned such that (a) green axis points in line with barrel and is lined up so that it is 'shooting' at the gunner and (b) red axis points up. Links to gun0_l_r.

    As with the previous node, place this node at the base of the gun mount. You may find it easier simply to clone gun0_l_r and rename it as gun0_fore_aft. Just remember that the axes must be oriented differently.

     

    gun_grp0b0

    Same as in fixed guns. Links to gun0_fore_aft. Place this at the end of the gun barrel.

     
    As a general rule, all GUN_GRP#B# nodes should be attached to the LOD_100 level. Otherwise, CFS3 won't always recognize the guns. You may also include additional copies in other LODs or in the virtual cockpit. Just make copies and include a numerical extension (i.e. GUN_GRP1B0_50 or GUN_GRP1B0_1 for LOD_50 or the Virtual Cockpit 1).

    Now we come to an important point ... but only if you are building a tank that has both a main cannon and a co-axial machine gun. This is a very common arrangement whereby the tank's main cannon has a machine gun mounted right next to it. As it happens, you will want to configure your turret slightly differently depending on whether you wish this version of your vehicle to be driveable or non-driveable. Here are the differences:

    • Driveable Vehicles with Cannon and Co-Axial MG: For this type of vehicle, GUN0_L_R should be positioned just below the center of the turret, such that the turret will rotate properly. Turret_100 should be linked to GUN0_L_R. GUN0_FORE_AFT should be positioned such that the main cannon will elevate properly and it should be linked to Turret_100. Finally, GUN_GRP0B0 should be the co-axial MG and GUN_GRP1B0 should be the main cannon. GUN_GRP0B0, GUN_GRP1BO, and the physical gun objects should be linked to GUN0_FORE_AFT. Using this approach, the driver can aim the turret using the co-axial MG and then switch to the main cannon as needed. Note that separate gunner stations must also be configured in the XDP file to operate the weapons separately.

    • All Other Vehicles: This is the default condition. Use this approach if your vehicle is non-driveable or if it lacks both a cannon and co-axial MG. As before, GUN0_L_R should be positioned just below the center of the turret, such that the turret will rotate properly. Turret_100 should be linked to GUN0_L_R. GUN0_FORE_AFT should be positioned such that the main cannon will elevate properly and it should be linked to Turret_100. Finally, GUN_GRP0B0 should be the main cannon and GUN_GRP1B0 should be the co-axial MG. GUN_GRP0B0, GUN_GRP1BO, and the physical gun objects should be linked to GUN0_FORE_AFT. Using this approach, CFS3 will aim the turret at targets based on the capabilities of the main cannon. The co-axial MG will also fire but it will not influence the turret movement.

    One point that I alluded to in the preceding discussion is that guns can be configured to seek out specific types of targets. I'm speaking here of the files in the Guns directory of CFS3. If you look through enough of the XDP files in this directory, you'll find that some have a parameter called Target Category. This can contain values like Wheeled, Tracked, Buildings, and so forth. Thus, it is important to select the most appropriate guns when configuring the XDP file for your vehicle.

    If you like, you can also configure the gunner's eyepoint to swivel in line with the barrel of the gun. To do so, simply link the eyepoint# to GUN#_FORE_AFT. Try positioning the eyepoint towards the back of the gun and just above so that the player can look along the entire length of the barrel.


    Step 5: Virtual Cockpits
    No other subject caused me more anxiety than that of cockpits, notwithstanding assurances from the CFS3 forums that building them was a snap. Well, they are pretty easy to build - once you understand the basics.

    I should also mention that virtual cockpits are only required if you are building a driveable vehicle. If not, then you can completely ignore this section.

    For the most part, your virtual cockpit will be made up of existing parts from your LOD_100. Thus, I recommend that you first finish building the external portions of your model and then map those textures. Once this is done, it will be very easy to clone any needed parts and to add them into your virtual cockpit.

    To make things simple, I'll describe this process through a quasi-tutorial. I will assume that you have finished building all of the required parts for your LOD_100. Let's assume that you're building a tank.

    1. Clone the object at the top of your vehicle's hierarchy. Earlier on, we had called this object MyVehicle. Name the clone cockpits and link it to MyVehicle.

    2. Clone the object MyVehicle again, but this time name it cockpit_virtual0. Link it to cockpits.

    3. Clone the object MyVehicle again, but this time name it eyepoint0. Link it to cockpit_virtual0. Place this object approximately where the crew commander's head would be if he were kneeling on top of the turret a bit back from the gun.

    4. Clone GUN0_L_R and name it as GUN0_L_R_1. Clone your turret and name it as TURRET_1. Link TURRET_1 to GUN0_L_R_1 and then link GUN0_L_R_1 to cockpit_virtual0. If you wish, you can also clone the physical gun objects and any other parts you wish, linking them in the same manner. Only include those parts that will be visible from within the virtual cockpit.


    Step 6: Damage Boxes
    CFS3 uses damage boxes to determine where to assign damage for incoming hits. Therefore, you must create a set of ordinary boxes to contain the various sections of your vehicle.

    Aircraft use a fairly involved set of damage box names. However, vehicle and ships are much easier. Generally, you will create a box named Damagebox_Nose which you will stretch around the hull of your vehicle, approximating the total volume of the vehicle. If you like, you can add a second damage box named Damagebox_Nose_0 and size it to match the turret. Link Damagebox_Nose_0 to Damagebox_Nose and then link Damagebox_Nose to the top node in your hierarchy, MyVehicle. A few notes worth mentioning:

    • Damage boxes must be perfectly rectangular, otherwise they will not work properly.
    • What you see in gmax isn't always what you get in CFS3. Start CFS3 with the -m3dview switch at the end of the shortcut. This will open up the model viewer which allows you to see where CFS3 thinks the damage boxes are placed.

    Step 7: Emitters
    Yippee! More dummy boxes! These objects will control the emission of smoke, steam, and other evidence of damage. When your vehicle is hit, the damage system will instruct the appropriate emitter to belch forth. Notwithstanding the work that is yet to be done in the XDP file, creating the emitters is simple enough.

    Refer to the XDP file of any AvHistory vehicle for a list of typical emitters. Note that the name of the dummy object must match the name in the XDP file. Also, effects are oriented according to the pivot point of the dummy object. Commonly used emitters include:

     

    Emitter Name

    Comments

    Emitter_damage_nose

    Bits and pieces flying off.

    Emitter_damage_engine1

    Leaks and fires from the left engine

    Emitter_eng0_exh_l Displays exhaust on engine on startup.
    Emitter_eng0_exh_r Displays exhaust on engine on startup.

    Step 8: Hierarchy
    For all its glorious detail and graphical effects, my greatest frustration from CFS3 comes when frame rates start dropping to single digit levels. There's nothing like a stuttering computer to remind you that you're just jiggling a joystick and staring at a monitor. To achieve suspension of disbelief, you need to optimize your model so that it will perform well on a reasonably modern computer. The table below illustrate the various dummy nodes that are required to form an efficient hierachy.
     

    Node

    Comments

    MyVehicle

    This is the top node for your model.
      Cockpits
    All virtual cockpits link to here.
        cockpit_virtual0
    Virtual cockpit 0. All pieces in this VC link to here.
      Damagebox_nose
    Damageboxes either link to here or they link to a damagebox that links to here. Additional damage boxes can be named Damagebox_nose_0, Damagebox_nose_1, etc.
      Vhcl_Damaged
    All damaged versions of your vehicle should attach to this node.
        Vhcl_Damaged_LOD_10
    The leanest view of your damaged vehicle. Maximum faces / polygons 100. Often, this can be little more than a few boxes piled on top of each other. Very little detail is needed.
        Vhcl_Damaged_LOD_100
    The richest view of your damaged vehicle. Maximum faces / polygons 5,000 but fewer are better.TD>
      Vhcl_Normal
    All undamaged versions of your vehicle should attach to this node.
        Vhcl_Damaged_LOD_10
    The leanest view of your vehicle. Maximum faces / polygons 100. Often, this can be little more than a few boxes piled on top of each other. Very little detail is needed.
        Vhcl_Damaged_LOD_100
    The richest view of your vehicle. Maximum faces / polygons 5,000 but fewer are better.
     

    The vehicle that you are building is probably the LOD_100 version. However, you'll have to create simplified versions for the other levels of detail. This will entail cloning those parts that you want to include in the next lowest level of detail and then linking them to that LOD.

    Aircraft models typically include four or more LODs in order to improve game performance. However, vehicles can probably get by with LOD_100 and LOD_10 provided that LOD_100 is kept fairly lean (2,500). If your LOD_100 is rich then you'll want to create LOD_90 and LOD_50 25 versions with substantially less detail. LOD_10 will incorporate only the basic outline of the vehicle. Here are a few other tricks that will help you keep your LOD_10 model lean and efficient:

    • Place a pair of 6-sided or 8-sided cyclinders next to your hull to act as a combination of tracks and suspension. The critical features can simply be painted on.
    • Omit small items like antennae, cannons, hatches, and such. These are invisible at long distances.
    • For the hull, don't try to copy all of the curves. Instead, just try to match the major faces. For the most part, a rectangular box or two should suffice.


    Step 9: Texture Design
    Before you begin painting your vehicle, you'll need to create a wireframe diagram of its pieces. Once you've created the wireframe diagram, you'll simply paint over top of it - the wireframe will help you judge where the hull ends, for example. Remember to keep a copy of the unpainted wireframe handy, just in case somebody wants to do a repaint of one of your models.

    The simplest way to create a wireframe diagram is to take a bunch of screenshots of each of your parts. You'll need top and bottom screenshots for the wings, left and right shots for the fuselage, and so forth. For each screenshot, you'll press "Prnt Scrn" and then paste into your graphics program. Next, you'll clean up the screenshots by removing the background colour so that you're left with a bunch of wireframe mesh.

    Generally, the screenshots of your external parts should all be proportionately sized. The easiest way to maintain proportionality between separate screenshots is to capture them all from the same viewport but without changing scale or zooming in between screen captures.

    A few points to bear in mind:

    1. Wirefreame files must be square and binary-sized. The most common size is 1024x1024. Some vehicles will fit comfortable onto 512x512.
    2. Capture separate views of the top/front/side of major parts.
    3. Arrange the parts on the file so as to use the fewest files possible. Look at other DDS files for ideas.
    4. All pieces should be mapped to a single file called MyVehicle_Normal.bmp. You'll make a duplicate of this sheet called MyVehicle_Damaged.bmp as well to handle damaged textures.

    Before you begin painting, jump to the next step to apply the wireframe images to your model.

    From here on in, it's just a matter of painting all of the parts so that they look right to you. Save your wireframe original somewhere safe and make a new copy to do the actual painting. When painting, remember to leave a bit of overlap at the edges.

    For a good tutorial on the whole screen capture process, see Hugh Shoult's "The Stupid Idiots' Guide to starting with gmax" at http://www.simviation.com/gryphon/tutorials/gMax_00.htm.


    Step 10: Texture Mapping
    Now that you've created your wireframe bitmaps, it's just a matter of applying them to the parts. First, you'll create textures within gmax (which are just combinations of bitmaps and settings, like opacity). Use the Material Navigator as directed below.

    To create a texture in gmax, open the Material Editor. Click New, click the box next to Diffuse, click Bitmap, click Open, and select your bitmap. For exterior textures, you will also want to add a Specular Level which will be your 's' bitmap. You'll also want to click the tiny blue buttom that says 'Show Map in Viewport', which lets you see your bitmap in gmax - eventually. Close the Material Editor.

    By the way, the editor won't usually let you rename a texture when you first create it, so just configure it, save it, close the window, and then open it again to rename it. If you mess up the configuration, just delete the material and start over.

    1. Damaged: Diffuse = MyVehicle_Damaged.bmp
    2. Normal: Diffuse = MyVehicle_Normal.bmp

    Applying textures is the next and final step. When it comes to texturing, gmax thinks of this as holding a bitmap over top of an object and then letting the pixels 'project' onto the part. In doing so, it will let you make the image larger or smaller and move it around and rotate it as well. Let's take this process one step at a time.

    Step 1 - Apply the Texture
    Click on the part, select the Material Navigator, find the right texture, click on it to open the Material Editor, and then click 'Apply'. This will assign the texture to that part. If you like, select several parts and assign them the same texture at once.

    Step 2 - Add a Poly Select Modifier
    Whether your part is a shape (e.g. box), a mesh object, a poly object, or whatever, you should add a Poly Select modifer to the stock. This will allow you to select all or part of the polygons to be textured. You don't have to add a Poly Select but if you don't include one then the entire part will be textured automatically. Don't worry if you're part looks untextured. We'll get there in a moment.

    Once you've added the Poly Select, open the roll-down and select 'Polygon'. Then, you can either fence the entire object to select all of the polygons or you can just pick-and-click the polygons that you want to be textured.

    Step 2 - Add a UVW Map Modifier
    This is the modifier that makes things start to appear. The UVW controls the size and projection origin (i.e. from left, from top, from back) of your image. Unfortunately, you'll need to do a little math to get everything to show up correctly. Remember how I recommended that you take screen captures of parts using the same window? We did that so that many of your parts would share the same proportional sizing. It also means that they'll be able to use the same UVW Map parameters. In short, the more parts that you captured from the same viewport (without changing scale or zooming), the fewer calculations you'll need to do!

    Here's how you do the math.

    1. You probably used the same viewport to capture most of your exterior parts. So you only need to measure one part. Pick something big, like the length of the entire length of the hull. (This is just the distance along the Y axis. You don't need to calculate the hypoteneuse!) Let's call this Part Length and let's assume that Part Length = 9.25 meters.
    2. Quick, how big is your bitmap? It's probably 1024x1024, right? Let's call this Bitmap Size and let's assume that Bitmap Size = 1024.
    3. Lastly, open up your bitmap and measure the length in pixels of your part. However, bitmaps are funny things in that the bitmap lines are much thicker than your lines in gmax. To compensate, count the length in pixels and then subtract one. Basically, we're assuming that only have of the bitmap lines will hit our parts. We can also adjust this later. Let's call this Part Bitmap Length and let's assume that Part Bitmap Length = 748.
    4. The number to enter in the 'Length' and 'Width' windows of the UVW Map = Bitmap Size / Part Bitmap Length * Part Length. In this case, 1024 / 748 * 9.25 = 12.663. Enter 12.663 in each of the windows.

    At this point, you may see something but it probably won't look quite right. Fiddle with the 'Alignment' section of the UVW Map modifier until you see a big orange box surrounding your object. You only have three choices, X, Y, and Z.

    Step 3 - Add an Unwrap UVW Modifier
    This modifier will allow you to line up the part with the proper section of the bitmap. After you've added it, click on 'Edit' down below. You'll see your bitmap and a ghostly white wireframe of your part. Use your mouse to fence the part and then slide it and rotate it until it lines up properly with its section of the bitmap. Zoom in to make sure that it is aligned correctly.

    If you've calculated your UVW coordinates correctly, then the part will precisely match the size of the wireframe part. If you need to adjust things, just go back and edit the UVW Map coordinates. Also, make a note of the correct numbers as you will likely use them for other parts.

    That's pretty much it. Once you've mapped some of the polygons of a particular part, you can add another Poly Select, another UVW Map, and another Unwrap UVW to map some other parts. It's not unheard of to see stacks of ten or more modifers for a single part.

    For a good tutorial on basic texturing, get Milan Lisner's "gmax Texturing Tutorials Part 2". You'll find it at http://www.freeflightdesign.com/tutorials.html.


    Step 11: Exporting to CFS3
    It doesn't take much to export your vehicle to CFS3. Before you do, I recommend that you save your current version. Ensure that the vehicle when viewed from the TOP view has the nose pointing up. Then, select File and Export. Keep the name of the model short but descriptive.

    Before you do your export, you will need to create Damaged versions of your vehicle. You can do this very quickly simply by mass-cloning your entire LOD_100 vehicle and linking the cloned hierarchy to Vhcl_Damaged_LOD_100. You'll also want to reassign the texture for these parts to the Damaged material. However, you won't need to re-do all of the texture mapping. Do the same for LOD_10.

    Two warnings will often appear during exports. The first relates to scaling. If you encounter these errors, just reset the scale for those parts on the Hierarchy menu, as we did in the tutorial. The second error relates to duplicate part names. In this case, you'll need to rename the parts.

    When you're in CFS3, perform as many checks as you can think of, paying particular attention to the rotation of wheels, gun flashes, and so forth. In addition, look closely at the textures you've applied. If they're distorted, then you may need to re-apply them.

    Non-Driveable Vehicles
    For these to operate, you must export the M3D file to a subdirectory of the Vehicles directory with the same name as the M3D file and the XDP. Take a glance at any of the existing vehicles and you'll immediately see the pattern. In addition, you'll need to modify the XDP file so that you have the right name, country, M3D file, number and type of guns, etc.

    Driveable Vehicles
    These are the same as aircraft. You must export the M3D file to a subdirectory of the Aircraft directory. See the GMAX Aircraft tutorial for more details. One piece of good news is that flight models are much simpler for vehicles than for aircraft. In particular, contact points pretty much work the same for one vehicle as for any other.


    Step 12: Test Driving
    Driveable vehicles can be tested in Quick Combat. Just remember that trees, buildings, and various other objects will probably destroy you. Non-driveable vehicles can be tested by including them in a mission.

    For my tests, I generally use a mission which includes an existing driveable vehicle. This allows me to weave amongst the models being tested. Also, I include a few enemy trucks to give them something to shoot at. Muzzle flashes will cofirm that the guns are working properly, and a few shots from my own vehicle's cannon will quickly confirm whether the damaged models are appearing correctly or not.


    In Conclusion
    You're done! That is, you're probably done reading this document. Congratulations to you if you've just finished building a vehicle!

    As this has been an overview, a lot of detail has been left out. This is an immense subject area and you could probe much further in any area. My goal has been to give you an overview of the entire process. Now that you can find your way into and out of the woods, you can explore the trees on your own.


    Bonus: Animated Tracks
    Microsoft's SDK recommends creating the illusion of moving tracks by swapping differently textured objects in and out. However, I have observed that this tends to create a most displeasing flickering motion which detracts from the vehicle's appearance. As a result, many designers equip their vehicles with smooth treads and leave things along.

    However, if you are patient, there is another method which I will teach. This method allows you to include actual moving tracks on your vehicle by using key frame animation. As noted earlier, this type of animation allows any object named key_frame_animation (or key_frame_animation_00, key_frame_animation_34, etc) to move along a defined path. In the steps below, I will outline the process so that you can try it for yourself. Beware, however, that creating animated tracks may require 4 hours or more of highly repetitive work!

    1. Set your Time Configuration to End time of 30. Key frame animations of this nature typically loop once every 30 frames so you must animate within this period. When we program the animations later on, you'll see that the animation steps will occur every three frames (0, 3, 6, 8, etc.)

    2. Create a single track piece on the left side of the vehicle. As a rule, I like these pieces to be 0.2 meters in length. However, if your tank has small track pieces you can simply butt two 0.1 meter pieces together. If you do the latter, you might also have them tilted 5 degrees so that they form a slight angle in the middle. Bearing in mind that each track piece will need to have ten animation programmed, the amount of work will increase with the number of track pieces. You can make the track piece as detailed as you wish but bear in mind the polygon limits of the vehicle.

    3. Rename your single track piece as "Ref_Track_00". Do not texture it yet! However, change its pivot point such that X is laterally in the middle, Y is longitudinally at the forward-most point along the "inside" Z edge, and Z is vertically along the top edge. Position this piece along the bottom of the track path near where the front of the track path touches the ground. For convenience, position it near a round Y position such as 1.45m or 1.60m or whatever.

    4. Clone your Ref_Track_00, noting that gmax will automatically increment the last two digits. Slide this piece one track length (0.2m if you followed my advice) to the rear. Keep cloning pieces and moving them rearward along the track path. When it comes time to pivot, try to move in 5-degree increments only. This will make it easier later on. Note that each track piece should butt up against the previous one. Keep cloning track pieces until you have looped completely around.

    5. Unless you are very lucky, you will probably end up overlapping your first and last track pieces by a bit. That's okay, although the more you can minimize the overlap the better. Whatever you do, don't leave any gaps.

    6. Clone Ref_Track_00, rename it as key_frame_animation_00, and change its colour to light yellow. Create two dummy objects called LEFT_TRACK and RIGHT_TRACK. Position both at Y=0, Z=0 and X= the lateral center of your track pieces. Attach all Ref_Track pieces to RIGHT_TRACK and change the colour of these tracks to dark blue. Attach key_frame_animation_00 to LEFT_TRACK. Move RIGHT_TRACK to its equivalent position so the reference tracks are where the right-hand side tracks would be. Most likely, if RIGHT_TRACK was at X=-1.1 then it will now be at X=+1.1. You should now have a complete set of dark blue tracks on the right-hand side of the vehicle and a single light yellow track piece on the left.

    7. Design Tip: If you want to include animated tracks in your lower LODs, you should instead create a dummy object named key_frame_animation_00 and then program your animations to this object (and its clones). This will involve more work, as you'll need to clone an equal number of track pieces (which you'll probably call something like TrackPiece_00) and attach each of those pieces to its respective key_frame_animation piece. The advantage of this method is that if you want to include animated tracks on lower LODs, you can create a greatly simplified track piece (a one-sided rectangle will do), clone the key_frame_animations, and then attach each of the simple track pieces instead. Again, this requires a lot more work but it provides great results while maintaining polygon efficiency.

    8. Apply a texture key_frame_animation_00 complete with UVW Map and Unwrap UVW. Note that you won't apply a texture if you're using the "dummy" approach. Instead, you'll texture your track pieces.

    9. Change to the Motion selection and create a Position key and a Rotation key at key frame 0.

    10. Now we're ready to clone key_frame_animation_00 to following the path of our reference track. Just as we did before, clone key_frame_animation_00 and move its clone rearward along the reference track path. Note that you need only enter the position coordinates (which you can get by clicking on appropriate reference track piece) and then rotate as need to match. Basically, you'll end up with a piece of light yellow key_frame_animation track on top of each background piece of dark blue reference track.

    11. With all the track pieces of place (you probably have between 50-60 of them) you are now ready to begin programming the animations. To keep track of things, when you start working on a piece, change it's colour to light blue. I should explain that we will move each track piece about 0.2m every three key frames. Thus, during the course of one 30-frame cycle (roughly one second), each track piece will move about 2 meters.

    12. Since your track pieces are about 0.2m long, each animation step (3 frames) will see each piece move one position along the track path. Add a new Position key and Rotation key at key frame 3. Now, go back and record the animation between key frame 0 and key frame 3, setting the position at key frame 3 equal to the position of the next track. Note that you can grab the coordinates simply by clicking on the reference track piece.

    13. Repeat the above process for key frame 6, again animating your track to move one more position along the track path. Repeat this process for key frames 9, 12, 15, 18, 21, 24, 27, and 30. Hey! I told you this was going to be a lot of work!

    14. Once you finished key_frame_animation_00 move on to the next piece, changing its colour to light blue so you can remember which pieces you have done. Animate its path in a similar fashion as you did for the first piece. When you test the animation, you should see both pieces moving along the track path one after the other like a little train. Save your work often and remember to view your work frequently to make sure that everything is running smoothly.

    15. When you've finished animating all of the tracks on the left-hand side, you can delete the reference tracks on the right-hand side. Then you can clone all of the animated left-hand tracks and position them on the right-hand side.

    16. On most vehicles, the tracks are too long for a single piece to move completely around the track. Thus, each piece will only move part way around the track path before returning to its original position. A minor side effect of this is that your animation will appear to stutter every 30 frames as the tracks reset themselves. It's not a perfect solution but it still provides a rewarding view.

    I hasten to add that the amount of detail on your model is suitable only for LOD_100. Therefore, it is CRITICAL that you build lower LODs with reduced levels of detail in order to make your model more efficient. By LOD_70 you will want to replace your detailed tracks with a much simpler, non-animated version. By LOD_50, a single cylinder can be used to capture all of your suspension detail; for texturing, include a screen capture of all the suspension detail in a single image so the painters can include one for you.