Region4
   
   
   
     
     
  MODEL SETUP
 

 

This is where you begin: creating an CARS! model of your car. It'll take some time the first time around, depending on your modeling experience. The second time you'll notice that there really isn't much to it.

You'll be working on the template model. Your meshes go in there, not the other way around. I've tried to show a clear picture of how the model is built in the included Max projects, so use them.

If you don't have or use 3ds Max, Maya also has (better updated) support by the NifTools plugin. So does Blender, although I'm not sure on how well it imports Max projects.

titlepic
  PREPARING YOUR MESHES
 
Your custom car meshes need to be formatted correctly before inserting them into the template file. Any collision shapes can be thrown out as you will be building the collision from scratch.

The included Max projects can be used as a starting point, or just as guiding examples to play with.

  • Center the car body mesh(es) on x and y axis and put the car bottom on the XY plane
  • Seperate the front and rear lighting parts from the body in two individual meshes
  • Put your wheel mesh perfectly centered on all axes
  • You should now have a (group of) car body mesh(es), a front lights mesh, a rear lights mesh and a (group of) wheel mesh(es)
  • Export the meshes in NIF format as a BSFadeNode
     
     

 

fig.1 Body meshes
fig.2 Seperate wheel and lighting meshes

fig.4 Export settings
fig.3 Body positioning
fig.5 Exported NIF
  INSERTING YOUR MESHES
 
Except for the wheel meshes, all visible elements in reside under the CarVisElements node in the NIF model. Following these instructions accurately will save you from headaches later on. If you include your own animations, be sure not to modify any of the existing ones as they're matched to the XRE scripts to provide lighting and license plate display.

  • Open the template NIF model in NifSkope and disable Havok display in the menu for now
  • Put your car body meshes in the CarVisElements node, remove the template CarBody mesh
  • Replace the NiTriStripsData from the front and rear light meshes in CarVisElements/LightsNode/ with the ones from your own. Do not replace the entire NiTriStrips or you'll have to repair their associated animation sequences
  • Insert four copies of your wheel mesh and use them to replace the template wheel meshes. Their parent WheelNode nodes are found in the SystemBase node tree. Don't reposition them yet.
  • You can reposition the existing fuel tank mesh or replace it with your own. It shouldn't be placed higher than about 75 units or the CARS! refuel robot arm won't reach it.
  • Move LicensePlate1Node and LicensePlate2Node to reposition the license plates.
  • Fix the texturing and shading on your meshes
     
     

fig.6 Template NIF
fig.7 Replaced meshes

  POSITIONING THE WHEELS
 
Make sure you move the correct nodes to avoid messing up the steering mechanics.

  • Position the wheels by moving the following nodes:
         FRONT WHEELS
        - FrontWheelslNode on Y and Z axis
        - WheelLeftSuspendedBodyConnect on X axis
        - WheelRightSuspendedBodyConnect on X axis
         REAR WHEELS
        - RearWheelslNode on Y and Z axis
        - RearLeftWheelConnect on X axis
        - RearRightWheelConnect on X axis
    • Check for proper symmetry
    • The exact vertical placement needs live experimentation and depends on how the car is parametered later, for now put their centers just below zero
    • The standard template suspension allows the wheels a 28 unit range of vertical movement
    • When the wheels are in place, the affected constraints need to be updated. Unfortunately there is no handy button to do them all at once so you'll have to do so manually. It's safest to just do all 24 of them. Tedious, yes. Updating constraints is done by right-clicking on them in the blocklist, choose Havok, then A->B.

    Note that you need to repeat the manual Havok updates every time you move anything that contains constrained collision bodies. Which is about everything in the CARS! model except the CarVisElements.


    fig.8 Moving wheel pairs on Y and Z axis
    fig.9 Move individual wheels on X axis

    fig.10 Updating Havok constraints
      BUILDING COLLISION SHAPES
     
    Although more time consuming than just generating a mesh type collision body, all of the collision has to be built from convex shapes. Convex shapes are handled much better by performance-optimized physics engines like the one in Falout, and are more resistant to overlaps since they have a discrete 'inside'. Cars with mesh-type collision will often get stuck on other objects in the game.

    The shapes are first built as meshes and then converted to convex shapes. The body shapes in the template Max project are a good examples to follow.

    Notice the red box branded System Designated Area. This is not an actual part but defines the region where the drive and steer force transfers take place, which must be kept clear of overlapping collision. Body shapes have to be built around it.

    CAR BODY
    • Study the collision shape groups in the template and Carnivore Max projects
    • Build your body shapes
    • Adding a 'tank opening' is optional but recommended as it helps guiding the XRE robot fuel arm nozzle
    • Softening corners on the bottom front and rear shapes improves driving on rough terrain
    • Export your meshes to NIF and open in Nifskope, turn on Havok display in the menu
    • Right click on the first mesh (NiTriStrips) and choose Havok then Create Convex Shape. A bhkCollisionObject apears, copy the bhkConvexVerticesShape from the bhkRigidBody and paste it into your working template NIF. Repeat with all other meshes
    • You now have a collection of convex shapes on the bottom of your working NIF block list. Remove the existing shapes from the bhkListShape in the root collision node and replace with the new ones
    WHEELS
    • Center both your wheel mesh and the WheelConvexShape in the template Max project on all axes
    • Resize the WheelConvexShape to tightly enclose your wheel mesh
    • Export the WheelConvexShape to NIF and open in NifSkope
    • Create a convex shape from the mesh the same way you did with the body shapes, with the roundoff error value set to 0.1
    • Select the bhkConvexVerticesShape, change the material to 'rubber' and place four copies of it in your working model NIF
    • Replace the existing template wheel shapes with the new ones
       

    fig.11 Building the body collision shapes

    fig.12 Matching the wheel collision shape
    fig.13 Tank opening

       
       
       

    (c) Ermeso 2013

     

    contact