Converting cars to MW
Required programs:
1. NFSMW-Modtools (Download)
2. Zmodeler 1.0.7 (Download)
3. 3Ds Max or another program for working with 3D models, from
which export is possible to a format understood by Zmodeler.
4. Adobe Photoshop
5. DDS-plugin for Adobe Photoshop (Download)
Setup.
1. Install Zmodeler, Adobe Photoshop, 3Ds Max and all the necessary programs.
2. Install the DDS plugin for Adobe Photoshop.
3. Unpack NFSMW-Modtools into a separate folder.
The /bin/ folder contains all the main programs used to import new cars into NFS MW.
The /ferrari360/ folder contains the example files of the Ferrari Spider 360 car exported by Arushan.
The /zmodeler/ folder contains the filter for Zmodeler. It must be copied into the /Filters/ folder of the installed program.
Let's go through the programs in the /bin/ folder.
1. binTex - a program for viewing textures from the game's Textures.bin and Vynils.bin files.
It is mainly used to check the created files for functionality and to
replace textures.
2. vltedit - a program for "catching" the addresses that will then have to be patched.
3. The files mwgc.exe, mwtc.exe, texpatch.exe are used for the direct import of the
model into the game. Do not try to run them, they only work with command
line parameters.
The example contains the following files:
- 360badging.dds - a texture applied to the windows, it uses an alpha mask;
- 360misc.dds - the main Ferrari texture;
- 360tire.dds - the texture of the wheels and brakes;
mw360.mwr - a file with the car's geometry, fully ready for import into the game.
Most Wanted Raw (*.mwr) format. It is obtained by exporting the model from Zmodeler.matlist360.txt - the main file describing the model's materials;
texdefn.txt - the file that defines the model's textures;
xlink360.txt - defines the model's parts (hoods, bodies, etc.) and their quality
build.bat - the main file of the whole archive, after running it,
GEOMETRY.bin and TEXTURES.bin will appear in the /output/CARS_REPLACE/SL65/ folder
An explanation of the remaining files will come a bit later.
So, let's begin.
This article does not cover modeling in 3Ds Max; it outlines the main
stages of creating a car from a ready-made model.
The MW engine supports models consisting of more than 400000 polygons, and even more.
- Preparing the model.
In 3Ds Max, we split the ready-made model into parts: body, hood, headlights, headlight glass,
taillights, windshield, rear window, wheel, brakes.
It doesn't matter right now what they are named.
Now the materials.
a) for the body
b) for the interior
c) for the headlights
d) for the taillights
e) for the glass in the headlights
f) for the windshield
g) for the rear window
h) for the brakes
i) for the wheel
j) for the driver
k) for the bottom of the car
l) for the parts that will be filled with black (emptiness)
m) for the chrome parts
n) for the plastic parts
o) for the aluminum parts
p) for the license plate.
You should avoid creating a multimaterial; you can use as many textures as you
like, the main thing is that all parts are textured (excluding the driver and emptiness),
but the fewer of them, the better.
Also at this stage you need to prepare small geometric objects
that will mark the attachment points for the spoiler, headlights, brake lights,
reverse lights and the position of the exhaust outlets.
Now you should export the model to the *.3ds format.
- ZModeler
We load ZModeler, click File/Import, select the saved model.
Now you should rename the model's parts and materials.
Models:
- We name the main frame of the model kitXXbodyY, where XX is the body number
(00 - standard body, 01-05 - additional bodies), here and below
Y - model quality (A - the highest quality and in decreasing order of quality
B, C, D, E).
- Body glass baseY.
- Front headlights kitXXleftheadlightY (left), kitXXrightheadlightY (right).
- Front headlight glass kitXXleftheadlightglassY (left), kitXXrightheadlightglassY (right), where XX is the body number the headlight belongs to (usually this is 00).
- Rear headlights are the same as the front ones, the only thing we change is headlight to brakelight.
- Car driver kit00drivera, interior kit00interiora.
- Windshield kit00frontwindowa
- Wheel kit00fronttirea
- Brake disc kit00frontbrakea
Light, smoke and fire.
Now we've gotten to our mini point objects, i.e. points for the lights, exhaust,
tuning attachment points.
We rename the points:
LEFTREVERSE, #RIGHTREVERSE - white color when driving backwards, where LEFT and RIGHT are the
position relative to the axis of symmetry (left or right).
LEFTBRAKELIGHT, #RIGHTBRAKELIGHT - brake lights.
LEFTHEADLIGHT, #RIGHTHEADLIGHT - front light.
LEFTEXHAUST, #RIGHTEXHAUST - smoke from the pipes and fire when using nitrous
oxide, in general everything that comes out of the exhaust pipe.
SPOILER - spoiler attachment point.
ROOF_SCOOP - attachment point for air intakes.
If the model has several brake lights, headlights, etc., the following
similar objects are named the same way, only [X] is added at the end, where X is
a number from 0 to infinity.
For example: #LEFTEXHAUST and #LEFTEXHAUST[0].
Now it's time for the materials.
Click the "E" button, we see a window with a list.
We rename:
- body - BODY
- interior - INTERIOR
- headlights - LEFTHEADLIGHTBULB
- taillights - LEFTBRAKELIGHTBULB
- glass in the headlights - LEFTHEADLIGHTKIT00GLASS
- windshield - WINDOWFRONT
- rear window - WINDOWREAR
- brakes - BRAKEKIT00ROTOR
- wheel - TIREKIT00THREAD
- driver - DRIVERPLAYER
- bottom of the car - BOTTOM
- emptiness parts - BODYPLAINNOTHING
- chrome parts - BODYCHROME
- plastic parts - BODYDULLPLASTIC
- aluminum parts - BODYALUMINUM
- license plate - LICENSEPLATE
Next you need to get the model in the *.mwr format. To do this, click File/Export,
select the *.mwr format, save the file.
Now drop it into the folder where build.bat is located.
- Texturing
Open the texdefn.txt file with Notepad.
The first block of the file, starting with the words [tpk] and up to the first [texture], is used
to define the save folder for the texture file, the name of the car to
replace and a number of other parameters. We write:
[tpk]
Identifier=CARTEXTURES - a standard string, indicates belonging to
texture files
PipelinePath=Global/Pipeline/CarTemplateTexturescarname.tpk - specifies
a file in *.tpk format that will be packed into Textures.bin; instead of
carname specify the car name from the game (corresponds to the name of the
car folder from the game directory /Cars/)
XName=carname - a string required for compiling textures and
displaying them correctly in the game; carname must be the same as
in the line above
Output=output/CARSREPLACE/car_name/TEXTURES.BIN - specifies the folder
for saving the TEXTURES.BIN file
Next follows a section describing textures, consisting of blocks.
It looks like this:
[texture]
Name=in-gametexturename - can be INTERIOR, BADGING, MISC, TIRE, BADGINGN, TIREN and SKINx, where x> is a number from 1 to 4. Do not specify too long file names (max.length=23-lengthofcarname)
File=texturename.dds - the file that will be inserted into the TEXTURES.BIN archive under the name Name=in-gametexture_name. Here you specify the name of the texture file, which must be located in the same folder as the texdefn.txt file
It should be noted that a new section must be created for each new texture.
The next file is matlist360.txt.
It consists of lines like:
materialnameinZModeler (you won't have to change it if you renamed as described above) = shader/xin-gametexturenamefromtexdefn.txt
Example line for an interior texture:
INTERIOR=INTERIOR/x_INTERIOR
You must assign the texture from the texdefn.txt file to all materials.
Main shaders used in the game:
0xD6D6080A - car paint shader
BOTTOM - car underbody shader
BRAKEDISC - brake disc and caliper shader
BRAKELIGHT - brake light shader
HEADLIGHTREFLECTOR - headlight shader
MAGSILVER - wheel rim shader
CHROME - chrome
WINDSHIELD - glass shader
DRIVER - driver
DULLPLASTIC - two-sided plastic shader
RUBBER - tire shader
PLAINNOTHING - empty shader, fills the area with black color
These parameters do not need to be changed.
P.S. For textures that will be located behind transparent surfaces, DXT1 compression should be used for the *.dds format (selected in the save settings in Photoshop).
- Conversion.
Now that we already have the car model ready, its textures, and the files
texdefn.txt and matlist360.txt configured, we can proceed to import the model into the game format.
For this, the build.bat file is used, which is opened with regular Notepad.
It contains the main conversion parameters.
Abbreviations adopted for convenience of description:
NAME – the name of the car you are replacing with
CARNAME – the name of the car you are replacing
N – the number must be greater than 34
Carmodel - the name of the model file in *.mwr format
Open the build.bat file:
echo off
echo ==================================================
echo Compiling Textures...
echo ==================================================
../bin/mwtc.exe texdefn.txt
../bin/expatch output/FRONTEND/MANUFACTURERS/N-NAME.BIN "CARSELECTMANUFACTURERNAME"
../bin/expatch output/CARSREPLACE/CARNAME/SECONDARYLOGO.BIN "SECONDARYLOGOCARNAME1"
echo.
echo ==================================================
echo Compiling Model...
echo ==================================================
../bin/mwgc -nowait -xname "CARNAME" -matlist "matlist360.txt" -xlink "xlink360.txt" -source "Carmodel.mwr" -target "output/CARSREPLACE/CARNAME/GEOMETRY.BIN"
echo.
echo ==================================================
echo Complete.
echo ==================================================
pause
That's it, the model is ready to use; all that's left is to configure the wheels, logo and car name.
Car logo.
Copy the files FEATTRIB.bin, attributes.bin, gameplay.bin from the /GLOBAL/ folder of the game to the /bin/vltedit folder, run unpackall.bat, then run vltedit.exe, click File/Open and load the 2 files db.vlt and frontend.vlt from the vlt directory located in the same place as the unpacked program.
Now for the hardest part. In the tree, look for Database/frontend/vehicles.
There are three departments: europe, northamerica, japan. Each of them characterizes the place where the car is manufactured.
Example:
the path to it is Database/frontend/vehicles/europe/mercedes/sl65.
Click on sl65; a bunch of various parameters appeared in the window on the right, but we only need two - manufacturer and requiredbllevel, or more precisely their values.
When clicking on manufacturer we get the value bin:0x8954.
The same with requiredbllevel.
Let's go to the output/CARS_REPLACE/SL65 directory and open the FE.MWPS file with Notepad
manufacturer
patch dword manufacturer_value N, where N is the prefix in the name of the file with the manufacturer's logo.
requiredbllevel
patch byte requiredbllevel_value 16
Example for SL65:
manufacturer
patch dword bin:0x8954 32
requiredbllevel
patch byte bin:0x896d 16
The next file is CAR.INI in the same folder
[car]
name=the name that will be shown in the game. You can write in Russian (tested with the installed Russian localization from SerGEAnt's Zone Of Games v 1.08)
manufacturer=NAME
internal=CAR_NAME
modloader=0.2
In the following files you need to replace the textures with your own.
File SECONDARYLOGO.BIN - the logo of the car series.
Open this file with binTex, click on the only texture, then click Texture/Import and specify the file with your own texture in *.dds format.
File in the output/FRONTEND/MANUFACTURERS folder - the manufacturer company logo.
Name - N-NAME.BIN
Example:
32-FERRARI.BIN
Decals.
I will describe the creation step by step. So:
1) Parts are created with the names
decalrearwindowwidemediuma - for the rear window,
decalfrontwindowwidemediuma - for the front window,
kit00decalrightdoorrectmediuma - decal block for the right door, includes sticker slots 1-6 + a separate one for number stickers,
kit00decalleftdoorrectmediuma - same for the left door,
kit00decalrightquarterrectmediuma - for the right rear quarter,
kit00decalleftquarterrectmediuma - for the left quarter
2) You need to apply 8 materials to them:
а) for the front and rear windows, rear quarters and the first slot on the doors;
б) for the second slot on the doors;
в) for the third slot on the doors;
and so on...
3) Next, the matlist360.txt file. Open it and add the following:
DECAL1 = DECAL/DUMMYDECAL1 - material for the front and rear windows, rear quarters and the first slot on the doors;
DECAL2 = DECAL/DUMMYDECAL2 - for the second slot on the doors and further down the list similarly;
DECAL3 = DECAL/DUMMYDECAL3
DECAL4 = DECAL/DUMMYDECAL4
DECAL5 = DECAL/DUMMYDECAL5
DECAL6 = DECAL/DUMMYDECAL6
DECAL7 = DECAL/DUMMYNUMBERRIGHT - material for the right part of the number sticker;
DECAL8 = DECAL/DUMMYNUMBERLEFT - material for the left part of the number sticker;
4) No textures need to be added (they are already specified in the TEXTURES.BIN file in the game's CARS folder under the names DUMMY_DECAL1, etc.)
Window tinting.
When creating a model, it is sometimes necessary to tint the windows of a not-yet-tuned model. This is done as follows:
create a separate material for the tinted glass, specify it in the matlist360.txt file. To apply the tint, you need to replace the standard glass shader WINDSHIELD with this WINDSHIELDTINTLx_y, where x is a number from 1 to 3 (tint type), and y is the color. Its possible values: BLACK, GREEN, MBLACK, MBLUE, MGREEN, MRED, AQUA, BLUE, GOLD, GRAPE, LAVENDER, LIME, ORANGE, PINK, RED, YELLOW. Keep in mind that the first tint level does not have some colors that are available on the 2nd and 3rd levels and vice versa.
- Wheel setup.
That's it, all files are assembled, everything is set up for the conversion.
Double-click build.bat and the model is ready.
Drop the files into the required folder, launch the game. And what do we see? The model looks fine, but there is one "but": the wheels are not in their proper place.
Fixing it...
Launch the already familiar vltedit.exe. This time we go to ecar/default/racers/carname. Here we need the wheelposition* parameter, open the list, we see four values for the four wheels respectively.
Click on the first one, get the value, do the same for the rest. Next, open the ATTRIBUTES.MWPS file in Notepad
Its main purpose is to configure various car parameters. But right now we need the wheels...
To configure just the wheels, the file should look something like this (comments are after the # symbols, they are ignored when the file is read):
memfile GLOBAL/GlobalMemoryFile.bin
vpak GLOBAL/ATTRIBUTES.BIN db
wheel position
in the format x,y,z,w (z=0, w=wheel size/car height?)
patch float bin:0x3f7f0 1.28
patch float bin:0x3f7f4 0.8
patch float bin:0x3f7f8 0.0
patch float bin:0x3f7fc 0.30
patch float bin:0x3f800 1.28
patch float bin:0x3f804 -0.8
patch float bin:0x3f808 0.0
patch float bin:0x3f80c 0.30
patch float bin:0x3f810 -1.311
patch float bin:0x3f814 -0.8
patch float bin:0x3f818 0.0
patch float bin:0x3f81c 0.30
patch float bin:0x3f820 -1.311
patch float bin:0x3f824 0.8
patch float bin:0x3f828 0.0
patch float bin:0x3f82c 0.30
As we can see, each wheel has four parameters, but we only have one. To get the rest, we do this.
Example:
We got, for example, the address bin:0x3da60 (one of the wheels of the Lamborgini Gallardo).
We write the rest in this format 0x3da6x (where x is 4, 8 or c respectively for the y, z, w coordinate).
In full it will look like this:
patch float bin:0x3da60 1.28
patch float bin:0x3da64 0.8
patch float bin:0x3da68 0.0
patch float bin:0x3da6c 0.30
The same for the other wheels. When everything is ready, save the file to the folder with the model and textures. Then drop everything where it belongs and admire the result. :)
If something is wrong, fix it.
P.S. It is recommended to leave the z parameter as it is, i.e. as zeros.
- Additionally
Camera setup.
There are cases when you need to change the position of the camera behind the car (for example, when due to the car's dimensions the road ahead is not visible. P.S. These addresses are only for cars not related to traffic). This is done as follows:
1) Open the ATTRIBUTES.MWPS file of the car being created;
2) Add these lines:
close_cam - camera 3, close behind patch float bin:0x2b078 2.1 ##camera height - these parameters can be changed
patch float bin:0x2b07c 2.1
far_cam - camera 4, far behind patch float bin:0x2b168 2.2
patch float bin:0x2b16c 2.2
When adding such a "feature", keep in mind that all cars will have the camera in the set position.