########################################################### # NAME: Silver Raw v2.7 - Momentum Rack 2.0 - Karsten # # If you copy this over in full or partly, or base a solution on the same general methods after seeing it, please credit "Momentum Rack" however used("included"/"extended"/"modified"/"based on"), I would be pleased - Thanks. # # # Credits goes to NuScorpii for the included scrub effect. Also for the original custom Sigmoid function, which the included custom function was inspired by. # # # Additionalliy, thanks a whole bunch to F.Santos(as well as other Reiza Forum members) for providing adjustment feedback for the CSW 2.5 wheel base specifically. They seem to work well across wheel types. # # Also thanks to Shadak for requesting the front load exaggeration(& adjustments) as well as softer scrub, now included. Also road rumble adjustment back to 0.008. # # Lastly thanks to CycloZeb for suggesting the grip impact on momentum & balance back to how it was in version 1.2. Feels good! # ########################################################### # # Rack scaling settings # (momentum_rack_scale 2.1) (min_reiza_rack 0.5) (reiza_rack_scale 0.8) (balance_scale 0.4) (exaggerate_front_load_feel 0.5) (bumps_lfb 0.4) (large_lfb 0.3) ########################################################### # # Effect weights - Change here to make an effect more or less pronounced relative to other effects weights. # (engine_scale_at_still 0.6) (engine_scale_at_speed 0.03) (road_rumble_scale 0.008) (scrub_scale 0.6) (kerb_scale 2.0) ########################################################### # # Friction - Helps make things feel more real. # # Best range: 0.02-0.07 (friction 0.05) ########################################################### # # Reiza code # (custom_lock_stop 2.0) (lever_mode 0) (smooth_level 0) (max_change 1.0) (min_force 0.0) (scrub_rack 0.0) (scrub_rear 0.0) (rack_damping_scale 0.0) (reiza_rack (/ arm_force M_max_force_at_rack)) ########################################################### # # LFB 0 fix # (lfb0Chk (lfb 1.0 0.15)) #is not set on crash (lfb0Chk (if (- lfb0Chk 1.0) 1.0 0.0)) (lfb0ChkCnt (+ lfb0ChkCnt lfb0Chk)) (lfb0ChkCnt (min lfb0ChkCnt 1.0)) (lfb0ChkCnt (- lfb0ChkCnt 0.001)) (lfb0ChkCnt (max lfb0ChkCnt 0.0)) (lfb0Fix (if lfb0ChkCnt 1.0 0)) ########################################################### # # Helper vars & prep # (grip_fl 0.0) # Mad engine bug if removing this line. It either does not set grip_fl on the next line or it's a memory overwrite. (grip_fl (max (* (- 10.0 (abs FL_scrub)) (/ 1.0 10)) 0.0)) (grip_rl (max (* (- 10.0 (abs RL_scrub)) (/ 1.0 10)) 0.0)) (grip_fr (max (* (- 10.0 (abs FR_scrub)) (/ 1.0 10)) 0.0)) (grip_rr (max (* (- 10.0 (abs RR_scrub)) (/ 1.0 10)) 0.0)) (steering_angle_l (* steering_angle_FL 3.14159265)) (steering_angle_r (* steering_angle_FR 3.14159265)) (steering_angle (* (+ steering_angle_l steering_angle_r) 0.5)) (ang_v (* 0.5 (+ (abs FL_angvel) (abs FR_angvel)))) (FL_bump_kerb (* FL_bump_kerb kerb_scale)) (FR_bump_kerb (* FR_bump_kerb kerb_scale)) (load_front_read load_front_read) (load_front_count (+ load_front_count 1.0)) (load_front_read (if (- load_front_count 1000) load_front_read (+ FL_load FR_load))) (load_norm_front (if load_front_read load_front_read (+ FL_load FR_load))) (FL_load (* FL_load (/ (* 1100 0.5) load_norm_front))) (FR_load (* FR_load (/ (* 1100 0.5) load_norm_front))) (load_norm_front (* load_norm_front (/ (* 1100 0.5) load_norm_front))) ########################################################### # # Momentum Rack - If you copy this over in full or partly, or base a solution on the same general methods after seeing it, please credit "Momentum Rack" however used("included"/"extended"/"modified"/"based on"), I would be pleased - Thanks. # # Calculations have not been shortened on purpose. This makes it easier to understand what is going on. # # Momentum - handles each front wheel separately to calculate FFB when wheels are not in equal conditions. (angle_l_delta (- (smooth steering_angle_l 0.002) (smooth steering_angle_l 0.004) )) (angle_r_delta (- (smooth steering_angle_r 0.002) (smooth steering_angle_r 0.004) )) (angle_l_delta (+ angle_l_delta (* (smooth steering_angle_l 0.004) 0.05) )) (angle_r_delta (+ angle_r_delta (* (smooth steering_angle_r 0.004) 0.05) )) (left_m (* -10.0 angle_l_delta grip_fl (abs FL_angvel) 0.04 momentum_rack_scale)) (right_m (* -10.0 angle_r_delta grip_fr (abs FR_angvel) 0.04 momentum_rack_scale)) (max_resist 0.6) (left_m (/ left_m max_resist)) (right_m (/ right_m max_resist)) (x (* 10.0 (abs left_m))) (y (if (max (- x 9.0) 0.0) (- 10.0 (/ 1.0 (- x 8.0))) x)) (y (if (max left_m 0.0) y (* -1.0 y))) (left_m (* y 0.1)) (x (* 10.0 (abs right_m))) (y (if (max (- x 9.0) 0.0) (- 10.0 (/ 1.0 (- x 8.0))) x)) (y (if (max right_m 0.0) y (* -1.0 y))) (right_m (* y 0.1)) (left_m (* left_m max_resist)) (right_m (* right_m max_resist)) (left_m (* left_m (smooth FL_load 0.01))) (right_m (* right_m (smooth FR_load 0.01))) (rack_momentum (+ left_m right_m)) (rack_momentum (/ rack_momentum load_norm_front)) (rack_momentum (smooth rack_momentum 0.02)) # Car balance - uses load on each wheel to calculate balance (load_l FL_load) (load_r FR_load) (slope (- load_l load_r)) (slope (/ slope load_norm_front)) (slope (smooth slope 0.2)) # smooth to not allow fast changes through to balance (left_balance (* grip_fl (abs (cos steering_angle_l)))) (right_balance (* grip_fr (abs (cos steering_angle_r)))) (balance (* 0.5 (+ left_balance right_balance) slope balance_scale)) # Exaggerate front load calc (ex_front_load (min (max (+ 1.0 (* exaggerate_front_load_feel (- (/ (smooth (+ FL_load FR_load) 0.01) load_norm_front) 1.0))) 0.0) 1.1)) (ex_front_load_dampen (smooth ex_front_load 1.0)) (ex_front_load (/ ex_front_load ex_front_load ex_front_load_dampen)) ########################################################### # # Road features # # Road details (left_d (- FL_load (smooth FL_load 0.002))) (right_d (- FR_load (smooth FR_load 0.002))) (rack_details (* (+ (* left_d (+ 1.0 FL_bump_kerb)) (* right_d (+ 1.0 FR_bump_kerb))) 0.5 0.002)) # Road bumps (left_b (- FL_load (smooth FL_load 0.004))) (right_b (- FR_load (smooth FR_load 0.004))) (left_b (- left_b left_d)) (right_b (- right_b right_d)) (rack_bumps (* (+ (* left_b (+ 1.0 FL_bump_kerb)) (* right_b (+ 1.0 FR_bump_kerb))) 0.5 0.002)) # Road large features (left_l (- FL_load (smooth FL_load 0.01))) (right_l (- FR_load (smooth FR_load 0.01))) (left_l (- left_l left_b left_d)) (right_l (- right_l right_b right_d)) (rack_large (* (+ (* left_l (+ 1.0 FL_bump_kerb)) (* right_l (+ 1.0 FR_bump_kerb))) 0.5 0.002)) (reiza_rack_details (* (+ 1.0 FL_bump_kerb FR_bump_kerb) (- reiza_rack (smooth reiza_rack 0.002)))) (rack_details (blend (min 1.0 (/ vel_mag 10.0)) rack_details reiza_rack_details)) (details_lfb (min (+ 0.5 (* 0.5 (abs rack_momentum))) 0.7)) ########################################################### # # Scrub FX # # Scrub settings ------------------------------------------ (scrub_scale_master (* scrub_scale 30.0)) # Scrub scale (0.0 - 2.0) # Set to 0.0 to disable (scrub_scale_front 1.2) (scrub_scale_rear 0.7) # Scrub lambda (inversely proportional to frequency of effect) # Higher values give lower freq. Best range 1.1 - 1.8 (scrub_lambda_front 1.6) (scrub_lambda_rear 1.2) # Scrub Front (sf_s 0.55) (FL_scrub (soft_clip FL_scrub 2.0 0.0)) (FL_scrub (* (/ 1 (- 1.0 sf_s)) (max 0.0 (- FL_scrub sf_s)))) (FL_scrub (power FL_scrub 2.0)) (FL_scrub (* FL_scrub (oscillator scrub_lambda_front))) (FR_scrub (soft_clip FR_scrub 2.0 0.0)) (FR_scrub (* (/ 1 (- 1.0 sf_s)) (max 0.0 (- FR_scrub sf_s)))) (FR_scrub (power FR_scrub 2.0)) (FR_scrub (* FR_scrub (oscillator scrub_lambda_front))) (scrub_k 20000.0) (scrub_d 1.0) (scrub_scale_factor (* scrub_scale_master scrub_scale_front)) (FL_scrub (* scrub_scale_factor FL_scrub)) (FL_scrub (split FL_scrub 0.0 1.0 1.0 2.0 0.01)) (FL_scrub (spring FL_scrub scrub_k scrub_d 1.0)) (FR_scrub (* scrub_scale_factor FR_scrub)) (FR_scrub (split FR_scrub 0.0 1.0 1.0 2.0 0.01)) (FR_scrub (spring FR_scrub scrub_k scrub_d 1.0)) # Scrub Rear (sr_s 0.52) (RL_scrub (soft_clip RL_scrub 2.0 0.0)) (RL_scrub (* (/ 1 (- 1.0 sr_s)) (max 0.0 (- RL_scrub sr_s)))) (RL_scrub (power RL_scrub 2.0)) (RL_scrub (* RL_scrub (oscillator scrub_lambda_rear))) (RR_scrub (soft_clip RR_scrub 2.0 0.0)) (RR_scrub (* (/ 1 (- 1.0 sr_s)) (max 0.0 (- RR_scrub sr_s)))) (RR_scrub (power RR_scrub 2.0)) (RR_scrub (* RR_scrub (oscillator scrub_lambda_rear))) (scrub_k 20000.0) (scrub_d 1.0) (scrub_scale_factor (* scrub_scale_master scrub_scale_rear)) (RL_scrub (* scrub_scale_factor RL_scrub)) (RL_scrub (split RL_scrub 0.0 1.0 1.0 2.0 0.01)) (RL_scrub (spring RL_scrub scrub_k scrub_d 1.0)) (RR_scrub (* scrub_scale_factor RR_scrub)) (RR_scrub (split RR_scrub 0.0 1.0 1.0 2.0 0.01)) (RR_scrub (spring RR_scrub scrub_k scrub_d 1.0)) (scrub_effect (+ FL_scrub FR_scrub RL_scrub RR_scrub)) (scrub_effect (soft_clip scrub_effect 1.0 0.0)) ########################################################### # # Join, blend & LFB # (reiza_rack (smooth reiza_rack 0.004)) (reiza_rack (* reiza_rack reiza_rack_scale)) (speed_bias (max 0.0 (min 1.0 (/ vel_mag 10.0)))) (reiza_rack (blend speed_bias (drag (smooth reiza_rack 0.1) 0.0001 0.0) reiza_rack)) (momentum_pct (* 0.5 (+ (min grip_fl grip_fr) (min grip_rl grip_rr)))) (momentum_pct (* momentum_pct (- 1.0 min_reiza_rack))) (balance_pct (blend momentum_pct 0.5 1.0)) (reiza_pct (- 1.0 momentum_pct)) (reiza_pct (max reiza_pct (- 1.0 (min (/ vel_mag 50.0) 1.0)))) (rack_momentum (* rack_momentum ex_front_load)) (reiza_rack (* reiza_rack ex_front_load)) (rack_big (+ (* reiza_rack reiza_pct) (* rack_momentum momentum_pct) (* balance balance_pct))) (details_gamma (+ 1.0 (power details_lfb 2.2))) (rack_details (power rack_details (/ 1.0 details_gamma))) (rack_bumps (if lfb0Fix rack_bumps (blend bumps_lfb rack_bumps (lfb rack_bumps 0.15)))) (rack_large (if lfb0Fix rack_large (blend large_lfb rack_large (lfb rack_large 0.15)))) (rack_big (if lfb0Fix rack_big (lfb rack_big 0.15))) (rack_big (/ rack_big 0.9)) (x (* 10.0 (abs rack_big))) (y (if (max (- x 9.0) 0.0) (- 10.0 (/ 1.0 (- x 8.0))) x)) (y (if (max rack_big 0.0) y (* -1.0 y))) (rack_big (/ y 10.0)) (rack_big (* rack_big 0.9)) (rack (+ rack_big rack_large rack_bumps rack_details)) ########################################################### # # Rack friction # (steering_delta (- steering_pos osa)) (osa steering_pos) (steering_delta (* steering_delta 0.15)) (steering_delta_pos (max 0.0 steering_delta)) (steering_delta_neg (min 0.0 steering_delta)) (steering_delta_pos (if steering_delta_pos 1.0 0.0)) (steering_delta_neg (if steering_delta_neg -1.0 0.0)) (f (+ (* steering_delta_pos friction) (* steering_delta_neg friction))) (opposing (* steering_delta f)) (opposing (min opposing 0.0)) (f (if opposing 0.0 f)) (f (smooth f 0.005)) (rack (+ rack f)) ########################################################### # # Engine FX # (m (min (/ vel_mag 75.0) 1.0)) (engine_scale (blend m engine_scale_at_still engine_scale_at_speed)) (max_rps 8000.0) (rps_scale (/ crankshaft max_rps)) (rps_scale (power rps_scale 0.8)) (rps_scale (min rps_scale 0.02)) (rps_scale (max rps_scale 0.14)) (load_mult (smooth throttle 0.1)) (load_mult (max load_mult 1.0)) (engine_vibe (sin crankPos)) (engine_effect (* engine_scale load_mult engine_vibe rps_scale)) ########################################################### # # Road rumble # (m (min 1.0 (/ ang_v 200.0))) (o m) (rumble_effect (* road_rumble_scale (oscillator o) m)) ########################################################### # # Effects LFB # (engine_effect (if lfb0Fix engine_effect (lfb engine_effect 0.15))) (scrub_effect (if lfb0Fix scrub_effect (lfb scrub_effect 0.15))) (rumble_effect (* rumble_effect 2.0 fx)) (engine_effect (* engine_effect 0.8 fx)) (scrub_effect (* scrub_effect 0.8 fx)) (effects (+ engine_effect rumble_effect scrub_effect)) ########################################################### # # Final Rack & Effects Blending # (output (* gain (+ rack effects))) ########################################################### # # Scaler for info, no affect on output # (scale_window_init 10.0) (scale_window_nominal 2.0) (scale_soft_clear_t 10.0) (scale_min 0.2) (scale_max 2.0) (scale_blend_t 2.0) (signal_scale output 1.0 1.0 1.0 1.0 1.0 0.0 0.0 0.0) ########################################################### # # Light Damping # #pass thru same smoothing level as rackForce (damping_smooth (smooth rack_damping M_force_smoothing)) (rack_damping (if M_force_smoothing damping_smooth rack_damping)) (output (+ output (* rack_damping_scale rack_damping))) ########################################################### # # Clip # # Custom function to handle ffb before it clips. # Using direct signal up to 90%, then uses 1-(1/x) for compression zone(90%+). 10-(1/(x-8)) to offset to 9,9. (x (* 10.0 (abs output))) (y (if (max (- x 9.0) 0.0) (- 10.0 (/ 1.0 (- x 8.0))) x)) (y (if (max output 0.0) y (* -1.0 y))) (output (/ y 10.0)) ########################################################### # # Lock Stops # (stops (bumpstop wheel_dir 0.1 0.5 0.2 1.0)) (output (+ output (* stops custom_lock_stop))) ########################################################### # # Statistics output # (histogram output) (info2 output)