Author: mtowarek01
Version: v1.0.0 (Ultimate Monolith, Zero Stutter & Top Gear Fix)
FH6SmartShift is an advanced C# telemetry plugin for SimHub and a dedicated racing dashboard designed specifically for the Forza Horizon 6 physics engine.
Unlike simple scripts that only average rev-limiter bounce RPM, FH6SmartShift builds a real-time (60 Hz) engine profile based on a 401-band Virtual Dyno. By capturing raw UDP data from the game β including engine power (Power), torque (Torque), boost pressure (Boost), wheel rotation speeds (WheelRotationSpeed), longitudinal and lateral tire slip (TireSlipRatio, TireSlipAngle), and suspension travel β the plugin calculates transmission gear ratios and finds the exact power curve intersection point between consecutive gears (Gears 1β10).
Additionally, the system provides chassis dynamics telemetry for RWD and AWD vehicles: a power oversteer warning (PowerOversteerWarning), a counter-steering indicator (IsCounterSteering), and a safe downshift calculator that accounts for braking force and front-axle dive (DbgChassisDive).
- 401-Band Virtual Dyno (
PowerMap,TorqueMap,BoostMap): Sampling takes place exclusively near wide-open throttle (Accel >= 242on a0β255scale, i.e., ~95% throttle) and at power levels above5000 W. The range up to20,000 RPMis divided into 401 bands in50 RPMincrements and smoothed using an adaptive EMA filter (alpha = max(1/samples, 0.05)). - Power Curve Intersection Algorithm (
EvaluateAllMathIntersections): Every0.20 s(when data has changed), the algorithm compares the smoothed telemetry engine power in the current gear (pNowatrRPM) against the power after upshifting to the next gear (pNextat landing RPMr * dropRatio). If the engine is turbocharged (Boost > 0.1) and the expected boost pressure after the gear change drops below70%of the current boost,pNextis adjusted by a0.85multiplier. A shift point is confirmed as mathematically optimal(P)when, forr >= RpmAtMaxPower, the conditionpNext >= pNow * 1.015(1.5% power advantage) is met across 6 consecutive 25 RPM steps (or 2 steps near the end of the mapped ceiling), and the sample density in the target band is at least 85%. - Autonomous Gear Ratio Learning (
RpmPerRadS): TheCurrentEngineRpm / avgWheelSpeedratio is recorded whenAccel >= 242, with no braking (Brake < 5.0), slip across all wheels< 0.10, wheel speed> 20 rad/s, and engine speed> 1000 RPM. Samples are stored in a 25-element circular buffer, and median calculation and ratio confirmation occur once a minimum of 15 samples are collected. The system verifies gear ratio monotonicity and automatically resets the transmission data upon detecting inconsistencies (e.g., after a tuning change). - Hidden Limiter Detection (
GhostLimiterRpm): Detects situations where a power cut (powerRatio < 0.85or an RPM drop_currentRpmAccel < -150 RPM/sfor at least0.05 s) occurs aboveRpmAtMaxPower + 100, but before the nominalEngineMaxRpm. After hitting the same band twice (Β±150 RPM), the plugin locksGhostLimiterRpmand purges contaminated power bands (CleanUpContaminatedBands). If the engine subsequently exceedsGhostLimiterRpm + 150 RPMwith rising RPM for0.10 s, the ghost limiter lock is automatically removed. - Multi-Layer Physics Filters (
filtersOk): Writing to the power map is paused whenever any of the following conditions occur:- Any wheel leaves the ground (
NormalizedSuspensionTravel <= 0.02). - Driving into a puddle (
WheelInPuddleDepth > 0.01on any wheel). - Vehicle damage (
Damage1 > 0.05orDamage2 > 0.05). - Sudden rear suspension rebound (
|ΞSuspensionTravelMetersRear| > 0.08 mbetween frames for the RL or RR wheel β the front axle is not covered by this filter). - Surface vibration (
SurfaceRumble > 0on any wheel). - Clutch or handbrake engagement (
Clutch >= 2.0orHandBrake >= 2.0), or post-shift stabilization time (0.30 supshift,0.50 sdownshift,0.15 sclutch). - Exceeding the
tractionOkthreshold: driven wheel longitudinal slip>= 0.65(gears 1β3) or>= 0.40(gears 4+), or slip angle>= 0.25.
- Any wheel leaves the ground (
- Downshift & Climb Assistant (
Downshift&_climbDownshiftActive): The safe downshift threshold (DownshiftTriggerRpm) is raised proportionally to braking force (up to+600 RPM) and dynamic front-axle dive (DbgChassisDive, up to+250 RPM), but capped by a hard ceiling of(actualLimiter - 150) * dropFromPrev. An independent_climbDownshiftActivealgorithm suggests a downshift while driving under load when:Accel >= 230(~90% throttle), the speed trend is<= +1.0 km/h/s(decelerating or maintaining constant speed), power in the lower gear is higher by at least 5% (pLand > pNow * 1.05), post-downshift RPM is at least300 RPMbelow the lower gear's shift point, and driven wheel slip does not exceed0.15. - Memory & Data Persistence Optimization: Dyno computation arrays are statically pre-allocated. Reading telemetry from SimHub executes ~53
GetPropertyValuecalls per frame (with primitive type boxing overhead). Disk saving takes place asynchronously every15 sminimum (when data has changed): the plugin performs a deep copy of all car dictionaries (CloneCarStore) inside alockstatement and offloads the JSON serialization itself to a backgroundTask.Runthread, eliminating race stutters.
βββ FH6SmartShift.cs # Full C# source code of the plugin
βββ FH6SmartShift.csproj # .NET Framework 4.8 (C# 7.3) project file with DeployToSimHub target
βββ FH6SmartShift.dll # Compiled library ready to be pasted into SimHub
βββ FH6SmartShift_Dashboard_EN.jpg # Annotated dashboard infographic
βββ DashTemplates.ZIM # Folder containing the dedicated SimHub dashboard
βββ README.md # Online repository documentation
βββ README.pdf # Printable offline user manual & property reference
- Main database file:
C:\Program Files (x86)\SimHub\PluginsData\Common\FH6SmartShift_fh6SmartShiftingData.json - Automatic backups: Upon SimHub startup, the plugin creates a daily backup in the
PluginsData\Common\directory namedFH6SmartShift_fh6SmartShiftingData.json.bak_yyyyMMddand retains the 3 most recent copies, automatically deleting older ones.
- Completely close SimHub (the running application locks
.dllfiles). - Copy
FH6SmartShift.dlldirectly into the main SimHub directory (by defaultC:\Program Files (x86)\SimHub\). - Launch SimHub and enable the FH6SmartShift plugin in the prompt dialog.
- Import the contents of the DashTemplates.zip archive into SimHub Dash Studio (by double-clicking the
.simhubdashfile or copying the folder toC:\Program Files (x86)\SimHub\DashTemplates\). - In Forza Horizon 6 settings (HUD and Gameplay -> Data Out), enable UDP telemetry and configure the IP address and port to match SimHub.
- Install the .NET SDK with support for .NET Framework 4.8 (
net48). - If SimHub is installed in a location other than
C:\Program Files (x86)\SimHub\, set theSIMHUB_INSTALL_PATHenvironment variable. - Close SimHub and run the following command in the repository directory:
dotnet build FH6SmartShift.csproj -c Release
- The
DeployToSimHubtarget embedded in.csprojwill automatically copy the resulting.dllfile into the SimHub directory.
When you drive a car (or apply a new tune) for the first time, all gears in the matrix start as red (-) (unmapped):
- Find a flat straight with good grip (dry tarmac, no puddles or heavy kerbs).
- Pull each gear at full throttle (WOT) all the way to the rev limiter and hold it briefly until the gear indicator turns Blue
(R)(Ratio Locked). - Upshift to the next gear (
N+1) and repeat: Pulling each gear to the limiter ensures two things at once β it locks the transmission ratio(R)and populates the Virtual Dyno power bands all the way to redline (100%mapping progress). - Automatic Confirmation: As soon as the next gear (
N+1) locks its ratio(R), the previous gear (N) will automatically calculate the power intersection and turn Green(P)(Math Optimal) or Green(L)(Limiter Optimal).
Below is a detailed breakdown of how each element on the included dashboard operates, fully aligned with the underlying C# code logic:
- Top LED Bar (12-Segment Shift Light): Bound to
[FH6SmartShift.RevLimiterProximity]. Progression from0.0to1.0is calculated starting from 75% of the range between idle RPM (EngineIdleRpm) and the unbuffered shift point (visualTrigger). The moment RPM reachesShiftTriggerRpm(reduced by a dynamic driver reaction-time buffer β up to1500 RPMearlier in gears 1β2 and up to600 RPMin gears 3+) at throttleAccel >= 230, the plugin immediately forces a value of1.0. A full LED bar means: "shift now (accounting for your reaction time)". - Dashboard Warning Background (Background Shift Flash): Bound to
RevLimiterProximity == 1.0. Changes background color when the lead-time shift signal activates. - Central Instrument Cluster (Gear
1, Speed51, RPM5055): Displays currently engaged transmission gear (center), current speed (left), and live engine RPM (right). - Mapping Progress Indicator (
100.0): Bound to[FH6SmartShift.LiveMappingProgress]. Shows the percentage of populated power buckets frommax(1000, 0.50 * RpmAtMaxPower)up toactualLimiter - 250 RPM. (Note:[FH6SmartShift.MapCoverageBar]scans all the way toactualLimiterwithout subtracting 250 RPM). SLIPIndicator (Slip / G-Force Warning): Bound to[FH6SmartShift.IsGripLost]. Illuminates yellow when combined lateral/longitudinal G-force exceeds1.25 Gor driven wheel longitudinal slip exceeds0.30. (Note: Dyno writing is gated separately bytractionOk, which permits slip up to0.65in gears 1β3 and0.40in gears 4+).- Orange Counter-Steer Bar (Bottom of Screen): Bound to
[FH6SmartShift.IsCounterSteering]and[FH6SmartShift.CounterSteerSeverity]. Active exclusively in RWD and AWD cars above20 km/hwhenOversteerSeverity > 0.30, steering input|Steer| / 127.0 > 0.15, yaw velocity|AngularVelocityY| > 0.30, and steering direction is opposite to yaw rotation. Never activates in FWD cars. - System Clock (
18:33): Displays current local system time in the bottom-left corner. - Gears 1β10 Calibration Matrix (Right Side of Screen): Bound to
Gear1Text..Gear10TextandGear1Color..Gear10Color.- How to teach a gear: Accelerate at full throttle (WOT) and pull the gear all the way to the rev limiter until it turns Blue
(R). Once you shift up and lock the next gear (N+1), the previous gear will automatically turn Green(P)or(L). - Behavior in menus & pause: When paused or in garage menus (
IsRaceOn == 0),ResetOutputs()turns all gears red(-)(#E74C3C) until you return to the road.
- How to teach a gear: Accelerate at full throttle (WOT) and pull the gear all the way to the rev limiter until it turns Blue
| Designation | Color | Hex Code | Actual Condition in C# Code |
|---|---|---|---|
N: (P) |
π’ Green | #4CAF50 |
Peak Optimal (IsConfirmed && IsMathOptimal): Confirmed power curve intersection with gear N+1 (pNext >= 1.015 * pNow) and target band density >= 85%. |
N: (L) |
π’ Green | #4CAF50 |
Limiter Confirmed (IsConfirmed && TriggerIsGhost): Appears when (1) GhostLimiterRpm > 0 is detected near ceiling (validCeiling >= actualLimiter - 300), or (2) highest known gear (!hasHigherGear) was revved at WOT (Accel >= 242) to actualLimiter - 100 RPM. |
N: (L?) |
π Orange | #F39C12 |
Edge / Unconfirmed Limit (TriggerIsEdge): Power curves did not intersect before cutoff on a gear with N+1 available, and no ghost limiter was detected. Provisional trigger: actualLimiter - 250 RPM. |
N: (P?) |
π‘ Yellow | #F1C40F |
Unconfirmed Trigger (PowerPeakCaught && ShiftTriggerRpm > 0): Gear has a saved threshold (ShiftTriggerRpm > 0), but lost confirmation (IsConfirmed == false) and is not flagged as TriggerIsEdge. |
N: (R) |
π΅ Blue | #3498DB |
Ratio Locked (RpmPerRadS > 0): Gear ratio learned (at WOT, >= 15 samples), waiting for gear N+1 ratio or top-gear WOT run to limiter. |
N: (-) |
π΄ Red | #E74C3C |
Unmapped / Paused: Gear has no learned ratio yet, memory was reset, or game is paused/in menu (IsRaceOn == 0). |
| Property | Type | Exact Behavior in Code |
|---|---|---|
MaxUsableRpm |
double |
Returns the exact same value as ShiftTriggerRpm. Retained for backward compatibility. |
ShiftTriggerRpm |
double |
Shift Light activation point reduced by the smoothed driver reaction-time buffer (realCurrentShift - liveBuffer, capped at actualLimiter - 50). |
OptimalShiftRpm |
double |
Returns mathematical shift point for (P) gears. Returns actualLimiter - 250 for (L?), ShiftTriggerRpm - 50 for (L), and actualLimiter - 50 when unmapped. |
DownshiftTriggerRpm |
double |
Safe downshift RPM threshold increased by braking and front-end dive corrections (DbgChassisDive), capped at (actualLimiter - 150) * dropRatio. |
RevLimiterProximity |
double |
0.0β1.0. Rises linearly toward visualTrigger, jumping to 1.0 upon reaching buffered ShiftTriggerRpm at Accel >= 230. |
LiveMappingProgress |
double |
Percentage (0.0β100.0) of populated power bands from max(1000, 0.5 * RpmAtMaxPower) to actualLimiter - 250. |
MapCoverageBar |
string |
20-character progress bar [ββββββββββββββββββββ] from max(1000, 0.5 * RpmAtMaxPower) to actualLimiter (refreshed every 0.5 s). |
EngineMapStatus |
string |
"OK" when LiveMappingProgress >= 95.0, otherwise "LEARN". |
RpmAtMaxPower |
double |
RPM at which the highest smoothed engine power was recorded. |
RpmAtMaxTorque |
double |
RPM at which the highest smoothed engine torque was recorded. |
CurrentCarKey |
string |
Vehicle and tuning identifier: {CarOrdinal}_PI{PI}_DT{Drivetrain}_R{RoundedMaxRpm}. |
IsLearningComplete |
bool |
true when current gear has IsConfirmed == true ((P), (L)) or TriggerIsEdge == true ((L?)). |
IsTopGear |
bool |
true when currentGear >= 5, ratio is learned and confirmed, and it is the highest known gear (or next gear has dropRatio >= 0.88). |
IsDownshiftSafe |
bool |
true when currentGear > 1 and currentRpm <= DownshiftTriggerRpm. |
IsDownshiftSuggested |
bool |
true when RPM drops to <= DownshiftTriggerRpm - 250 (above 10 km/h) or _climbDownshiftActive is triggered. |
IsTractionGood |
bool |
true when driven wheel slip is < 0.65 (gears 1β3) or < 0.40 (gears 4+) and slip angle is < 0.25. |
IsGripLost |
bool |
true (SLIP indicator) when combined G-force > 1.25 G or driven wheel slip > 0.30. |
PowerOversteerWarning |
bool |
true for RWD/AWD in gear >= 1 when Accel >= 230 and rear combined slip > 0.6. |
OversteerSeverity |
double |
0.0β1.0 rear-axle slip scale for RWD/AWD above 20 km/h (70% rear slip angle > 0.12, 30% combined slip > 0.65). |
IsCounterSteering |
bool |
true when CounterSteerSeverity > 0.10 (never activates for FWD cars). |
CounterSteerSeverity |
double |
Smoothed (tau = 0.08 s) 0.0β1.0 steering input above 15% threshold during counter-steering. |
BodySlipAngle |
double |
Chassis slip angle in degrees calculated from VelocityX vs abs(VelocityZ) (above 5 km/h). |
AeroBottomingWarning |
bool |
true when any damper reaches NormalizedSuspensionTravel >= 0.98 above 200 km/h. |
Gear1Text..Gear10Text |
string |
Status text labels for gears 1β10. |
Gear1Color..Gear10Color |
string |
Status Hex color codes for gears 1β10. |
Dbg_ChassisDive |
double |
Dynamic front-end dive relative to _staticChassisDiveBase. |
Dbg_GhostLimiter |
double |
Detected GhostLimiterRpm ceiling (0 if not detected). |
Dbg_GhostCandidate |
double |
Current hidden limiter candidate prior to second-hit confirmation. |
Dbg_GhostHits |
int |
Hit counter for the hidden limiter candidate. |
Dbg_SteerRaw / Dbg_YawRaw |
double |
Raw steering (Steer) and yaw velocity (AngularVelocityY) values. |
FH6SmartShift.ResetPowerMemoryβ Clears the engine map, gear ratios, and shift points for the current car.FH6SmartShift.ResetGearRatiosβ Clears only the gear ratios and shift points for the current car while preserving the engine power map (useful after adjusting gear ratios in the tuning menu).FH6SmartShift.ResetLimitGearsβ Clears only non-optimal shift points (!IsMathOptimal, i.e.,(L)and(L?)) for the current vehicle.FH6SmartShift.ResetAllCarsMemoryβ Complete database reset for all saved cars.
- Electric Vehicles (EVs) and 1β4 Speed Transmissions:
- The
IsTopGearflag requires a hard condition ofcurrentGear >= 5, meaning it will never evaluate totruein cars with 1 to 4 gears. - Single-speed EVs do not have a subsequent gear (
N+1), and their flat upper-RPM power curve can triggerGhostLimiterRpm.
- The
- No Counter-Steer Indicator Activation in FWD Cars:
- Due to the
drivetrainType == RWD || AWDcondition,OversteerSeverity,IsCounterSteering, andCounterSteerSeverityalways remain0/falsein FWD vehicles.
- Due to the
Distributed under the GNU General Public License v3.0 (GPLv3).
If FH6SmartShift helped you shave tenths off your lap times and dial in your gear ratios in Forza Horizon 6, you can support the project's development:
π Support the creator on Buy Me a Coffee (https://buymeacoffee.com/mtowarek01d)
