World Racing

The following document was originally written by Ortwin (see http://ortwin1st.de/wr/cartut.htm), and translated (well, sort of) by me (david@kabelverhau.ch). Unfortunately my english is not that good and I never did the things Ortwin described, so there may be one or another point which is not clear any more. Sorry for that.


Within this documentation I'll explain how the cars in WorldRacing are being constructed and what you have to be aware of when creating them. I won't give an introduction into 3D modelling programs. I assume that you have some experience in creating 3D models.
This manual is based on my knowledge. If some things are missing, please send me an
email. I always like to hear your suggestions or problems you may run into.

Overview:

  1. Parts of a car
  2. Construction of the model file (mox)
  3. Splitting up the textures (ptx)
  4. Content of the material library (mtl)
  5. Settings a configuration file (car)

Parts of a car
A car in WorldRacing always consists of several mox-, ptx, mtl- and one car file. The directory paths are always relative to the directory where WorldRacing is installed. Directories/files that are written bold are necessary

.\Autos\car_name
  car_name.mox Contains the car model without wheels, driver and steering whee.
  car_name.mtl Contains the materials corresponding to the model file with the same name
  car_name_colli.cob A transparent model with few polygons which gives the game information about the shape and size of the car
  car_name_ldt.mox A model of the car with fewer details which is shown if the car is further away. This increases the frame rates, because less computation needs to be done
  car_name_ldt.mtl Contains the materials for the corresponding model file
  car_name_r_hl.mox Contains the model of the left rear wheel
  car_name_r_hl.mtl Contains the corresponding materials
  car_name_r_hr.mox Contains the model of the right rear wheel
  car_name_r_hr.mtl Contains the corresponding materials
  car_name_r_vl.mox Contains the model of the left front wheel
  car_name_r_vl.mtl Contains the corresponding materials
  car_name_r_vr.mox Contains the model of the right front wheel
  car_name_r_vr.mtl Contains the corresponding materials
  car_name_r_hl_ldt.mox Contains the low polygon model of the left rear wheel
  car_name_r_hl_ldt.mtl Contains the corresponding materials
  car_name_r_hr_ldt.mox Contains the low polygon model of the right rear wheel
  car_name_r_hr_ldt.mtl Contains the corresponding materials
  car_name_r_vl_ldt.mox Contains the low polygon model of the left front wheel
  car_name_r_vl_ldt.mtl Contains the corresponding materials
  car_name_r_vr_ldt.mox Contains the low polygon model of the right front wheel
  car_name_r_vr_ldt.mtl Contains the corresponding materials
.\Autos\car_name\Textures
  Contains all the textures in ptx format needed for the car model including the wheels
.\Autos\car_name\Driver
  Contains the 10 driver models. These can be copied from the other cars, but the file name needs to be changed to match your car's file names
.\Autos\car_name\Driver\Textures
  Contains all the textures for the drivers and the steering wheel which they have in their hands
.\Autos\car_name\cpit
  Contains the files for the interior of the car. This is only needed if you want to use the interior view in the game
.\Autos\car_name\cipt\Textures
  Contains the textures for the car's interior
.\WR-EditCars\car_name
  car_name.car This file contains the physical properties of the car and the cordinates for the wheels, the driver and camera positions. If this file is missing then your car won't show up in WR


Construction of the model file (mox)
A model within a mox file is constructed of polygons, which are connected by vertices. It is important that any vertex is a part of a polygon, because otherwise some graphic cards are not able to show the model. If the model should be converted via the 3ds format to lwo format, then every vertex should have only one texture coordinate to avoid sharp edges on the surface. All the polygons have a surface id, which allows us to assign materials to a polygon from the materials library.
Each of these numbered surfaces has their own id. Later we'll assign their color and properties whithin the material library. It does not matter how scattered they are. The borders of the different surfaces need to be separated, otherwise WR will crash when loading the model. For instance the polygons with id 5 need to be moveable independently from the polygons with id 1. Smoothdata seems not to be supported, so you should also separate these surfaces at the borders.
The convert the model to the mox format used by WR, you first have to convert it to a lwo file. Then you can convert it to mox using Kroms MeshToolKit.


Splitting up the textures (ptx)
The textures for WR need an edge length of 2n pixels. All parts that need a texture (headlights, brake lights, cockpit instruments etc.) should have their own tga or bmp texture file. It is possible to assign an alpha channel to each texture file that has the same size as the texture. There are four ways to use the alpha channel; which of them WR chooses is defined in the material library.

  1. Black is transparent, grey semi-transparent, white visible
  2. Black is transparent, grey semi-transparent, white visible. Visible parts get a gloss (?) effect
  3. Black gets colored, grey only partially, white keeps the original color
  4. Black gets colored, grey only paritally, white keeps the original color. Visible parts get a gloss effect
The tga or bmp files can be imported using Kroms PTX-Tool, which allows you to save it to the needed ptx format.


Content of the material library (mtl)
In the material library, which belongs to each mox file, you can set the properties of each surface id. You can edit it using any text editor or the MeshToolKit.
  1. Allows choosing the color to be edited
    "Set Colors to Current" uses the current settings for all available colors
    "Set Colors to Default Body Colors" restores the default colors
  2. Using these three sliders you can generate the car's color from the three base colors
  3. Ambient sets the luminance of this material. Applies to all colors
  4. The gloss color (?) can be set here. It simulates the reflected light on the surface of the car
  5. The second gloss color simulates a larger reflection surface (?)
  6. The intensity of the environment mapping can be adjusted for all colors together
  7. You can set the transparency of glass independent of the color
  8. This field contains the file name with the extension .tga, despite that the files are in the ptx format. If you don't use a texture you still have to enter .tga
  9. Here you can set for the u and v direction what should happen if the texture coordinates go over the edge of the texture


  1. If there is a texture, you can set its effects here:
    1. No texture
    2. Transparency
    3. Transparency with gloss
    4. Color cover (?)
    5. Color cover without gloss
  2. With these options you can choose the use of the alpha channel. Some options do not care about the depth information (visibility of hidden objects).
    1. Do not render covered objects
    2. Render hidden objects
    3. Show objects which are marked black in the alpha channel
    4. Render covered objects
    5. Do not render covered objects



Settings in the configuration file (car)
You should not create a new configuration file, but rather copy and rename an existing one. With the EditCar tool written by Krom you can easily modify it. Within this file you have to set the name of the new car directory. If you want to use the convertible top, you'll have to create an entire second model and enter it's name into the second field. Also click the checkbox for the cabrio version.
To make the brake lights work, you need to set the correct surface id. This is the hexadecimal number + 1 from the material library of the main model in the decimal system.
The coordinates for the wheels, driver and cameras are all relative to the origin of the car's body.