Modding
Modding
In this article I'm collecting stuff that is specific to GTR Evo. Any new information is welcome and will be added by me together with the appropriate credit.
For additional information on car modding see the GTR2 Tutorial and FAQ, where lots of the following steps are described in more detail and with graphics. I will only describe the differences between GTR2 and Evo.
Credits: GTI-Heizer, KampferAs
GUI modding
How to add new car classes
• Check the list of existing car classes. If your cars fit into an already existing class, take note of the ClassID and short class name. If a new class is desired, pick a unique ClassID and class name and announce both in the above linked thread.
•Edit the ClassID and class name to the .car files, example:
Make="Ford"
Model="Capri RS3100"
classes="GTL_GTC76"
ClassID=66
If there are different models of the same make, they will be grouped together under the same manufacturer:
Make="Ford"
Model="Capri RS2600"
classes="GTL_GTC76"
ClassID=66
•Create Class Icons in UIData\Menu\Textures
Three icons per class are needed:
1.MenuButton_ClassSelect_GTL_GTC76_Disabled.tga
2.MenuButton_ClassSelect_GTL_GTC76_MouseOver.tga
3.MenuButton_ClassSelect_GTL_GTC76_Normal.tga
If more classes are defined than will fit on the default screen, all icons are scaled down appropriately to make room.
Car modding
Cockpit dials
The way how cockpit dials are treated is significantly different between older games like GTL or GTR2 and Evo. While in those games different material names are used to distinguish the different types of dials like speedometer, tachometer etc., in Evo all dials are placed on an additional new layer:
•Open the cockpit mesh in 3DSimEd
•Isolate the cockpit dials. Use material names to your advantage, i.e. press Ctrl-E and select all materials that are not related to cockpit dials (i.e. don't end on _cockpit). The result should look similar to this:
•Copy the special material cockpit_dial from a working GMT file of a car that has analog dials, for example the WTCC 87 Alfa (file is included in attached archive), paste the material into the isolated cockpit mesh from the previous step (Ctrl-Alt-V), and replace all old materials with the new cockpit_dial material (Shift-E). The result should look similar to this:
•translate the mesh so that it will be about 0.001m in front of the real cockpit (Y+0.001). Purge unused materials. Export as rFactor .gmt. Let's assume we name the file cockpit_dials.gmt.
•Remap UV coordinates to GameData\Teams\dial_bkg.tga (file is included in attached archive) using for example zmodeler2. Be sure to remap on the proper side of the mesh, otherwise all dials will rotate counter-clockwise. Make notes where you placed the individual dials, we need the coordinates later. Export as .gmt, import into 3DSimEd, export as GTR2 .gmt (this step is necessary because zmodeler2 exports to rF .gmt). A more detailed tutorial on how to do UV mapping is available at the zmodeler home page.
•Extract EvoMats.dat from EvoTools.zip
and open the file with a hex editor ( I use HxD) Select the material definition of cockpit_dial and press Ctrl-C to copy the data to the clipboard. Make sure that the status bar reads Block: 478-8EF! Now open your cockpit_dials.gmt with the Hex editor, select the material definition of cockpit_dial and paste the material definition from EvoMats.dat over by pressing Ctrl-V. Confirm that the file size will be different.
Note: If you make a mistake during this step, the game will crash while trying to load the car. Add cockpit_dials.gmt to the Cockpit section of .cas file.
Instance=COCKPIT
{
Moveable=True
<NOTSPIN><DASHHIGH> MeshFile=FORD_CAPRI_COCKPIT.gmt World=Near CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(5.0)
<NOTSPIN><DASHHIGH> MeshFile=FORD_CAPRI_cockpit_dials.gmt World=Near CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(5.0)
}
•Find the file NEEDLE_01.TGA, copy it as many times as we have dials in our cockpit (in the above example make 3 copies), and rename the files like this:
FORD_CAPRI_NEEDLE_OILPRESSURE.TGA
FORD_CAPRI_NEEDLE_SPEEDOMETER.TGA
FORD_CAPRI_NEEDLE_TACHOMETER.TGA
FORD_CAPRI_NEEDLE_WATERTEMP.TGA
•Open the .car file and edit the dial definition section, for example:
TachometerNeedle=( 63.0, 63.0,27.0,105.0)
SpeedometerNeedle=(188.0, 63.0,26.0,100.0)
OilPressureNeedle=(472.0, 29.0,12.0, 46.0)
WaterTempNeedle=( 398.0,109.0,15.0, 54.0)
TachometerRange=(1000.0, 10000.0, 148.0, 390.0)
SpeedometerRange=(20.0, 250.00, 223.0, 497.0)
OilPressureRange=(0.0, 62.72, 310.0, 410.0)
WaterTempRange=(86.0, 300.0, 310.0, 410.0)
The first four lines define where the needle is positioned using the pixel coordinates of dial_bkg.tga.
The first pair of numbers are the coordinates of the needle rotation point, the second pair is the scale factor of the needle in X- and Y-direction, i.e. the length and width of the needle.
Here is a list of the approximate center coordinates of the seven dials that are visible in dial_bkg.tga:
63.0,63.0
188.0,63.0
313.0,63.0
398.0,113.0
410.0,39.0
470.0,22.0
470.0,86.0
These coordinates can be used as a starting point.
The second four lines define the range of the dial values and their corresponding polar coordinates. Note that in Evo, zero degrees is at 12 o'clock! Most of the time, the dial range will continue clockwise over the 0 degree position. In this case, add 360 to the angle value, see the above examples.
Adjust the needle scaling and coordinates until your satisfied with the results. Unfortunately, the game has to be restarted in order to see any changes to the needle positions.
MOTEC
To make the simple GTL-type in-car Motec work in Evo, do the following:
•Add the following lines to the .car/.inccar file:
DigitalDisplays=1
Display1Instance=MOTEC
Display1RPMLights=1
Display1RPMLightsRange=(7500,8600)
Display1LapTimeHeadingParams=LARGE,LEFT
Display1LapTimeHeadingPos=(5,1)
Display1LapTImeParams=MEDIUM,RIGHT
Display1LapTimePos=(230,5)
•Add the following lines to the .cas file:
<NOTSPIN><DASHHIGH> Instance=MOTEC
<NOTSPIN><DASHHIGH> {
<NOTSPIN><DASHHIGH> Moveable=True
<NOTSPIN><DASHHIGH> MeshFile=LCDTIMER.gmt CollTarget=False HATTarget=False LODIn=(0.0) LODOut=(5.0) ShadowReceiver=True
<NOTSPIN><DASHHIGH> }
•Open LCDTIMER.gmt in zmodeler and remap UV coordinates of the Motec display vertices to the square in the upper left corner of MotecNL.tga from the attached archive.Export the file.
•Open the file in 3dSimEd, and export it to GTR2 file type.
•Open in HxD, copy the material definition of MOTECNL from Evomats.dat and paste over the respective bytes in LCDTIMER.gmt. Save and close the file.
Gearbox
Unfortunately, Race07 -- and therefore Evo -- only supports one final drive, which means that cars being converted from other games will be missing longer gears if there is more than one final drive defined in the .grb file.
The solution is to permute all gear ratios with all final ratios. I've written a small AWK-script that does all the math automatically: gb.awk in Evomats.zip.
Input is a .grb file, result is written to stdout. Usage running Cygwin would look like this:
gawk -f gb.awk old.grb > new.grb
Now the corresponding .hdc file needs some tweaking, otherwise the default gears will be much too short. In fact, every value after GearnSetting= has to be multiplied with the number of final gears the original gearbox had. (the gb.awk script writes this number as a comment in the new .grb file). Another little awk script does this automatically:
awk -v fin=3 -F "=" '{if ($1 ~ /^Gear[1-9]+Setting/) { print $1 "=" $2*fin } else print} ' old.hdc > new.hdc
Note the fin=3 statement, this specifies the number of final drives the old gearbox had.
CAS file
Evo does not support the following keywords :
<LOW>
<MED>
<HIGH>
<MAX>
Therefore, all lines containing these keywords have to be removed, except for all lines beginning with <MAX>. Those need to be carried over, sans the <MAX> statement.
Evo also has a slightly different usage of DEBRIS instances:
Instance=DEBRIS0 // HEADLIGHT LEFT
Instance=DEBRIS1 // HEADLIGHT RIGHT
Instance=DEBRIS2 // BRAKELIGHT LEFT
Instance=DEBRIS3 // BRAKELIGHT RIGHT
Instance=DEBRIS4 // REVERSE LIGHT
Instance=DEBRIS5 // HOOD (MeshFile used in this instance will be displayed in HOODVIEW cam instead of cockpit)
Instance=DEBRIS6 // REARBUMPER
Instance=DEBRIS7 // LMIRROR (use only with open wheelers)
Instance=DEBRIS8 // RMIRROR
Wrong use of DEBRIS instances can result in unexpected behavior of all kinds of sorts. Remember when changing DEBRIS numbers to update the respective references in the .DMG file, too!
Sound
Evo adds a number of new keywords to the sound definition file (.aud), usage should be self explanatory and the following lines can be copied directly:
// Brake hiss
VS_INSIDE_BRAKES_LOW=brakes_low.wav
VS_INSIDE_BRAKES_HIGH=brakes_high.wav
VS_OUTSIDE_BRAKES_LOW=brakes_ext_low.wav
VS_OUTSIDE_BRAKES_HIGH=brakes_ext_high.wav
BrakeRampSpeed=12
BrakeBlendSpeeds=(16, 24)
BrakeFadeSpeeds=(24, 28)
BrakePressure=1.0
// Dust Cloud
VS_INSIDE_DUSTCLOUD=dustcloud.wav
DustSoundVolumeMultiplier=0.01
// SPRAY CLOUDS
VS_INSIDE_SPRAYCLOUD=spraycloud.wav
SpraySoundVolumeMultiplier=0.01
// STONE CHIPS
VS_INSIDE_STONECHIP_BODY=stonechip_body.wav
VS_INSIDE_STONECHIP_WINDOW=stonechip_window.wav
VS_INSIDE_STONECHIP_WINDOWCRACK=stonechip_windowcrack.wav
StoneChipMinVolume=0.9
StoneChipMaxVolume=1.0
StoneChipPitchVariation=0.1
Engine coasting sounds got the new keyword "FREE":
VS_INSIDE_COAST_ENGINE_1=GTL\ac_idle.wav
VS_INSIDE_FREE_ENGINE_1=GTL\ac_idle.wav
This needs a bit more explanation: for every coast sound a "free" version, i.e. a sound with the engine in neutral gear, has to be defined. If those lines are missing, the engine will sound very strange if in neutral gear. The easiest solution is to just copy the COAST line and change COAST to FREE, like in the above example.
This needs to be done also later in the file in the OUTSIDE and EngineRPM sections of the .aud file.
A new modifier is also available, which can be used to adjust the sound volume of a given sound effect while it is played back:
VS_INSIDE_COAST_ENGINE_1=CAR\BMW_M3\m3_idle_in.wav:V=0.90
In the above example, the sound is played back at only 90% of the recorded volume.
File Decryption
With the Race series, SimBin introduced a major pain in the ass, the completely useless and broken-after-a-day file encryption. It's only purpose is to annoy people. To get rid of it, use Luigi Auriemma’s excellent wtcced tool.
Steam users need to extract the files out of the .gcf archives before decryption with GCFScape.
Both tools are free of charge.
Note: Please direct any questions regarding both applications towards the authors!
Wipers
petrs73 has written a small tutorial on how to add wipers. Note that the coordinates that come from 3DSimEd need to placed in order XZY for hex-editing the FXA/FXM files.
Also note that petrs73' tutorial doesn't work for the WTCC cars and the Mini.
Crash to Desktop(CTD) diagnosis
1.CTD when car is crossing s/f line: Check AIW
2.CTD at Track load time: Always same track=check .TRK; Always same mod=check .CAS
3.CTD when leaving a track: check .CAS
Typical problems that cause a CTD from a bad .CAS, .TRK or .AIW file:
1.missing closing brace e.g. ) }
2.two or more successive blanks between keywords in the .trk file, e.g.
MeshFile=day.gmt CollTarget=False HATTarget=False
// two blanks here--^
Track conversion
Basics
Race07 does not support any archive file types of previous SimBin titles like .gtr or .gtl, nor does it support rFactor .mas files. Therefore the first step in converting a track from either source is to extract mesh files and textures using 3dsimed. I recommend extraction of both meshes and textures into a single subfolder, let's call it DATA. The next step is to create proper search paths and remove MASFile entries. Also included should be paths to SimBin shared objects:
SearchPath=GameData\Locations\MyTrack\Data
SearchPath=GAMEDATA\LOCATIONS\SHARED
SearchPath=GAMEDATA\LOCATIONS\SHARED\SKIES_CENTRAL // use same keyword as the Region statement in .gdb
SearchPath=GAMEDATA\LOCATIONS\SHARED\MISC
SearchPath=GAMEDATA\LOCATIONS\SHARED\TEAMMAPS2
Another novelty is that Race07 can't create .hat files on it's own. Therefore we need a copy of GTR2 to do this. rFactor .hat files definitely don't work, GTL files might work. If during the conversion process anything has been changed to an object that is labeled HATTarget=True then this object has to be carried over to GTR2 and a new .hat file has to be created.
Some tracks include movie files that are played on TV screens located around the track, typically in .bik format. They can be used in the same way in Race07 but to actually see them, a line in the .plr file has to be edited:
Play Movies="1"
New keywords
Race07 has introduced a number of new keywords to track definition files:
GDB:
With the introduction of in-game advertising, SimBin made a proper statement mandatory with patch 1.0.1.6. Qualifying and race formats have changed, from GTR2 and GTL, and rolling starts are now handled in the .gdb and not in the .aiw anymore:
IGAID = 64 // In-game advertising
QualifyDay = Saturday // only one qualy session supported
QualifyStart = 9:00
Race1Day = Sunday // two-race format introduced
Race2Day = Sunday
Race1Start = 11:30
Race2Start = 14:00
Race1Laps = 53
Race2Laps = 53
Category=Add-On // valid categories are: 2006,2007,VARIATIONS,Add-on,GTR Evo
TrackInfo=Converted by Someone
RollingStartDistFromSFLine=200
FormationSpeedKPH=90.0
TRK
A new keyword World has been introduced, with valid parameters far and near. AFAIK this serves as a sorting parameter. The parameter far is currently only used together with the noculling parameter on large tracks like the Nordschleife:
MeshFile=horizon.gmt world=far noculling=true CollTarget=False HATTarget=False
The parameter near is frequently used in cockpit instances for example to avoid problems with driver's arms.
AIW
The starting position of the player car in Time Trial mode has now it's own section instead of a "magic" GridIndex:
[TIMEATTACK]
Pos=(744.0052,-4.8019, 1.9622 )
Ori=(0.0,-1.57,0.0)
How to Mod GTR Evolution
05.11.2009