May 21, 2012

If a car gets stuck in the water just delete the cache file and comment out the edge.dof in the 
geometry.ini file then the car should run thru the water then uncomment the edge.dof object and all 
should work ok.  There seems to be an imteraction between the edge and a shader.  There are a lot 
of cg's in the cg folder that I got from various sources that are different from the regular ones.

A tunnel is in the hill to demonstrate shadows. make cast_shadow=0 for the grass shader to see the 
difference.

There are several types of water used on this track.  A waterfall, pond, and pool.  All are made 
differently and use special shaders as Ruud hasn't fixed water yet.  The waterfall and pool use the 
same texture/shader but the waterfall is exported using the Blender vertex color exporter.

There are two types of trees, standard X type and DavidI's and they can be animated with a shader change.

Cones and the big cube are moveables and there is a triggerline to cycle thru 24 hours to check your 
car lights. It is turned off with another triggerline that also resets the cones and cube. If you have 
trouble finding them you may use tracked to find them.

The hill gravel road surface is really flat.  The roughness was made with the road_noise... variables.

Sort_offset is a feture added with 0.5.3 beta 2.1.  It is best to reserve numbers 50...99 for tracks 
and use 0...39 for cars. Numbers 40...50 are for the problem when the track numbers must be 11 higher 
than the highest car number.  I haven't figured out how to make negative numbers work right yet.
Lower numbers render first.

Sounds are generated by detecting the "pattern" image referenced in the surfaces section of 
your special.ini file and passing it over to the audio section of your racer.ini file.
Example:
  In your surfaces section you have:
    surf_kerb
  {
    type=kerb
    subtype=0
    pattern=curb
  }
When the car passes over the surface with a "pattern=curb" texture the "type=kerb" is passed 
to the audio section of racer.ini and the .wav file in the "kerb" sub section will be played.

With splines the surface sound where the splines are located should be the sound 
generated by the "surf"pattern image (without extension) listed in the special.ini file, 

The track objects have all of the currently available surfaces applied, using 
the following images, road, gravel, stone, waterc/waterb, ice, snow, mud and sand.  The kerb 
image is on the track edge and the large gray area surronding the track uses the road image also. 

The track minimap appears only when splines are being used.  

To change from splines to no splines, delete spline.ini (16kb) COPY no_spline.ini (1kb) from the 
splines folder. Then rename it spline.ini.  Reverse the steps to go back to spline.ini.

Shader method of sun reflections:
The sun reflection off the track are generated by the six sun_xx.tga images which are 
not the same as those in the image folder but they work the same.  These images are 
used by the $tracksunmap in the track.shd file. The sun reflection works properly when 
applied to a track.  See the big sign in the grey area outside the track.  I used the track_xx.tga 
images to illustrate the orientation of the sun_xx.tga images.

The sun is located in the West by the "gfx" section in special.ini and the sun for shader
reflections in the southeast by the track.shd $tracksunmap file. The road shader uses 
shader reflections

Blender method of sun reflections:
Texture the mesh with an .tga image.  Add a material with "Ref" , "Spec", "Emit" and "Amb" 
sliders set at 0.500.  "R, G, B" sliders at 0.700, 0.700, and 0.600 respectively.
The Blender method requires that there be no comments ";" between the sun location line and 
the next brace " { " or the track/car becomes dark and no increased amount of light will change it.

Ruud added a 'viscosity' parameter to the surface definition. It then generates a force:
forceViscosity=-load*viscosity*wheelVelocity
So the force acts like a fully-braked wheel (exactly pushing opposite of where it is moving to), 
AND is dependent on load. Important to note also that it does NOT act on the spinning 
velocity of the wheel; it just pushes the car directly.  An example gravel then has:
rolling_resistance_factor=0.5
viscosity=0.5


; Special ini for your track
; surf_xxxx - whatever you want to call it
; type=road - determines sound generated in racer.ini
; pattern=road* - image matched to generate sound
; grip_factor=0.2 makes track like ice
; rolling_resistance_factor= - resistance of surface to the tire rolling on it.
; viscosity= - forceViscosity=-load*viscosity*wheelVelocity
; road_noise=0.5 - causes car to bump violently if too high, measured in meters
; road_noise_frequency=0.25 32 - perlin noise frequency sets distance between peaks
; with two to four values the second and subsequent are imposed on the first with
; the road_noise_amplitude values used in sequence
; road_noise_amplitude=1.0 0.1 - perlin noise amplitude height of bumps
; road_noise scales amplitude - road_noise * road_noise_amplitude = bump in meters
; road_noise_threshold <v1> <v2> ... if <v1> and <v2> is greater than the road_noise 
; value the surface has no noise and is flat.  If the threshold value is less than or 
; equal to the road_noise value then the surface has that noise added to it.
; steer_noise=0.1 - for force feedback set as needed if you use it
; dust_color=1 1 1 - 0.0 to 1.0 red-green-blue for beta7.9 on
; skid_sound=0 for no skid sound on the surface, default is = 1
; no skid sound = no skid marks

The surfaces section below are used with "road_noise_factor=0.0" in debug.ini, before ver. 
beta 8.5, or racer.ini "dbg_controls" section after.  They were set up and tested using 
a Honda Spoon.

All of the .wav files in the following sections need to be in the "audio" folder or you 
won't hear them.  These are not the best sounds, but they are from the various 
versions of RACER and should be in your racer/data/audio folder.

Ambient sounds are set by the following method.
  1.  Put the sound.wav file in the track folder
  2.  Use tracked to insert the sound
  3.  Save the track and the sound code should be in the audio section of your track 
       special.ini file.
No volume control for these sounds yet.

These are the surfaces to be put in your special.ini and what they do.  See the green 
sign by the kerbs which shows the effect for various values of "road_noise_threshold".

NOTE:  Only road_noise has an effect on kerbs, so set at desired kerb height or 0.0 for 
            flat kerbs.

surfaces
{
  surf_road
  {
    type=road
    subtype=0
    pattern=road
    grip_factor=1.0
    rolling_resistance_factor=0.1
    viscosity=0.0
    road_noise=0.0001   ;0.004 inches real smooth pavement
    road_noise_frequency=0.25 32
    road_noise_amplitude=1.0 0.1
    road_noise_threshold=0.0001 0.0001
    ;    steer_noise=0.1
    dust_color=1 1 1
    skid_sound=1
  }
  surf_grass
  {
    type=grass
    subtype=0
    pattern=grass
    grip_factor=0.4
    rolling_resistance_factor=0.1
    viscosity=0.0
    road_noise=0.05   ;2 inches slippery stuff and a bit rough
    road_noise_frequency=2 16
    road_noise_amplitude=0.8 0.2
    road_noise_threshold=0.01 0.01
    ;    steer_noise=0.1
    dust_color=0.305 0.490 0.300
    skid_sound=0
  }
  surf_gravel
  {
    type=gravel
    subtype=0
    pattern=gravel
    grip_factor=0.2
    rolling_resistance_factor=0.5
    viscosity=0.15
    road_noise=0.06   ;2.4 inches tough to move thru
    road_noise_frequency=2 8 16
    road_noise_amplitude=1.5 0.4 0.1
    road_noise_threshold=0.01 0.01 0.1
    ;     steer_noise=0.1
    dust_color=0.385 0.365 0.227
    skid_sound=0
  }
  surf_stone
  {
    type=stone
    subtype=0
    pattern=stone
    grip_factor=0.35
    rolling_resistance_factor=0.7
    viscosity=0.1
    road_noise=0.01   ;0.5 inches small stones on pavement
    road_noise_frequency=2 8 16
    road_noise_amplitude=1.0 0.4 0.1
    road_noise_threshold=0.001 0.001 0.001
    ;      steer_noise=0.1
    dust_color=0.814 0.788 0.838
    skid_sound=0
  }
  surf_water
  {
    type=water
    subtype=0
    pattern=waterb
    grip_factor=1.0
    rolling_resistance_factor=1
    viscosity=0.15
    road_noise=0.001   ; smooth bottom difficult to move thru
    road_noise_frequency=1
    road_noise_amplitude=1.0
    road_noise_threshold=0.0001
    ;      steer_noise=0.1
    dust_color=0.584 0.695 1.0
    skid_sound=0
  }
  surf_kerb
  {
    type=kerb
    subtype=0
    pattern=curb
    grip_factor=1
    rolling_resistance_factor=1
    road_noise=0.05   ;2 inches set to desired kerb height or 0.0
    road_noise_frequency=5.   ;has no effect on kerb
    road_noise_amplitude=1.0   ;0.0 has no effect on kerb
    road_noise_threshold=1.0
    ;    steer_noise=0.1
    dust_color=0 0 0
    skid_sound=0
  }
  surf_ice
  {
    type=ice
    subtype=0
    pattern=ice
    grip_factor=0.1
    rolling_resistance_factor=0.01
    viscosity=0.0
    road_noise=0.01   ;0.4 inches rough ice slippery stuff
    road_noise_frequency=0.2 0.8 32
    road_noise_amplitude=0.01 1.4 0.1
    road_noise_threshold=0.001 0.001 0.001
    ;      steer_noise=0.1
    dust_color=0.815 0.860 0.985
    skid_sound=0
  }
  surf_snow
  {
    type=snow
    subtype=0
    pattern=snow
    grip_factor=0.2
    rolling_resistance_factor=0.1
    viscosity=0.05
    road_noise=0.01   ;0.4 inches slippery and a little rough
    road_noise_frequency=0.1 0.8 16
    road_noise_amplitude=0.01 3.0 2.5
    road_noise_threshold=0.001 0.001 0.001
    ;    steer_noise=0.1
    dust_color=0.850 0.875 0.995
    skid_sound=0
  }
  surf_mud
  {
    type=mud
    subtype=0
    pattern=mud
    grip_factor=0.57
    rolling_resistance_factor=1
    viscosity=0.3
    road_noise=0.1   ;4 inch ruts and sticky
    road_noise_frequency=6 32
    road_noise_amplitude=1.0 0.1
    road_noise_threshold=0.05 0.05
    ;    steer_noise=0.1
    dust_color=0.385 0.365 0.227
    skid_sound=0
  }
  surf_hill
  {
    type=gravel
    subtype=0
    pattern=hill
    grip_factor=1.0
    rolling_resistance_factor=0.1
    viscosity=0.0
    road_noise=0.21   ;8 inch bumps
    road_noise_frequency=6 32
    road_noise_amplitude=1.0 0.1
    road_noise_threshold=0.05 0.05
    ;    steer_noise=0.1
    dust_color=0.725 0.600 0.327
    skid_sound=0
  }
  surf_sand
  {
    type=sand
    subtype=0
    pattern=sand
    grip_factor=0.7
    rolling_resistance_factor=1
    viscosity=0.2
    road_noise=0.026   ;1 inch ripply like beach sand
    road_noise_frequency=0.6 8 16
    road_noise_amplitude=0.1 1.5 0.4
    road_noise_threshold=0.01 0.01 0.01
    ;     steer_noise=0.1
    dust_color=0.850 0.750 0.327
    skid_sound=0
  }
}

