[GUIDE] [1.19.2.1] Vehicle physics explained.

Forum rules
SCS as a company do not wish to have paid mods on this forum. While we understand that not all paid mods use the Intellectual Property of other companies/people, it is very hard to moderate what is and isn't acceptable when money is involved. There are also concerns that it could look unfavorable to potential work partners going forward if SCS allow mods that may potentially use unlicensed branding.
Posting in the Mods forum (ATS and ETS2) is restricted to sharing free-to-the-public mods and providing support for mods. For more details, please check chapters [4] and [5] of Forum Rules.

What are your thoughts on this thread and threads like it?

I appreciate and support this fully
123
97%
I appreciate it but i already knew these things
2
2%
I am indifferent
0
No votes
I already knew and don't appreciate it
0
No votes
I don't appreciate this at all
0
No votes
Other / Abstain
2
2%
 
Total votes: 127

User avatar
Cadde
Posts: 9535
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

[GUIDE] [1.19.2.1] Vehicle physics explained.

#1 Post by Cadde » 27 Aug 2015 06:20

This thread is intended as a community project thread. That means, all moderators and admins are free to edit this and any reserved posts if new information arises from the community.
The thread/post might start off very basic and eventually grow to cover all aspects of the subject.

This thread assumes users know how to work with mods.
The basic guide can be found here: viewtopic.php?f=172&t=189533

This guide was written for the game version that can be seen in the threads title/subject, but generally should apply to later versions of the game as well unless specifically changed.
You can find out what's been changed by checking the respective patch guides in the link above.

------------------------------ END HEADER ------------------------------

Vehicle Physics Explained

Vehicle (truck in this case) physics are modifiable by the end user.
You can change how the drivetrain behaves, engine power, road handling characteristics, suspension characteristics and much much more.
Here i will try to explain how to do a few of the most simple modifications in the definition. (.sii files)

This guide assumes you are capable of reading, working with a text editor and creating a mod archive as well as being capable to fill in the blanks and have a general understanding of (game driven) physics.
If you lack any of those capabilities then i suggest you research those topics at a basic level before proceeding.

If you are looking to alter how your truck behaves on the road, here are the files that affect it.

I suggest selecting all lines within a code block and copying it to your favorite text editor and turn on C++ code highlighting or equivalent. I recommend Notepad++.

def.scs: /def/vehicle/physics.sii - Global settings for the games physics. Applies to all trucks driven by the player.
(the contents of this code block has been edited to focus on the actual parameters within, see the game extracted version for original)

Code: Select all

SiiNunit
{
// From ETS 2 version 1.19.2.1 in "def.scs" at "/def/vehicle/physics.sii"

// File contents commented by Cadde. Please bare in mind that none of the comments within are SCS Software official comments.
// The accuracy/correctness of comments might be off. Please verify the correctness of the comments before making assumptions that they indeed are correct.
// Most of these comments are my "best" guesses and some are from personal experience. I have marked those i am really unsure about explicitly.

// This file can be used directly in a mod. But be mindful of the version at the top.
// If settings are added/removed in later game versions this file should be made up to date with the new information before use.

// I recommend viewing this file in notepad++ (https://notepad-plus-plus.org/) and pressing Language -> C -> C++ in the menu.
physics_data: .phdata
{
    // =========================================================================================================================================================
    //  FILE SETTINGS
    // =========================================================================================================================================================
    
    // Version of the structure used by the game to reduce some mod compatibility issues.
    version: 2

    // =========================================================================================================================================================
    //  STEERING
    // =========================================================================================================================================================
    
    // These coefficients are used for computing autocentering wheel speed.
    // The faster vehicle moves and the more steering wheel is turned left or right, the higher autocentering speed is.
    // Returning speed coefficient is computed by multiplication of both speed and angle coefficients.
    // When result coefficient is 1, returning speed is exactly the same as full turning speed.
    // This balance points define natural limits of steering dependent on vehicle speed.
    steering_speed_coef:    4.0                         // Default: 4.0,    For 100km/h velocity (linear raise).
    steering_angle_coef:    2.0                         // Default: 2.0,    For maximum wheel turn (30degrees, linear raise).
    steering_ratio_coef:    0.95                        // Default: 0.95,   Defines upper limit of result coefficient (ratio against player).

    // Maximum allowed rotation of the front wheels. (degrees)
    // This affects your turning radius/turning circle.
    max_visual_rotation:    35                          // Default: 35

    // Base steering sensitivity depending on truck speed.
    // The relationship is exponential between 0 km/h and 100 km/h. Formula currently unknown but assumed to be log10.
    // Used only with relative steering (keyboard, joypad).
    steering_sensitivity_multiplier_0kmh:       1.0     // Default: 1.0
    steering_sensitivity_multiplier_100kmh:     0.4     // Default: 0.4
    steering_sensitivity_multiplier_minimum:    0.2     // Default: 0.2     At speeds > 100 km/h, to prevent zero or negative sensitivity.
    steering_sensitivity_multiplier_maximum:    10.0    // Default: 10.0    Reversing max sensitivity multiplier.

    // =========================================================================================================================================================
    //  TRAILER BEHAVIOR / PHYSICS
    // =========================================================================================================================================================

    // Maximum allowed relative angles in degrees between truck and trailer at the fifth wheel
    fifth_wheel_pitch:      20                          // Default: 20,     Pitch determines how high/low the trailer goes in the forward direction.
    fifth_wheel_roll:       0                           // Default: 0       Roll is how far the trailer can twist along the forward direction.

    // =========================================================================================================================================================
    //  BRAKES
    // =========================================================================================================================================================
    
    // Braking difficulty in bad weather where 0 is full friction (dry and sticky asphalt) and 1 is no friction (as if you were floating mid air)
    rain_braking_difficulty:        0.2                 // Default: 0.2,    By default, you have 80% grip in rain.
    snow_braking_difficulty:        0.6                 // Default: 0.6,    Snow is currently not used in game, only in map mods.

    // Brake torque
    brake_torque_factor:            1.0                 // Default: 1.0,    Overall brake strength. There's also a slider in game options.
    braking_curve_peak_rel:         6.0                 // Default: 6.0,    Brake strength multiplier at low (6 km/h default) speed.
    brake_characteristic_rpm:       250.0               // Default: 250.0,  Where the braking curve bends. (Default 250 RPM = 6 km/h)
    brake_balance:                  1.1                 // Default: 1.1,    Front brakes are this much stronger than rear brakes.
    
    // Brake temperature
    max_brake_temperature:          200.0               // Default: 200.0,  Beyond this temperature (in deg celsius) the brakes start to fade.
    brake_cooling_rate:             0.01                // Default: 0.01,   Brakes cooling factor.
    brake_friction_warming_rate:    4.0                 // Default: 4.0,    Brakes warming factor.

    // =========================================================================================================================================================
    //  CABIN PHYSICS
    // =========================================================================================================================================================
    
    // Cabin movement limits.
    cabin_max_pitch_angle_front:        8.0             // Default: 8.0,    Maximum cabin forward angle. (Movement when braking/impacting)
    cabin_max_pitch_angle_rear:         8.0             // Default: 8.0,    Maximum cabin backward angle. (Movement when accelerating/hit from behind)
    cabin_max_roll_angle:               8.0             // Default: 8.0,    Maximum cabin side to side angle. (Movement when turning/hit from the side)

    // Cabin suspension. How the cabin moves depending on input forces and current cabin pitch/roll.
    // Springs fully compressed (cabin max pitch/roll) has a greater effect than springs in their "relaxed" (cabin centered) state.
    // Damping is consistent, stopping any movements from continuing.
    cabin_pitch_force_scaling_factor:   1.0             // Default: 1.0,    Spring force on forward/back motions. (Spring determines return speed/acceleration)
    cabin_pitch_damping_factor:         1.0             // Default: 1.0,    Damping on forward/back motions. (Slows sudden/fast movements down)
    cabin_roll_force_scaling_factor:    1.0             // Default: 1.0,    Spring force on side to side motions. (Spring determines return speed/acceleration)
    cabin_roll_damping_factor:          1.0             // Default: 1.0,    Damping on side to side motions. (Slows sudden/fast movements down)

    // Cabin mass. How heavy the cabin is, affects how much it responds to other massive objects and acceleration/braking forces.
    // Possibly (not confirmed) also affects truck physics as a whole. A very heavy cabin could make the truck tilt/flip in turns or when braking hard.
    cabin_mass:                         300.0           // Default: 300.0,  In kilograms.
    
    // =========================================================================================================================================================
    //  WHEEL AND CHASSIS PHYSICS
    // =========================================================================================================================================================
    
    wheel_mass:                         100.0           // Default: 100.0,  Weight of each wheel on the truck in kilograms.

    // Wheel (tyre) damping factors.
    // Mind you, the game treats wheels (tyre and rim) as one solid object and they don't visually deform. Instead they float/sink through the ground.
    // These settings define how the wheels behave in this respect and a wheel that is "compressed" might have more grip on the surface where
    // a wheel that is "floating" or "not compressed" has less resistance.
    damping_scaling_front_factor:       1.0             // Default: 1.0,    Front tyre damping (deformation resistance) factor.
    damping_scaling_rear_factor:        1.0             // Default: 1.0,    Rear tyre damping (deformation resistance) factor.
    damping_scaling_trailer_factor:     1.0             // Default: 1.0,    Trailer tyre damping (deformation resistance) factor.

    // Sway bar stiffness. Affects how the truck handles while cornering, a stronger factor (not confirmed) makes the truck more resistive to "twisting" in
    // corners. Wheras a weaker factor makes the chassis* bend/twist more easily.
    // This factor is directly (assumption) related to wheel damping factors above and would affect your cornering performance.
    // Think of it like this: A higher factor = Formula 1 vehicle, a lower factor = old 50's muscle car.
    sway_bar_stiffness_factor:          1.0             // Default: 1.0

    // =========================================================================================================================================================
    //  ENGINE AND TRANSMISSION CHARACTERISTICS
    // =========================================================================================================================================================
    
    // Engine compression factor. Higher values makes engine slow truck down more when not given throttle and in gear.
    // Assumed non linear effect, higher RPM means higher effect over time.
    thrust_characteristic_viscosity_factor:     1.0     // Default: 1.0,    Intensity of engine braking. (not using motor/exhaust/jake brake)
    
    // Transmission resistance. Higher values increases losses in transmission.
    // Assumed non linear effect, higher transmission RPM means more losses.
    transmission_viscosity_factor:              1.0     // Default: 1.0,    Transmission resistance (friction/losses) factor.
    
    // Retarder resistance. Higher values makes retarder more effective at slowing the transmission rotational speed down.
    transmission_viscosity_retarder_factor:     1.0     // Default: 1.0,    Retarder resistance (friction) factor.
    
    // Flywheel resistance. Higher values makes the flywheel (and thus engine RPM) drop faster.
    // Decreasing this makes the engine maintain RPM when not in gear (connected to transmission) for longer.
    wheel_viscosity_factor:                     1.0     // Default: 1.0,    Flywheel resistance (RPM loss) factor.
    
    // Clutch strength. Higher value makes clutch stronger, RPM needle doesn't fluctuate when in gear.
    // Affects both manual and automatic gearboxes.
    // The first value affects the engine->transmission connection when taking off or changing gears. Do not set too high or automatic gearbox might fail.
    // The second value affects the engine->transmission connection when revs match, a higher value prevents RPM needle moving when in full throttle or not.
    clutch_viscosity_factor:                    1.0     // Default: 1.0,    When using clutch / automatic gearbox is taking off / changing gear.
    clutch_connected_viscosity_factor:          1.0     // Default: 1.0,    When clutch is up and transmission RPM is matching engine RPM.
    
    // Relative magnitude of flywheel inertia. (Unknown)
    inertia_scaling_const:                      1.0     // Default: 1.0,    Relative flywheel magnitude factor. (Unknown)
    
    // Transmission inertia relative to the flywheel. Assumed how much faster/slower the transmission RPM increases/decreases in relation to engine flywheel.
    transmission_rel_flywheel_inertia:          0.5     // Default: 0.5,    Flywheel inertia factor.

    // approximate air resistance. How much resistance the truck experiences at higher speeds.
    air_resistance:                             3.0     // Default: 3.0,    Formula: resistant_force = air_resistance * sqr(speed)

    // =========================================================================================================================================================
    //  TYRE FRICTION CHARACTERISTICS
    // =========================================================================================================================================================
    // These settings are probably directly related to those in the "WHEEL AND CHASSIS PHYSICS" section above.
    // I am keeping them down here for legacy reasons, modders will find these values at the bottom of the original file.
    
    // Stiffness of tyre material. Affects how the tyre (wheel) retains contact with the road surface.
    bristle_stiffness_longitudinal_factor:      1.0     // Default: 1.0,    How good the tyre is at maintaining contact in the forward direction.
    bristle_stiffness_lateral_factor:           1.0     // Default: 1.0,    How good the tyre is at maintaining contact in the side to side direction.
    
    // Damping of tyre deformation. Affects how the tire reacts to sudden changes/jolts.
    // Higher values makes the tyre harder / more resistive to sudden changes. (Think go-kart)
    // Lower values makes the tyre softer / less resistive to sudden changes. (Think off-road / hill climbing / trailblazing tyre)
    bristle_damping_longitudinal_factor:        1.0     // Default: 1.0,    Forward direction.
    bristle_damping_lateral_factor:             1.0     // Default: 1.0,    Side to side direction.
    
    // Tyre slipping factors. How tyres behave when they lose contact with the road surface.
    // When a tyre (assuming a sound physics model) is slipping it will lose gripping force, causing more slipping to occur the more force is applied.
    // Assumedly, these settings affect how that (exponential) curve is defined. Raising/lowering the values makes the tyre more/less forgiving when
    // exceeding their grip level.
    slip_longitudinal_factor:                   1.0     // Default: 1.0,    Forward direction.
    slip_lateral_factor:                        1.0     // Default: 1.0,    Side to side direction.

}    
}
def.scs: /def/vehicle/truck/<truck brand>/<chassis type>.sii - Chassis specific settings.
(the contents of this code block has been edited to focus on the actual parameters within, see the game extracted version for original)

Code: Select all

SiiNunit
{
// From ETS 2 version 1.19.2.1 in "def.scs" at "/def/vehicle/truck/scania.r/chassis/4x2.sii"

// File contents commented by Cadde. Please bare in mind that none of the comments within are SCS Software official comments.
// The accuracy/correctness of comments might be off. Please verify the correctness of the comments before making assumptions that they indeed are correct.
// Most of these comments are my "best" guesses and some are from personal experience. I have marked those i am really unsure about explicitly.

// This file can be used directly in a mod. But be mindful of the version at the top.
// If settings are added/removed in later game versions this file should be made up to date with the new information before use.

// I recommend viewing this file in notepad++ (https://notepad-plus-plus.org/) and pressing Language -> C -> C++ in the menu.

// This particular file is from "/def/vehicle/truck/scania.r/chassis/4x2.sii" in the game extracts.
// You must change the 4x2.scania.r.chassis bit of this line to conform with the chassis you are editing/adding.
accessory_chassis_data : 4x2.scania.r.chassis
{
    // Dealership / truck service settings.
    // These values does NOT affect the physics or performance of the chassis.
    name: "@@chassis@@ 4x2"                 // Name of the chassis. @@chassis@@ is a localization string, it changes depending on the language selected in game.
    price: 26520                            // Price of the chassis in Euro.
    unlock: 0                               // Required level before being able to purchase chassis.
    icon: "chassis_scania_r_4x2"            // Name (without extension) of the .mat file in the "/material/ui/accessory" folder describing the icon/image to be shown next to the chassis.
        
    info[]: "4x2"                           // Extra details about the chassis.
    info[]: "700 + 700 @@unit_l@@"          // Each entry is connected to a specific field in the information about the purchase. In this case, it explains that the chassis comes with two fuel tanks with 700 liters (@@unit_l is localization for liters as a unit of volume) of fuel each.
    
    // Chassis visual model details.
    detail_model: "/vehicle/truck/scania_rcab_2009/truck.pmd"       // The model of the chassis as seen up close. Usually part of a whole truck model with the variant specified in a setting below.
    model: "/vehicle/truck/scania_rcab_2009/lod_01.pmd"             // The model of the chassis as seen from some distance. Usually part of a whole truck model with the variant specified in a setting below.
    lods[]: "/vehicle/truck/scania_rcab_2009/lod_02.pmd"            // The model of the chassis as seen from further distance. Usually part of a whole truck model with the variant specified in a setting below.
    lods[]: "/vehicle/truck/scania_rcab_2009/lod_03.pmd"            // Adding more entries here defines what model to use at further lod distances. Usually part of a whole truck model with the variant specified in a setting below.
    collision: "/vehicle/truck/scania_rcab_2009/truck.pmc"          // The collision mesh of the chassis model. Usually part of a whole truck model with the variant specified in a setting below.
    look: default                                                   // The look to use in the assigned model. (Read up on how looks and variants work elsewhere)
    variant: chs_4x2                                                // The variant to use in the assigned model.
    
    // Total fuel capacity of this chassis.
    tank_size: 1400         // Default: 1400,   In liters.
    
    // Shadow details. A mesh and texture that defines the "soft" shadows cast by this chassis. Look at a truck in game and you will see two different shadows...
    // One shadow is defined in the detail and lod model(s) and is cast from the geometry of the truck. Lod models cast very simple shadows for performance reasons.
    // The other shadow sits right under the truck and is more like a smooth blob.
    ui_shadow: "/vehicle/truck/scania_rcab_2009/ui_shadow_4x2.pmd"              // The mesh used to show the shadow under the chassis.
    extended_shadow_texture: "/vehicle/truck/scania_rcab_2009/shadow_4x2.tobj"  // Absolute path to the shadow texture object (.tobj) file that defines the shadow texture.
    extended_shadow_intensity: 1.05                                             // Default: 1.05,   Shadow intensity, increasing this value makes the shadow stronger / darker.
    extended_shadow_fadeout_start: 10                                           // Default: 10,     How far away the shadow starts to fade out. Increasing this value makes this shadow visible at further distances but affects performance.
    extended_shadow_fadeout_length: 0                                           // Default: 0,      Over what range this shadow fades out. A value of 0 means the shadow pops in/out of existence and a value > 0 makes the shadow fade away seamlessly after fadeout_start. (Performance warning, fading can be expensive)
    
    // Axle residual travel. How far the axles can move after the truck suspension has been fully compressed. (Unknown distance unit)
    residual_travel[]: 0.12     // 1st axle, the front most axle.
    residual_travel[]: 0.08     // 2nd axle, the rear axle. Adding more entries goes from front to back of truck.
    
    // Default accessories attached to this chassis. An accessory is something you can purchase for the truck. (Or in some cases, cannot purchase but can be attached)
    // The accessories used here only make sense if they are actually attached to the chassis but you can use any accessory, including those attached to the roof etc.
    // Generally, you should also revert the truck paint to some default (all round paint) when changing chassis.
    defaults[]: "/def/vehicle/truck/scania.r/accessory/doorstep/shape1.sii"     // Absolute path to the accessory.
    defaults[]: "/def/vehicle/truck/scania.r/paint_job/color6.sii"              // Add more entries as necessary.
    
    // Powered wheels. Wheels that are connected to the drive train.
    // True means the wheel is powered whereas false means the wheel is not powered.
    // Add more pairs (assuming your "truck" has paired wheels) increasing the indexes as necessary to define more powered wheels.
    powered_wheel[0]: false     // Front left wheel. (Steering)
    powered_wheel[1]: false     // Front right wheel. (Steering)
    powered_wheel[2]: true      // Rear left wheel. (Drive axle)
    powered_wheel[3]: true      // Rear right wheel. (Drive axle)
    
    // Kerb weights per axle. The sum of these is how heavy the chassis is. Each line defines how much mass lies on each axle.
    // Keep in mind that the chassis connected to the cabin, wheels and other weighted attachments, like the trailer. These objects physically weigh down the chassis.
    // The total weight of the tractor is the sum of all attached weighted objects. But these two entities are the de facto place that define the weight balance
    // of the entire tractor.
    kerb_weight[0]: 5000.1      // 1st axle, the front most axle.
    kerb_weight[1]: 1650.1      // 2nd axle, the rear axle. Adding more entries goes from front to back of truck.
}
}
def.scs: /def/vehicle/truck/scania.r/engine/dc12_380.sii - Engine specific settings.
(the contents of this code block has been edited to focus on the actual parameters within, see the game extracted version for original)

Code: Select all

SiiNunit
{
// From ETS 2 version 1.19.2.1 in "def.scs" at "/def/vehicle/truck/scania.r/engine/dc12_380.sii"

// File contents commented by Cadde. Please bare in mind that none of the comments within are SCS Software official comments.
// The accuracy/correctness of comments might be off. Please verify the correctness of the comments before making assumptions that they indeed are correct.
// Most of these comments are my "best" guesses and some are from personal experience. I have marked those i am really unsure about explicitly.

// This file can be used directly in a mod. But be mindful of the version at the top.
// If settings are added/removed in later game versions this file should be made up to date with the new information before use.

// I recommend viewing this file in notepad++ (https://notepad-plus-plus.org/) and pressing Language -> C -> C++ in the menu.

// This particular file is from "/def/vehicle/truck/scania.r/engine/dc12_380.sii" in the game extracts.
// You must change the dc12_380.scania.r.engine bit of this line to conform with the engine you are editing/adding.
accessory_engine_data : dc12_380.scania.r.engine
{
    // Dealership / truck service settings.
    // These values does NOT affect the physics or performance of the engine.
    name: "DC12 18 380 Euro 5"                  // Name of the engine.
    price: 14520                                // Price of the engine in Euro.
    unlock: 8                                   // Required level before being able to purchase engine.
    icon: "engine_01"                           // Name (without extension) of the .mat file in the "/material/ui/accessory" folder describing the icon/image to be shown next to the engine.
    info[]: "380 @@hp@@ (280@@kw@@)"            // Extra details about the engine.
    info[]: "1@@dg@@900 @@nm@@"                 // Each entry is connected to a specific field in the information about the purchase.
    info[]: "1@@dg@@100-1@@dg@@400 @@rpm@@"     // In this case, it explains the engine max horsepower (power in kW), max torque and power band.
                                                // @@hp@@ is a localized string for "horsepower".
                                                // @@kw@@ is a localized string for "kilowatt".
                                                // @@dg@@ is a localized string for the thousands separator, i.e "1,000" vs "1.000" vs "1 000" vs "1000", all four meaning one thousand, depending on the countries defined thousands separator.
                                                // @@nm@@ is a localized string for "newton metre".
                                                // @@rpm@@ is a localized string for "RPM" or "Revolutions Per Minute".

    // Power. Here, the maximum torque is used by the simulation in an, currently unknown, formula for engine power.
    // Volume doesn't affect the engine power, but is used to calculate fuel consumption and engine brake performance. Also, currently unknown formula.
    torque: 1900                                // Default: 1900,   Maximum torque of the engine.
    volume: 11.7                                // Default: 11.7,   Engine volume in liters.

    // Hidden parameters not found in the extracted files. (With special thanks to Cleber_oro)
    engine_brake: 1.0                           // Default: 1.0,    Exhaust/motor/jake) brake multiplier for this engine.
    engine_brake_downshift: 1                   // Default: 1,      When set to 1, the automatic transmission will downshift with the motor brake. When set to 0, the automatic transmission will maintain the current gear until the motor brake is released or RPM gets really low.

    // Default accessories attached with this engine. An accessory is something you can purchase for the truck. (Or in some cases, cannot purchase but can be attached)
    // Generally, these attachments are specific to the engine. Such as an engine badge, engine sounds and front grille ETC.
    defaults[]: "/def/vehicle/truck/scania.r/badge/r380.sii"
    defaults[]: "/def/vehicle/truck/scania.r/sound/interior.sii"
    defaults[]: "/def/vehicle/truck/scania.r/sound/exterior.sii"
}
}
See the following posts for practical implementations. I.E, "how do i make X" type of modifications.
On extended hiatus.

User avatar
Cadde
Posts: 9535
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#2 Post by Cadde » 27 Aug 2015 06:20

Clutch modification
The goal here is to make the clutch on manual gearboxes and the automatic gearbox (a.k.a the torque converter) have better grip while driving in gear.

Why?
When driving in gear, the the RPM needle (and hence, the engine / flywheel) are not actually in sync with the transmission. This is not realistic, not even on automatic transmissions.

First, let's detail what happens in reality...

On automatics, there's a device called the "Torque Converter" that is a set of spinning "fans" (in lack of a better common term) that rotate at different speeds when the engine RPM doesn't match the transmission and drivetrain RPM.
This is the takeoff clutch for an automatic, hence no need for a clutch pedal. You can just give the engine some throttle and the automatic gearbox turns this into forward momentum with minimal wear.
This is also why releasing the brakes on an automatic makes it (irl) move forwards on level ground. The torque converter is always active when the engine RPM differs from the transmission RPM.
The Torque Converter isn't perfect though. The friction generated within it causes power to be lost as heat. Hence, automatic transmissions are connected to the radiator via it's own hoses where it feeds transmission oil to be cooled off which in turn cools the transmission.

Hence, once the engine and transmission RPMs match, there actually is a set of conventional clutches that automatically engage to mechanically lock the engine and transmission together to prevent power losses while driving down the road in the same gear.

On manual gearboxes, this connection is handled by the driver and the manual clutch. The driver decides (via the clutch pedal) just how much friction there is between the engine and transmission through the clutch plates.
Thus, there are no power losses in the system. When the clutch pedal is all the way up (assuming a healthy clutch pack) the engine and transmission are locked together mechanically.

History
Until recently (version 1.19), the game had one setting for this connection between the engine and transmission named "clutch_viscosity_factor" and before that, a "clutch_viscosity" setting that directly dealt with the viscosity parameter.
Traditionally, one increased that value between 5 and 10 times the default value to ensure a solid connection. But such modifications weren't without problems...
  • Taking off using the manual clutch meant you had to be very precise with your clutch control as the simulation of the clutch / connection wasn't optimized for such absurd values. It generally lead to stalls as if you were some granny who never learned to drive stick.
  • It lead to very jerky shifts, especially with the new sound of crunching gears in recent versions, where the engine RPM jumped suddenly rather than smoothly as it would if one shifted correctly using a clutch in real life. That could be overcome by being good at rev matching like some transmissions that lack a synchro can shift without the use of the clutch.
  • The automatic transmission was very jerky, almost unusable in game. This modification excluded the use of the automatic transmission.
For reasons explained in the "why" section above, the modification was desirable even for automatics but it just didn't work...

Well, now it has two settings, thank you Max!
One for taking off and one for when the engine and transmission are deemed to be connected.

How?
You need to edit the "/def/vehicle/physics.sii" file and pack it up into a mod archive.
Focus on lines 136 to 141 in the supplied, fully commented, file in the first post above.

Code: Select all

    // Clutch strength. Higher value makes clutch stronger, RPM needle doesn't fluctuate when in gear.
    // Affects both manual and automatic gearboxes.
    // The first value affects the engine->transmission connection when taking off or changing gears. Do not set too high or automatic gearbox might fail.
    // The second value affects the engine->transmission connection when revs match, a higher value prevents RPM needle moving when in full throttle or not.
    clutch_viscosity_factor:                    1.0     // Default: 1.0,    When using clutch / automatic gearbox is taking off / changing gear.
    clutch_connected_viscosity_factor:          1.0     // Default: 1.0,    When clutch is up and transmission RPM is matching engine RPM.
You want to keep the first value as it is but increase the second value to a value between 5.0 and 10.0.
Personally i roll with a value of 10.0 because it gives a solid connection without any downsides.

That is all you need to do. Now enjoy having a realistic drivetrain no matter if you are using an automatic or manual gearbox!

Do note, if another mod is installed that alters the physics.sii file you must manually merge or edit the existing mod.
There are quite a few mods out there that alter the physics.sii file so make absolutely sure you only have ONE mod with the file in it.


================================================================================
Brake modification
The goal is to make the brakes behave differently at low speeds so the truck doesn't stop as hard.

Why?
In my (Cadde's) humble opinion, the default brakes are too strong at low speeds. Once you reach speeds below 20 km/h even the slightest touch on the brake pedal makes the truck stop as if you slammed on it.
This is especially true when you are driving the truck without a trailer.
To me that doesn't feel right, so i wanted to change it!

How?
You need to edit the "/def/vehicle/physics.sii" file and pack it up into a mod archive.
Focus on lines 65 to 69 in the supplied, fully commented, file in the first post above.

Code: Select all

    // Brake torques
    brake_torque_factor:            1.0                 // Default: 1.0,    Overall brake strength. There's also a slider in game options.
    braking_curve_peak_rel:         6.0                 // Default: 6.0,    Brake strength multiplier at low (6 km/h default) speed.
    brake_characteristic_rpm:       250.0               // Default: 250.0,  Where the braking curve bends. (Default 250 rpm = 6 km/h)
    brake_balance:                  1.1                 // Default: 1.1,    Front brakes are this much stronger than rear brakes.
"braking_curve_peak_rel" is the value we want to change first and foremost. It is how much stronger the brakes are at low speeds.
Lowering the value means the increase in braking power isn't as extreme.

I personally set it to 3.0, i.e halved the value and i am ok with that. It's not perfect but i deem that fine tuning it is unnecessary.
Adjust it to your own desires.

That is all you need to do!

Do note, if another mod is installed that alters the physics.sii file you must manually merge or edit the existing mod.
There are quite a few mods out there that alter the physics.sii file so make absolutely sure you only have ONE mod with the file in it.
On extended hiatus.

User avatar
Cadde
Posts: 9535
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#3 Post by Cadde » 27 Aug 2015 06:20

Reserved
On extended hiatus.

User avatar
Cadde
Posts: 9535
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#4 Post by Cadde » 27 Aug 2015 06:21

Feel free to post in this thread giving praise, critique, suggestions, corrections and so on.
The more you bump this thread (within the limits of the forum rules of course) the more exposure it gets so newcomers and veterans alike may notice it.

As stated in the first post, i encourage all moderators, admins and game developers (assuming they have the power) to edit these posts accordingly if new information comes to light or corrections need to be made.
This is a collective effort, in the interests of bettering the modding community.
I also encourage the creation of similar topics (in this subforum until a proper subforum is added) and i will try to make more such threads when i feel like it, have the time and the required knowledge to do so.

If you keep me and others motivated enough to keep this up, i.e, actually show your interest in mine and others time spent on these, then I and others will keep updating and adding more details as necessary.
Feel free to ask questions if something is unclear and please request additions to be made or new guides to be written on different concepts.
On extended hiatus.

User avatar
SimulatorSam
Posts: 6239
Joined: 05 Mar 2014 17:52
Location: United Kingdom
Contact:

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#5 Post by SimulatorSam » 27 Aug 2015 07:28

Wow, Cadde praise is definitely deserved on this thread! :shock:

And I always thought braking was way to strong going slow, so thanks for that! :D

Drive Safely
Posts: 2741
Joined: 20 Jun 2015 06:17
Contact:

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#6 Post by Drive Safely » 27 Aug 2015 09:31

Excellent and extensive documentation. Even though I'm not much of a physics guy, I appreciate you supporting the modding community by providing this resource for modders. :D

User avatar
Cadde
Posts: 9535
Joined: 24 Apr 2013 18:08
Location: Have no fear, i am from the internets!

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#7 Post by Cadde » 27 Aug 2015 09:51

Thanks MMG, i am glad that some use came out of it.
And thank you Drive Safely.

Both of you and everyone else, feel free to ask "how do i" with the topic of this thread in mind and i will add another example.
On extended hiatus.

User avatar
Leen
Posts: 4216
Joined: 22 Jan 2014 19:06
Location: Netherlands
Contact:

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#8 Post by Leen » 27 Aug 2015 12:44

Great work you did cadde and \i have test your clutch and brake settings and it seems to me the truck engine has a better torque especially when start moving and acceleration, like you sais "it feels more solid".
Even the engine react much better on the throttle, is it me but in my experience it looks like the retarder works much better than before aand gives me a ,ore realistic feeling overall.

I think I gonna play with some values and see/feel what happens ;)

User avatar
room217au
Posts: 2929
Joined: 17 Jul 2015 01:55
Location: 'Straya

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#9 Post by room217au » 27 Aug 2015 13:52

As always, explained in an easy-to-understand manner.
Thanks. I'll certainly make use of some of this data :)
Two wrongs don't make a right, but three lefts.. do.

User avatar
CobraBlue6
Posts: 1740
Joined: 28 Mar 2015 01:45
Location: Hertfordshire, UK

Re: [GUIDE] [1.19.2.1] Vehicle physics explained.

#10 Post by CobraBlue6 » 27 Aug 2015 15:47

Thanks Cadde, really useful stuff 8-)

Post Reply

Return to “Modding Guides”

Who is online

Users browsing this forum: No registered users and 2 guests