Advertisement
Guest User

Untitled

a guest
Jan 10th, 2024
5,770
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.62 KB | None | 0 0
  1. ###########################################################
  2. ###########################################################
  3. # NAME: Rack_Force
  4. #
  5. # Modified original 'basic' profile to give raw FFB output with properly working clipping and a few other tweaks.
  6. # This FFB is calculated purely on the game's physics.
  7. #
  8. # This has no effects besides minimum force which can be adjusted with the ingame LFB slider.
  9. # Damper and FX sliders do nothing
  10. #
  11. ###########################################################
  12.  
  13.  
  14.  
  15. #Some constants being defined, not really sure what all this does.
  16. #Looks like it's basically setting up the raw physics forces to be manipulated and spat out as FFB.
  17.  
  18. #Defining some kind of maximum force
  19. (max_overall_force 11500.0)
  20.  
  21. #Calculating the reciprocal of the above
  22. (recip_force ( / 1.0 max_overall_force))
  23.  
  24. #No idea, looks like it's calculating some kind of damping/smoothing value based on a preexisting ingame variable
  25. (mass_damper ( * M_smooth_samples 0.0))
  26.  
  27. #Using the above to apply some smoothing?
  28. (arm_force_smooth ( spring arm_force 0 0.0 mass_damper))
  29. (arm_force (if M_smooth_samples arm_force_smooth arm_force))
  30.  
  31. #Scaling the output of the physics engine based on physics force output?
  32. #Looks like the end result is the 'rack' variable which seems to be our force at the rack.
  33. (rack_scaled ( * arm_force ( / max_overall_force M_max_force_at_rack)))
  34. (rack_scaled ( * rack_scaled recip_force))
  35. (rack rack_scaled)
  36.  
  37. #Parking lot forces
  38. #Looks like this is where the forces are reduced below a certain speed to avoid a really heavy wheel when parked.
  39. (parkingForce (* parkingForceMult rack))
  40. (parkingForce (* parkingForce (crossover et 0.0 5.0)))
  41. (parkingForce (* parkingForce (- 1.0 (crossover vel_mag 0.0 7.0))))
  42. (rack (* rack (crossover vel_mag 0.0 5.0)))
  43. (rack (+ rack parkingForce))
  44.  
  45. #Setting our FFB output variable equal to the output of above calcs
  46. (output rack)
  47.  
  48. #Not sure what this does but doesn't relate to actual force calculations - perhaps used for ingame display of FFB.
  49. (scale_window_init 10.0)
  50. (scale_window_nominal 2.0)
  51. (scale_soft_clear_t 10.0)
  52. (scale_min 0.2)
  53. (scale_max 2.0)
  54. (scale_blend_t 2.0)
  55. (signal_scale output
  56. 1.0 1.0 1.0 1.0 1.0
  57. 0.0
  58. 0.0 0.0)
  59.  
  60. #gain is the value of the ingame gain slider * the car specific multiplier
  61. #Here the output is multiplied by this overall gain multiplier
  62. (output (* output gain))
  63.  
  64. #Low force boost/minimum force implementation
  65. #Not sure how exactly this function works
  66. (output (lfb output 0.0))
  67.  
  68. #Test LFB setting to emulate 'minimum force' setting in other games. Uncomment this and comment out above to try it.
  69. #Minimum force % = 1/4 the value you set in game, so 100% ingame is 25% on your wheel
  70. #0.05 value is a kind of smoothing to remove the brick wall on/off effect you get with hard minimum force cutoff.
  71. #(output(tighten output (* lfb_slider 0.0) 0.0))
  72.  
  73. #Statistics outputs, potentially for ingame logging that you see in the HUD, not sure how these work but seem to exist in basic file and other edited files.
  74. (histogram output)
  75. (info2 output)
  76.  
  77. #Bumpstop code, values in brackets are stiffness buffer, stiffness, drag threshold and drag.
  78. (stops (bumpstop output 0.1 1.0 0.1 0.0)) # Bumpstops parameters: stiffness buffer, stifness, drag threshold and drag. Thresholds are how far back from bumpstops you start blending in some stiffness and drag....basically you cannot be as stiff as a real stop, because it'll get violent...because unlike a real lock stop, there is latency.
  79. (output (+ output (* stops)))
  80.  
  81. #Final output clipping. Not sure what a doom check is!
  82. (doom_check output)
  83. (output (hard_clip output 1.0))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement