This tutorial will show how to make the most basic of cars for TDR2000. For anything more complicated refer to the complete TDR2000 SDK Car documentation. This tutorial won't show you how to use 3DSMax, it will only show what is needed to create a car hierarchy and export the car into the game. General knowledge of 3DSMax is assumed and required.
The 3DSMax Coordinate system differs from SoftImage (which was used to develop TDR2000). All cars developed in 3DSMax must be constructed so that the Y Axis points upwards, the Z Axis points Forwards and the X axis points to the car drivers left. The units in 3DSMax convert to
1 unit = 1 meter in the game. Your average car is around 1.7 meters wide, 1.5 meters high and around 3 meters long.
Copy the TorusMaxExporter.dle file from the SDK Tools folder into your 3DSMax\Plugins folder and start up 3DSMax.
Create a car with the approximate center of mass at the world origin. For the example car I have used a simplified version of the Limey. Name the main car mesh chassis. The textures applied to the Car should be .TGA's and for this tutorial are named FRED.TGA and FRED_damaged.TGA. Assign FRED.tga to the chassis:
Create just 1 wheel and place it at the world origin. Name the wheel wheel_master.
Assign FRED_damaged.TGA to the wheel. When the wheel is rendered ingame it will use the proper FRED.TGA texture until it is damaged. The Damaged texture must be applied to an object in the hierarchy so that it is exported to the car PAK file by the plugin.
The Collision mesh should be very low poly and be as close to the shell shade of the car as possible. Name the collision mesh data_chassis.
You should now have a schematic view that looks like this (it's best to uncheck all the SHOW options in the schematic view setup so only the main objects are displayed):
And the scene with the wheel nulls should look something like this:
Because this car is so basic, only 2 pieces of userdata are required.
Open the properties box for the data_chassis collision mesh and paste in the following in the user defined section:
[CollisionData] //** // Car Collision Data userdata // Remember that all numbers are floats and need the decimal point //***** // Mass (kg) 1600.0 // xAxis inertial length auto // yAxis inertial length auto // zAxis inertial length auto // Bodies coefficient of restitution 0.005 // Center of mass 0.0 -0.3 0.3
Open the properties box for the chassis mesh and paste in the following in the user defined section:
// Deform with no detachment 6 // Softness F 0.5 // Crush type (unused, get rid of it) I 0 // Ease of detachment F 0.5 // Current damage F 0.0 // Texture damage level 1 texture pointer I 0 // Texture damage level 2 texture pointer I 0 // Threshhold for level 2 F 0.2 // Damage level 1 texture (undamaged) S "FRED" // Damage level 2 texture S "FRED_Damaged"
All the 3DSMax editing is complete. Now we just need to export the car and setup a few descriptor files to get the car running in game.
The TorusMaxExporter plug-in can be activated in one of two ways. Either by selecting Export... or Export Selected... from the File menu. It is recommended that you use the Export Selected method.
Create a Directory for your new car under the TDR2000/Assets/Cars Folder. In this case we'll call the car FRED so we create a new folder called FRED.
Select the MAIN_NULL of the car hierarchy and go to File->ExportSelected. Navigate to your TDR2000/Assets/Cars/FRED Folder and save the car as fred.pak. Make sure you alter the export filetype to a TDR2000 PAK.
The Exporter Dialogue box will appear. Just click OK and the car will be exported.
There are several files that need to be altered to enable your car to be selected in game.
Firstly edit TDR2000\Assets\Cars\Car_Descriptor.txt.
This file describes the basic properties of the cars and tells the game what descriptor file the car uses. Goto the very end of the file and add the following lines:
CAR NAME "FRED" DESCRIPTOR "FREDdescriptor.txt" STRENGTH 150 COST 1000 TYPE 2 DRIVER_TYPE 4 END
If you look at other cars in the file you will see what each setting effects.
They are basically as follows:
Now save and close this file.
Next edit TDR2000\Assets\Strings\UK\Car_Strings_UKzombie.txt.
Add the following lines to the END of the file. This file must have cars in the same order as car_descriptor.txt. The information in this file is used for displaying in the game. It doesn't affect the car handling at all.
CAR DISPLAY_NAME "FRED" DESCRIPTION "Top Speed: 200mph Kerb weight: 1.6 tons 0-60mph: 8.5 seconds Fred rocks your socks" DRIVER_NAME "FRED SMITH" DRIVER_SHORT_NAME "FRED" END
Save and close this file.
The easiest way to create the car descriptor files is to copy files from another car and rename them. Included in the TDR2000SDK/Examples folder is the descriptor files from the Limey car. Copy these files into the FRED folder and rename the Limey part to FRED.
You should have
Do a Search and replace and replace Limey for FRED. This will fix most of the text file differences. Some sections will still need altering.
Alter the hierarchy filenames so they are as follows:
// Hierarchy filename "FRED.hie" // Hierarchy filename "FRED.h"
Because this car is extremely basic we don't have any doors, or brakelights etc. Several section of the descriptor need to be removed.
Alter the brakelights, doors and Bonnets section of the descriptor so it reads as follows:
// Number of Brake lights 0 // Number of Doors (pivot nodes) 0 // Number of bonnets (pivot nodes) (this includes the front bonnet and the hatch at the back) 0
Also alter the Fire and smoke nulls section to read
// Engine fire and smoke nulls (0 to 4), the first one is the engine, the others are extras for wasted 0
For each of the 4 car wheels, the wheel master must be altered because the Limey has different wheels for front and back. Edit the Centered Hierarchy Node section for each wheel to read:
// Centered hierarchy node "FRED_WHEEL_MASTER"
In FRED_texturedescriptor.txt replace Limey with Fred, and Limey_damaged with fred_damaged. Assuming your car texture is named fred.tga and your damage texture is called fred_damaged.tga
Edit the line that reads
"limey_bend_data.dcol" and replace it with
"none". The car will then have no bend collision.
That's it! The car should now be perfectly drivable in the game.
When you're comfortable with this system you should then have a look at the included limey.max to see a more complicated car with detachable meshes, doors and other moving parts. You can Also read over the Function Curve Editing Documentation and alter the performance of your car. The 3DSMax File that resulted from this tutorial is also included as FRED.max.