<?xml version="1.0" encoding="utf-8" ?>
<FFBEffects>
    <!-- Effect setup for force feedback
	This file holds the list and parameters for all force feedback effects.
	Effects are: steerign forces, collisions, surfaces etc. Each of them has a different
	set of parameters.-->

    <!-- Effect of tyre forces on the steerign wheel while the car is moving.
	Angle considered is the angle between steering direction and maximum grip direction.
	Corner point and exponent is used to increase sensitivity around the center position of the wheel.
	             scale= effect scale
	               toe= X component of driving geometry, responsible for torque steer
	             trail= Z component of drivign geometry, responsible for side forces and centering at speed
	            camber= Y component of drivign geometry, responsible for forces from elevation changes
	 angleThresholdLow= minimum angle to apply friction below
	  angleFrictionLow= applyed friction
	angleThresholdHigh= maximum angle to apply friction
	 angleFrictionHigh= applyed friction
	 	  thresholdLow= travelling speed in m/s to start applying friction
	       frictionLow= applyed friction
	     thresholdHigh= travelling speed in m/s when maximum friction is reached
	      frictionHigh= applyed friction
		   cornerPoint= resultForce = pow(force / cornerPoint, exponent) * cornerPoint
		      exponent= power to raise tyre forces to-->
    <FFBCaster scale="2.0" toe="0.00" trail="1.0" camber="0.00" angleThresholdLow="6.5" angleFrictionLow="17.5" angleThresholdHigh="25.0" angleFrictionHigh="6.5" thresholdLow="2.5" frictionLow="0.0" thresholdHigh="6.0" frictionHigh="1.0" cornerPoint="0.075" exponent="0.35"/>

    <!-- Static friction effect on the steering wheel
	        scale= effect scale
	 thresholdLow= lower travelling speed threshold in m/s to scale effect in between
	  frictionLow= friction to apply at low speeds
	thresholdHigh= higher travelling speed threshold in m/s to scale effect in between
	 frictionHigh= friction to apply at high speeds-->
    <FFBlateral scale="1.0" thresholdLow="2.5" frictionLow="25" thresholdHigh="6.0" frictionHigh="5"/>

    <!-- Collision vibrations
	A list of collision vibrations must be given, with different impulse ranges.
	The appropriate one with the matching range will be played
	        scale= effect scale
	 thresholdLow= lower threshold of impulse
	thresholdHigh= higher threshold of impulse
	   damageZone= zone of collision
	         freq= freq to play sample with
	       lenght= time to play sample for
	       sample= name of sample to play-->
  <FFBCollision scale="1.3" thresholdLow="0.1" thresholdHigh="4.0" damageZone="0" freq="10.0" length="0.25" sample="smallCollision"/>
  <FFBCollision scale="2.7" thresholdLow="4.0" thresholdHigh="10.0" damageZone="0" freq="10.0" length="0.3" sample="mediumCollision"/>
  <FFBCollision scale="3.3" thresholdLow="10.0" thresholdHigh="100.0" damageZone="0" freq="15.0" length="0.35" sample="bigCollision"/>
  <FFBCollision scale="3.3" thresholdLow="10.0" thresholdHigh="100.0" damageZone="0" freq="15.0" length="0.35" sample="bigCollision"/>

    <!-- Surface vibrations
	Describes grip and effect if car is travellinng over a specific surface. Sample freq is scaled with speed.
	        scale= effect scale
	         name= surface name to play effect over
	         grip= multiplier of tyre forces over the surface
	 thresholdLow= lower travelling speed threshold in m/s to scale effect in between
	thresholdHigh= higher travelling speed threshold in m/s to scale effect in between
	      freqLow= Freq range low
	     freqHigh= Freq renge high
	     scaleLow= envelope scale low
	    scaleHigh= envelope scale high
	       length= sample length
	       sample= name of sample to play-->
    <FFBSurface scale="0.1" name="TARMAC"  grip="1.0" thresholdLow="5.0" thresholdHigh="10.0" freqLow="26.0" freqHigh="52.0" scaleLow="0.0" scaleHigh="1.0" length="0.1" sample="tarmac"/>
    <FFBSurface scale="0.31" name="COBBLESTONE"  grip="0.75" thresholdLow="4.5" thresholdHigh="15.0" freqLow="6.5" freqHigh="25.0" scaleLow="0.1" scaleHigh="1.0" length="0.1" sample="cobblestone"/>
    <FFBSurface scale="0.41" name="GRASS"  grip="0.4" thresholdLow="1.5" thresholdHigh="5.0" freqLow="10.0" freqHigh="25.0" scaleLow="0.5" scaleHigh="1.0" length="0.1" sample="grass"/>
    <!-- NEW -->
    <FFBSurface scale="0.31" name="MUD"  grip="0.4" thresholdLow="2.5" thresholdHigh="15.0" freqLow="5.0" freqHigh="26.0" scaleLow="0.9" scaleHigh="1.0" length="0.1" sample="mud"/>
    <FFBSurface scale="0.31" name="GRAVEL"  grip="0.6" thresholdLow="2.5" thresholdHigh="15.0" freqLow="4.0" freqHigh="24.0" scaleLow="0.6" scaleHigh="0.8" length="0.1" sample="gravela"/>
    <FFBSurface scale="0.31" name="GRAVEL"  grip="0.6" thresholdLow="2.5" thresholdHigh="15.0" freqLow="4.0" freqHigh="24.0" scaleLow="0.6" scaleHigh="0.8" length="0.1" sample="gravelb"/>
    <FFBSurface scale="0.31" name="SAND"  grip="0.4" thresholdLow="2.5" thresholdHigh="15.0" freqLow="2.0" freqHigh="12.0" scaleLow="0.6" scaleHigh="1.0" length="0.1" sample="sand"/>

    <FFBSurface scale="0.51" name="RUMBLESTRIP"  grip="0.8" thresholdLow="4.5" thresholdHigh="25.0" freqLow="4.5" freqHigh="15.0" scaleLow="0.3" scaleHigh="1.0" length="0.1" sample="rumblestrip"/>
    <FFBSurface scale="0.1" name="ROCK"  grip="1.0" thresholdLow="5.0" thresholdHigh="10.0" freqLow="26.0" freqHigh="52.0" scaleLow="0.0" scaleHigh="1.0" length="0.1" sample="tarmac"/>
    <FFBSurface scale="0.1" name="CONCRETE"  grip="1.0" thresholdLow="5.0" thresholdHigh="10.0" freqLow="26.0" freqHigh="52.0" scaleLow="0.0" scaleHigh="1.0" length="0.1" sample="tarmac"/>
    <FFBSurface scale="0.1" name="WATER"  grip="0.4" thresholdLow="4.5" thresholdHigh="5.0" freqLow="10.0" freqHigh="25.0" scaleLow="0.0" scaleHigh="1.0" length="0.1" sample="grass"/>
    <FFBSurface scale="0.51" name="METAL"  grip="0.75" thresholdLow="4.5" thresholdHigh="25.0" freqLow="2.5" freqHigh="14.0" scaleLow="0.0" scaleHigh="0.3" length="0.07" sample="metalsheets"/>

    <!-- Gear change vibrations
	 scale= effect scale
	  gear= gear when effect should be played, if -1 all gears
	  freq= saple waweform repetition rate in Hz
	length= sample length
	sample= name of sample to play-->
    <FFBGearChange scale="0.5" gear="1" freq="35.0" length="0.38" sample="gearChange"/>
    <FFBGearChange scale="0.5" gear="2" freq="35.0" length="0.35" sample="gearChange2"/>
    <FFBGearChange scale="0.5" gear="3" freq="35.0" length="0.32" sample="gearChange3"/>
    <FFBGearChange scale="0.5" gear="-1" freq="35.0" length="0.22" sample="gearChange4"/>

    <!-- Wheel damage effect, played between given levels of damage-->
    <FFBWheelDamage scale="0.3" thresholdLow="0.2" thresholdHigh="1.0" scaleLow="0.0" scaleHigh="1.0" sample="wheelDamage"/>

    <!-- Extreme skidding
	 thresholdLow= lower skidding speed threshold in m/s to scale effect in between
	thresholdHigh= higher skidding speed threshold in m/s to scale effect in between
	  freq= sample waweform repetition rate in Hz
	length= sample length
	sample= name of sample to play-->
    <FFBSkid scale="0.5" thresholdLow="10" thresholdHigh="45.0" lengthLow="6.66" lengthHigh="4.66" freq="0.15" sample="skidVibration1"/>
    <FFBSkid scale="0.5" thresholdLow="45" thresholdHigh="450.0" lengthLow="4.66" lengthHigh="4.66" freq="0.15" sample="skidVibration1"/>
    <FFBSkid scale="0.5" thresholdLow="5" thresholdHigh="15.0" lengthLow="6.66" lengthHigh="2.66" freq="0.15" sample="skidVibration2"/>
    <FFBSkid scale="0.5" thresholdLow="15" thresholdHigh="15.0" lengthLow="2.66" lengthHigh="2.66" freq="0.15" sample="skidVibration2"/>

    <!-- Suspension movement (landing, mainly)
	 thresholdLow= lower suspension speed threshold in m/s to scale effect in between
	thresholdHigh= higher suspension speed threshold in m/s to scale effect in between
	  freq= sample waweform repetition rate in Hz
	length= sample length
	sample= name of sample to play-->
    <FFBSuspension scale="0.25" thresholdLow="0.75" thresholdHigh="2.0" length="0.1" freq="5" sample="suspension0"/>
    <FFBSuspension scale="0.5" thresholdLow="2.0" thresholdHigh="3.0" length="0.2" freq="10" sample="suspension0"/>
    <FFBSuspension scale="1.0" thresholdLow="3.0" thresholdHigh="4.0" length="0.25" freq="10" sample="suspension0"/>
    <FFBSuspension scale="1.0" thresholdLow="4.0" thresholdHigh="16.0" length="0.2" freq="10" sample="suspension2a"/>

    <FFBSuspension scale="0.3" thresholdLow="1.0" thresholdHigh="2.0" length="0.1" freq="5" sample="suspension1"/>
    <FFBSuspension scale="1.0" thresholdLow="2.0" thresholdHigh="16.0" length="0.2" freq="5" sample="suspension1"/>
    <FFBSuspension scale="1.0" thresholdLow="4.0" thresholdHigh="16.0" length="0.25" freq="10" sample="suspension2b"/>

    <!-- Vibration samples
	Holds a simple vibration pattern with waveform and envelope parameters.
	If more samples are described with the same neme the selection between them is random.
	    name= name of sample
	    wave= wave form of sample, ranges from 1 .. 9 as min and max values
	envelope= the envelope applyed while the sample is playing can be used to fade in/out samples
	 channel= vibration channel to play sample to (0 = default, 1 = second rumbler motor)
rubmlerScale= amount to scale output with on a rumbler device
  wheelScale= amount to scale output with on a proportional FFB device-->
    <FFBSample name="smallCollision" wave="124689986421" envelope="9812543210" />
    <FFBSample name="smallCollision" wave="124689986421" envelope="9800125210" channel="1" />

    <FFBSample name="mediumCollision" wave="1972356243" envelope="9654321021340"/>
    <FFBSample name="mediumCollision" wave="1972356243" envelope="87675432100"/>

    <FFBSample name="bigCollision" wave="1972356243" envelope="9654321021310"/>
    <FFBSample name="bigCollision" wave="1972356243" envelope="87675432100"/>
    <FFBSample name="bigCollision" wave="19" envelope="9210" channel="1"/>
    <FFBSample name="bigCollision" wave="91" envelope="9563123210" channel="1"/>

    <FFBSample name="tarmac" wave="192836452623" envelope="1306703041265493" rubmlerScale="1.0" wheelScale="0.5"/>
    <FFBSample name="cobblestone" wave="1928374628" envelope="8976589" rubmlerScale="0.0" wheelScale = "0.5f"/>
    <FFBSample name="grass" wave="192836452623" envelope="1306700001265003" rubmlerScale="1.0" wheelScale="1.3"/>
    <FFBSample name="mud" wave="1111199999" envelope="33405335032354504" rubmlerScale="0.45" channel="0" wheelScale="0.5"/>
    <FFBSample name="gravela" wave="11119999" envelope="33405335032354504" rubmlerScale="0.0" wheelScale="0.5"/>
    <FFBSample name="gravelb" wave="11119999" envelope="23545043340533503" rubmlerScale="0.0" channel="1" wheelScale="0.5"/>
    <FFBSample name="sand" wave="123456789876543" envelope="33405335032354504" rubmlerScale="0.0" wheelScale="0.5"/>
    <FFBSample name="rumblestrip" wave="1928374628" envelope="8976589" rubmlerScale="1.0" wheelScale="1.5"/>
    <FFBSample name="metalsheets" wave="1900000000" envelope="99000000000" rubmlerScale="0.3" wheelScale="1.0"/>

    <FFBSample name="gearChange" wave="1111199999" envelope="9876543210" channel="1" rubmlerScale="1.0" wheelScale="0.3"/>
    <FFBSample name="gearChange2" wave="1111199999" envelope="9876543210" channel="1" rubmlerScale="1.0" wheelScale="0.3"/>
    <FFBSample name="gearChange3" wave="1111199999" envelope="9876543210" channel="1" rubmlerScale="1.0" wheelScale="0.3"/>
    <FFBSample name="gearChange4" wave="1111199999" envelope="9876543210" channel="1" rubmlerScale="1.0" wheelScale="0.3"/>
    <FFBSample name="wheelDamage" wave="1955555555" envelope="5"/>
    <!-- wheelScale is used here as these samples use PWM to get some modulation on the slow rumbler motors.
	     If used with the same scale, would generate too violent effects on steerign wheels-->
    <FFBSample name="skidVibration1" wave="955555555555555" envelope="9" wheelScale="0.1"/>
    <FFBSample name="skidVibration2" wave="955555555555555" envelope="9" channel="1" wheelScale="0.1"/>

    <FFBSample name="suspension0" wave="9" envelope="9564720" channel="0" wheelScale="0.5"/>
    <FFBSample name="suspension1" wave="1" envelope="9564720" channel="1" wheelScale="0.5"/>
    <FFBSample name="suspension2a" wave="9" envelope="9800550" channel="0" wheelScale="0.5"/>
    <FFBSample name="suspension2b" wave="1" envelope="9800550" channel="1" wheelScale="0.5"/>
</FFBEffects>
