Changing Track Parameters

1. INI files


1.1 What is contained in INI files?

INI files contain weather and lighting specifications for tracks in NFS:HS. They originate from HRZ files found in NFS3, but with the extensions made in NFS:HS, they were expanded with new features.


There are four INI files; one for each of the available time / weather combinations. The file names correspond to the conditions as follows;


TR.INI Day

TRW.INI Day with weather enabled

TRN.INI Night

TRNW.INI Night with weather enabled


1.2 What should I edit in INI files?

All you need to edit INI files is a text editor; by default Windows will use Notepad to edit INI files. If you have chosen a different text editor, make sure you save the file in TEXT FORMAT, or it will appear corrupted to the game and will crash it.


1.3 What can I do by editing INI files?

By editing INI files, you can change the weather, the indicator and the sky color among other things. You can add thunder, rain or snow, change the position and size of the sun, change the fog and edit the color and brightness of the light sources on the track. With careful editing you can change the atmosphere of a track just by changing the values in the INI files - creating a foggy summer morning or a spooky night (evening) scene. By editing INI files you can add the finishing touch to the tracks you make - letting them appear just the way you want.


2. Variables in the INI file


2.1 Horizon strip [strip]

The strip contains information about the horizon and its properties.


hrzShouldDrawBlack=b

This is a boolean value that determines whether the screen should be filled with black before each frame is rendered, with a value of 1 if so, otherwise 0. When set to 1, no pixel map or horizon is rendered. This is useful if the track does not contain any horizon or pixel map (see below).


This feature is not used on any of the original tracks in NFS:HS, those from the included NFS3. In NFS2 however, it was used on Monolithic Studios, and in NFS3 for PlayStation, it was used on the Easter Egg track, the Caves. There is also a corresponding function in the .FRD files (where the track model is stored), which sets the ShouldDrawBlack variable individually for each track sector. This is used in the Temple on the Lost Canyons track.


hrzMirror=b

This is boolean and tells whether the pixel map (see below) should be mirrored in the two halves of the horizon (1) or whether it was repeated with the same orientation in these two halves (0). For prominent horizons like hills, it is often best to make a pixel map that can be repeated seamlessly in these two halves and set hrzMirror to 0, otherwise the mirroring of these two halves will cause a Rorschach effect at the seam. When you want there to be a scene only at one end of the horizon, render it at one end of your pixel map, set hrzMirror to 1.


hrzHasPmx=b

This determines whether the track has a pixel map, that is, a background landscape. This is a boolean set to 1 if the horizon pixel map is used, and 0 if not. This can be used to omit the pixel map if none is needed, such as on a track set on an island in the middle of the ocean.


hrzBottomYOff=y

This determines the offset for the pixel map and fog relative to the logical horizon (the actual middle of the 3D world (single)? A floating-point precision value indicating the height of the Gouraud-shaded sky and ground region.


hrzGouraudMiddle=y

This is a single precision? A floating-point precision value indicating the position of the center of the Gouraud-shaded sky and ground region.


hrzPmxTop=y

This value determines how high in the 3D world the top of the pixel map is - relative to the horizon offset, hrzBottomYOff. The pixel map will appear closer or further depending on the horizon radius; hrzRadius, so you will probably want to adjust the latter before you adjust hrzPmxTop. Typically the value is within 1500.0-2000.0 for a horizon with a radius within 2000.0 and hrzBottomYOff at -1000.


hrzPmxBottom=y

This determines the base of the pixel map in the same way that hrzPmxTop determines the top. Typically the base of the pixel map is slightly above the physical horizon and is at 500-1000, placing the base of the pixel map near the logical horizon. When this is the case, the base of the pixel map should be slightly below the horizon offset with a margin of about 50 units, to hide the seam where the sky and ground meet at the logical horizon.


hrzSunColor=[r,g,b]

This determines the RGB color for the sky at the horizon position. The RGB values are expressed in normal 24-bit format, and each can range from 0-255, where 0 is dark and 255 is bright.


hrzOppositeSunColor=[r,g,b]

This determines the RGB color of the sky at the point opposite the sun.


hrzSkyTopColor=[r,g,b]

This determines the RGB color at the top of the sky. This will gradually blend with the hrzSunColor and hrzOppositeSunColor values toward the horizon; above the top of the Gouraud-shaded area, the sky will be a solid color.


hrzEarthTopColor=[r,g,b]

This determines the RGB color at the top of the ground visible outside the track area.


hrzEarthBotColor=[r,g,b]

This determines the RGB color at the bottom of the ground visible outside the track area.


hrzfRadius=r

This determines the radius of the horizon, and affects the appearance of the pixel map, clouds and shading. Typical values range from 1500.0-2500.0.


hrzAngle=?

This determines the rotation around the horizontal axis, Theta or ?, of the horizon in the left direction and is expressed in radians. A radian is a fraction of pi, hence a full circle or 360 є roughly equals pi (3.14), and half a circle or 180 є is half (1.57) pi. To convert degrees to radians, use the following formula:


r=0.00873d

Where d is the angle in degrees and r is the result expressed in radians. Round the result to 2 decimal places.
Note that you cannot use this formula directly in the INI file; you must calculate the result and insert it 'as is'.


2.2 Clouds [clouds]


cloudType=t

This is an integer and specifies the type of clouds to apply. A value of 0 means no clouds will appear, a value of 1 means the clouds will be blended with the sky, and finally a value of 2 means they will be blended as additive.


cloudBright=b

This is an integer and determines the intensity, or brightness, of the clouds. The value can range from 0 to 255, where 0 is dark and 255 is bright.


cloudVariance=v

This is an integer describing the variance of the clouds, that is, the contrast between bright and dark areas. Values can range from 0 to 255, where 0 means no variance and 255 full variance.


cloudNimbus=n

This is a point set variable and tells whether the clouds produce a Nimbus effect in storms. The Nimbus effect is simply a refraction of the indicator within the clouds that will cause them to light up with flashes. Values can range from 0.00 to 1.00, where 0.00 means no Nimbus effect at all and 1.00 should have a strong Nimbus effect.


cloudFog=f

This is a boolean value that simply tells whether the fog on the track should affect the clouds when set to 1; if not, it is set to 0.


cloudVisualHeight=h


windSpeed=s

This is an integer specifying the wind speed. Wind speed affects the drift of clouds, as well as special effects such as rain and smoke. A value of 0 means the clouds and effects do not drift. For slow drift, use values around 20, for faster drift use values between 60 and 90.


windDir=a

This is an integer describing the wind direction (to the left), again affecting both the clouds and special effects. Unlike other angles in the INI file, this is expressed in degrees and can therefore range from 0 to 359.


cloudYOffset=200.0

cloudHeight=500.0

The height of the clouds.


cloudUscale=1.0

2.3 Lightning [lightning]

These two values describe whether lightning occurs and, if so, how often. When lightningChance is set to a value greater than 0, there is a lightningChance percent chance of a random lightning strike occurring at lightningOffTicks time.


If you want frequent flashes, set the lightningChance percentage reasonably high and lightningOffTicks low. If you want random flashes, set both lightningChance and lightningOffTicks low. Note that if you set lightningChance too high, flashes will occur with a very regular recurrence, which could seem unnatural.


LightningChance=c

This is an integer and tells, as a percentage, how great the chance is that a flash will occur at the point specified in lightningOffTicks. Generally, keep this value below 80 for a naturally random recurrence, and adjust the lightningOffTicks value to determine the frequency of flashes. If you do not want any lightning, set this to 0.


lightningOffTicks=o

This determines the frequency of lightning in time signal ticks.


2.4 Distance Fog [fog]

Fog comes in two forms; global and dynamic. Global fog affects the entire track in all areas where no dynamic fog zone has been defined. Dynamic fog zones allow you to add specific fog to a region of the track, and also to blend smoothly between different fogs.


fogColor=[r,g,b]

This specifies the color of the global fog in 24-bit RGB. Each value is an integer and can range from 0 to 255, where 0 is dark and 255 is bright. The scenery is blended toward this color by the amount specified in fogDensity.


fogDensity=d

This specifies the density of the fog as a percentage, ranging from 0 for no fog at all to 100 for fully opaque fog.


fogHorizon=h

This is a point set value and tells whether the horizon is affected by fog, ranging from 0.00 for no effect to 1.00 for full effect. Generally keep this within 0.70-0.80.


fogNumRegions=n

This value is an integer and specifies how many fog regions have been defined, so it should equal the number of dynamic fog regions in your INI file.


[fog region n]

startSlice=ss

scolor=[sr,sg,sb]

s
density=sd

centerSlice=cs

ccolor=[cr,cg,cb]

c
density=cd

endSlice=es

ecolor=[er,eg,eb]

e
density=ed


They are dynamic fog regions that define fog unique to a certain part of the track. The fog region defines the region number in the list and must start with 0 for the first region, followed by 1,2,3 ... etc for each subsequent fog region. StartSlice, centerSlice and endSlice define three positions along the track for the fog region. At each one, the fog set will determine the properties in the *color and *density variables below the corresponding Sector entry. Between these positions, the game will gradually blend the nearest two values to gradually change between the different fogs.
The positions along the track specified in the Sector variables correspond to the rows of polygons that make up the track. To determine the desired sector, you can open the track in T3ed and select Segment mode. Then move to the block you want and select it. In the lower right corner of the window you will see the block number. To determine the number of the first sector of that block, multiply the block number by 8. This will give you a preliminary value to use, which you can fine-tune later.
Note that where two fog regions join, they must both have the same color and density at the joining ends. Otherwise the fog will immediately switch from one value to the other as you drive between the regions. Similarly, where either end of a fog region does not join another region, they must have the same values as the global fog specified in fogColor and fogDensity to avoid switching.
If you need to cover a large section of track with even fog, use two fog regions where the values at the opposing ends are the same as their adjacent fogs, and the four values in between have the values you want for the large fog region. Then set centerSlice of both fog regions 10-50 sectors in from the Sectors at the opposing ends, thus creating a transition region at both ends. Finally make the two adjacent Sectors of the two fog regions any value between the two centerSlices to make them join and complete the fog region.


2.5 Weather [weather]


type=t

This defines the type of weather to use, where 0 means no weather, 1 means rain and 2 means snow.


startSlice=s

StartSlice defines an optional sector where the weather should start and can be used if you want to restrict the weather to a certain part of the track. Again, the Slice value refers to track sectors. See above in the fog regions explanation for information on how to determine the desired Slice value. If you want the weather to cover the full track, set this variable and endSlice to 0.


endSlice=e

This variable is related to startSlice and defines the sector at which the weather should end.


fade=f

When you have restricted the weather to a certain part of the track using startSlice and endSlice, this defines the number of sectors at either end of the weather region over which the weather should gradually change, which will gradually become denser as you drive into it. Reasonable values range from 5 for a quick transition to 50 for a smooth transition.


stayTimeOn=t

Along with the other Time variables, this allows you to have the weather arrive and go periodically. StayTimeOn defines how long the weather should stay active before a break, and is counted in time signal ticks.


fadeTimeOff=t

When you have chosen to have the weather arrive and go periodically in the stayTimeOn and StayTimeOff variables, this defines the time over which the weather should gradually fade out. Again, this is measured in time signal ticks.


stayTimeOff=t

Similar to the stayTimeOn variable, this is used to create a weather break periodically and defines how long the break should last before the weather comes back on. If you want the weather to stay constant, set this variable to 0.


fadeTimeOn=t

While the fadeTimeOff variable defines the time over which the weather should gradually fade out, this defines the time over which the weather should gradually change back in after the break. As is the case with the other Time values, this is measured in time signal ticks.


density=100

This defines the density of the weather as a percentage. 0 means there will be no rain, and 100 means the rain will be as dense as the game allows.


2.6 Ambient Light and Car Shadows [light]


AmbientRed=r

AmbientGreen=g

AmbientBlue=b

These define the ambient light for the track and are measured as a percentage. At a value of 0, the track will be completely dark, while at a value of 100 it will be as bright as was defined in the internal shading values of the track file directly. If you want to make the track dark, choose values that lie within 20 or more; anything less will make the track unplayable when the headlights are knocked out. If you want the track to be fully bright, set the values to 100 or thereabouts.


lightTheta=?

lightRho=?

These two values are used to define the incoming light source for car shading. Both take two decimal numbers, and define the angle around the horizontal axis (Theta) and the vertical axis (Rho). Both are expressed in radians. LightTheta expresses the horizontal angle in a counter-clockwise direction, where 0.00 equals North, 0.79 equals West, 1.57 equals South, and 2.36 equals East. LightRho expresses the vertical angle ranging from 0.00 for the Zenith, where the sun is placed at the top of the sky, and 0.39, where it is at the horizon. Usually set lightTheta to the value opposite that of the Sun's angleTheta (see below) and lightRho to the same value as the Sun's angleRho.


carshadow=[i,r,g,b]

This defines the intensity and color of the car shadow. I report the shadow intensity and cannot rank from 0 (none) to 255 (fully opaque). R, g, b define the color in normal 24-bit RGB format, so each value can range from 0 (dark) to 255 (bright). For most cases, set me to around 100, and each of r, g, b to 255.


2.7 Special effects [special]

These variables define some special effects that can be used on tracks.


meteor=b

This would be a boolean and would report whether there were 'meteors' on the track, when this should be set to 1, otherwise it should be set to 0.


flare=[r,g,b]
When the track shows the sun, this defines the intensity of the sun and the lens flares that appear when the sun is in view. Each of r, g, b can range from 0 to 255 and define the intensity of the corresponding color, where 0 means no flare and 255 full intensity. If you do not want the flare to appear, for example if you have an overcast sky with only a faint sun or moon at night, set each of r, g, b to 0. For an intense flare, set each of r, g, b to 255.
fireworks=f

fireworksAngle=?

This allows you to add fireworks to the track, but this is a limited effect that depends on the day the game was installed. If the game was installed before July 4th, fireworks would only appear on July 4th; if it was installed later than July 4th, fireworks will always appear when this option is set.


fireworks reports whether fireworks should appear. A value of 0 means no fireworks. FireworksAngle expresses Rho or the vertical angle of the fireworks and is expressed in radians, where 0.00 places them at the top of the sky and 0.39 at the horizon. However, Theta or the horizontal angle of the fireworks cannot be defined; they will always appear opposite the Sun.


2.8 Sun [sun]

This contains information regarding the track's sun, however the sun can also be the moon (!).


hasSun=b

This is a boolean value and indicates whether the track should have a sun (1) or not (0). If this variable is not accounted for on tracks made from NFS3 tracks, the sun will appear??? Where???.


angleTheta=?

angleRho=?

They define the position of the sun on the horizon in radians. AngleTheta expresses the horizontal angle and can range from 0.00 to 3.14. AngleRho expresses the vertical angle and can range from 0.00 to 0.39. To make the sun appear within view, usually set angleRho between 0.10 and 0.30, however it could be obscured by the pixel map if the latter is high, and the inFront variable (see below) was set to 0.


radius=r

This is a decimal value expressing the radius of the sun. For a normal sun, set this to around 200.0, for a large sun set it to around 300.0, and for a huge sun set it to 500.0 - or a bit higher:).


rotates=b

This boolean value would report whether the sun rotates around its own axis as you turn, when this should be set to 1. If your sun is the moon (!), for obvious reasons you might not want to use this, so then set it to 0.


additive=b

This boolean value would report whether the sun was inserted on top of the sky (0) or blended with it (1).


inFront=b

A boolean value that determines whether the sun should appear in front of the pixel map (1) or behind it (0).


2.9 Track glows [track glows]

Track glows contain specifications of track glows, which are light sources seen on lamp posts and similar. The values specified in track glows were previously common to all tracks, but since the inclusion of per-track variables in the INI registers their appearance, it can be edited. Usually you will find most glows to have the same values on all original tracks. Not all glows are used, on many tracks only two or three.


glow
=[i,r,g,b], f, t, ?, d

These arrays define the color and behavior of the glows. A total of 32, named glow0 through to glow31 appear in the original files, however not all of them are used on every track.


[ i, r, g, b] define the intensity and RGB color of the glow, and can all range from 0 to 255. An intensity of 0 means the glow will not appear, and can thus be used to produce light sources that have become misplaced when editing track placement.


F is a boolean value and reports whether the glow is solid (0) or (1) flashes, when t reports how long the glow should wait between changes of its state. At a low value of t, like 2 or 3, the glow will flash very quickly. I would not recommend using values lower than 5, since the resulting strobe effect can seem disturbing. At a slightly higher value, like 6 or 7, the flashing is slow enough to be suitable for objects like flashing brake lights or similar.
D is a fixed-point value with two decimal places, defining the diameter of the glow directly.
There are also three unknown variables that only appear in some of the INI files, and always with the same values, T0. Experimenting with these values seems to have no meaningful effect other than in some cases removing the corresponding glow. Since these variables are not present in many of the INI files and when they appear, always have the same consistent values, it can be assumed that they have no proper use in the game. These variables could be part of features that were not accounted for or never put in. They are however redundant and can be ignored.

Related articles

Comments

Do you agree with the author? Share your experience or correct us.

Reviews: 0
Sign in  or  sign up  Sign in or sign up to leave a comment.