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.
}
}
(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.
}
}
(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"
}
}