Difference between revisions of "Games/ETS2/Modding guides/1.27"

From SCS Modding Wiki
Jump to navigation Jump to search
(Created page with " == Changes == === Truck Accessory Data === There is new rule '''overrides[]''' added. Its values are file names and it is non-lazy version of '''defaults[]'''. This means w...")
 
(Changes)
 
(15 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 +
= Recommendations =
 +
* When basing your model on the original ones, add to your mod also <strong>ALL</strong> original /automat/ files used by it. The names of the files are generated as CityHash64 hash of theirs content so whenever we change the parameters of the material in any way, a different file will be used to store them and the original file might cease to exist if there is no other model utilizing the original parameters.
 +
* When modifying original models, always include <strong>ALL</strong> compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
 +
* As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is <strong>HIGHLY RECOMMENDED</strong> to use suffix or prefix in the name to avoid conflicts with new objects we are adding in patches. Otherwise you might have to use the batch renaming functionality (see Batch renaming) to fix the conflicts when new patch appears.
  
== Changes ==
+
= How to convert map =
 +
* Load map
 +
* Do rebuild (F8)
 +
* Save map
  
=== Truck Accessory Data ===
+
= Changes =
 +
 
 +
== Vehicles data ==
 +
 
 +
=== Truck accessory data ===
  
 
There is new rule '''overrides[]''' added. Its values are file names and it is non-lazy version of '''defaults[]'''. This means whenever this rule is used adding accessory also adds all override accessories regardless of presence of same type accessory (old ones are discarded). Typical use case is engine that takes engine badge or sound with itself. Forcing the change simplifies other rules as now engine badges or sounds do not need suitable rule on their sides which removes unwanted cross links between accessories. Use carefully as any forced change can loop easily with incorrect data.
 
There is new rule '''overrides[]''' added. Its values are file names and it is non-lazy version of '''defaults[]'''. This means whenever this rule is used adding accessory also adds all override accessories regardless of presence of same type accessory (old ones are discarded). Typical use case is engine that takes engine badge or sound with itself. Forcing the change simplifies other rules as now engine badges or sounds do not need suitable rule on their sides which removes unwanted cross links between accessories. Use carefully as any forced change can loop easily with incorrect data.
  
=== Engine Data ===
+
=== Engine data ===
  
 
Part of engine simulation improvement is specifying inner engine resistance. It is defined by '''resistance_torque''' attributes that defines resistance in Nm that is measured at 2000 rpm (arbitrary value). It is mainly linked with size of engine so if you set it to negative value it is defaulted from engine volume (it is near volume * 20.0).
 
Part of engine simulation improvement is specifying inner engine resistance. It is defined by '''resistance_torque''' attributes that defines resistance in Nm that is measured at 2000 rpm (arbitrary value). It is mainly linked with size of engine so if you set it to negative value it is defaulted from engine volume (it is near volume * 20.0).
  
=== Chassis Data ===
+
Default value for '''engine_brake_positions''' was changed to 3. Hold button logic works same as before, but now players could use partial engine brake usage as is present in most current trucks.
 +
 
 +
=== Chassis data ===
 +
 
 +
New attribute '''air_tank_pressure''' now defines nominal pressure truck wants to keep in air tanks. Default value is 10 bars.
 +
 
 +
=== Interior data ===
 +
 
 +
With more exact simulation of air pressure we unified animation API. All animation now expect values in bars. To prevent misunderstanding they were also renamed (with their '''_max''' and '''_min''' values): '''oil_psi_anim''' to '''oil_pressure_anim''', '''air_psi_anim''' to '''air_pressure_anim''', '''button_low_air_psi''' to '''indicator_low_air_pressure''', '''button_low_oil_psi''' to '''indicator_low_oil_pressure'''.
 +
 
 +
In addition, animation '''brake_psi_anim''' was renamed to '''brake_pressure_anim''', and is not in range 0-1 of brake limit anymore, it uses bars like all other pressure animations instead.
 +
 
 +
There was also added many new animations: '''differential_lock_stick_anim''' and '''indicator_differential_lock''' for new differential lock feature, '''indicator_weigh_green''' and '''indicator_weigh_red''' for weight pass model LEDs, and '''indicator_trailer_axle_lift''' for liftable axles on trailer.
 +
 
 +
Default value for '''clock_small_anim_max''' was changed to 24 as it is logic the code worked with always.
 +
 
 +
== Materials ==
 +
 
 +
The method of generating names of material files in the /automat directory was changed from SHA1 to CityHash64.
  
New attribute '''air_pressure''' now defines nominal pressure truck wants to keep in air tanks. Default value is 10 bars.
+
== Model format ==
  
=== Interior Data ===
+
Animated models are now skinned on the GPU and the PMG format was changed to allow its data to be directly used for rendering. Note that the new version only supports four bones affecting single vertex while the previous version did not have any limit.
  
With more exact simulation of air pressure we unified animation API. All animation now expect values in bars
+
* The game will automatically convert the previous format during load so older mods will continue to work. If the more than four bones are affecting a single vertex, only the four strongest influences will be used.
 +
* A updated conversion tools generating this new format will be released soon.
 +
* If necessary, existing PMG resources can be converted to the new format using the '''-conversion_dump_path''' command line option (e.g. "-conversion_dump_path c:\path_for_the_converted_resources").

Latest revision as of 07:43, 27 April 2018

Recommendations

  • When basing your model on the original ones, add to your mod also ALL original /automat/ files used by it. The names of the files are generated as CityHash64 hash of theirs content so whenever we change the parameters of the material in any way, a different file will be used to store them and the original file might cease to exist if there is no other model utilizing the original parameters.
  • When modifying original models, always include ALL compoments of the model (pmg+pmd) instead of just those you changed. Otherwise you risk crash if we change the model.
  • As always when adding new objects to files which support multi-file approach (e.g. road_look.sii) it is HIGHLY RECOMMENDED to use suffix or prefix in the name to avoid conflicts with new objects we are adding in patches. Otherwise you might have to use the batch renaming functionality (see Batch renaming) to fix the conflicts when new patch appears.

How to convert map

  • Load map
  • Do rebuild (F8)
  • Save map

Changes

Vehicles data

Truck accessory data

There is new rule overrides[] added. Its values are file names and it is non-lazy version of defaults[]. This means whenever this rule is used adding accessory also adds all override accessories regardless of presence of same type accessory (old ones are discarded). Typical use case is engine that takes engine badge or sound with itself. Forcing the change simplifies other rules as now engine badges or sounds do not need suitable rule on their sides which removes unwanted cross links between accessories. Use carefully as any forced change can loop easily with incorrect data.

Engine data

Part of engine simulation improvement is specifying inner engine resistance. It is defined by resistance_torque attributes that defines resistance in Nm that is measured at 2000 rpm (arbitrary value). It is mainly linked with size of engine so if you set it to negative value it is defaulted from engine volume (it is near volume * 20.0).

Default value for engine_brake_positions was changed to 3. Hold button logic works same as before, but now players could use partial engine brake usage as is present in most current trucks.

Chassis data

New attribute air_tank_pressure now defines nominal pressure truck wants to keep in air tanks. Default value is 10 bars.

Interior data

With more exact simulation of air pressure we unified animation API. All animation now expect values in bars. To prevent misunderstanding they were also renamed (with their _max and _min values): oil_psi_anim to oil_pressure_anim, air_psi_anim to air_pressure_anim, button_low_air_psi to indicator_low_air_pressure, button_low_oil_psi to indicator_low_oil_pressure.

In addition, animation brake_psi_anim was renamed to brake_pressure_anim, and is not in range 0-1 of brake limit anymore, it uses bars like all other pressure animations instead.

There was also added many new animations: differential_lock_stick_anim and indicator_differential_lock for new differential lock feature, indicator_weigh_green and indicator_weigh_red for weight pass model LEDs, and indicator_trailer_axle_lift for liftable axles on trailer.

Default value for clock_small_anim_max was changed to 24 as it is logic the code worked with always.

Materials

The method of generating names of material files in the /automat directory was changed from SHA1 to CityHash64.

Model format

Animated models are now skinned on the GPU and the PMG format was changed to allow its data to be directly used for rendering. Note that the new version only supports four bones affecting single vertex while the previous version did not have any limit.

  • The game will automatically convert the previous format during load so older mods will continue to work. If the more than four bones are affecting a single vertex, only the four strongest influences will be used.
  • A updated conversion tools generating this new format will be released soon.
  • If necessary, existing PMG resources can be converted to the new format using the -conversion_dump_path command line option (e.g. "-conversion_dump_path c:\path_for_the_converted_resources").