NWH Vehicle Physics 2 Documentation
Admin » NWH:VehiclePhysics2:Powertrain:EngineComponent

Differences

This shows you the differences between two versions of the page.


Previous revision
—NWH:VehiclePhysics2:Powertrain:EngineComponent [2023/05/16 09:34] (current) – nwhcoding
Line 1: Line 1:
 +====== Engine Component ======
 +
 +[{{ :NWH:VehiclePhysics2:Powertrain:pasted:20230408-234601.png|Engine inspector. }}]
 +
 +The engine acts as a source of power/torque and updates the components attached to it recursively with the generated torque.
 +
 +<wrap round info>When using the Electric engine, consider setting the output to the Transmission, bypassing the Clutch, as it is not needed.</wrap>
 +
 +== Inertia ==
 +Higher engine inertia results in an engine that is harder to stall. The such engine will also take longer to spin up.
 +Typical values: 
 +  * Sports car: 0.2
 +  * Average car: 0.3-0.5
 +  * Semi truck: 1-1.5
 +
 +== Power Curve ==
 +The power curve represents engine power across its RPM range.
 +X and Y values are normalized where X (0 to 1) represents RPM as a percentage of ''Rev Limiter RPM'' and Y (0 to 1) represents power as a percentage of ''Max Power''. 
 +
 +<wrap round info>Note that power and torque curves show the exact same data since the power is a function of torque and RPM, so knowing two of the three is enough. Since power curves are usually easier to find, NVP2 uses a power curve instead of a torque curve.</wrap>
 +
 +[{{ :NWH:VehiclePhysics2:Powertrain:pasted:20200317-172525.png|Similar power output, different power curves.}}]
 +
 +== Idler Circuit ==
 +The Idler circuit tries to keep RPM at ''Idle RPM'' when there is no user input. This is done through throttle modulation so it is still possible to stall the engine if ''stallingEnabled = true''.
 +
 +== Starter ==
 +Starter spins up the engine to try and reach the RPM at which the power generated by the engine is enough for it to spin by itself and overcome the losses. The amount of torque needed is automatically calculated based on the engine inertia, //Power Curve//, and the //Start Duration// value. \\
 +When //Flying Start// is enabled, the engine spins up instantly without running the starter. This is to give an illusion of the engine already having been started when the vehicle is woken up.
 +
 +== Rev Limiter ==
 +Cuts throttle to the engine when RPM reaches ''Rev Limiter RPM'' for a duration of ''Rev Limiter Cutoff Duration''.
 +
 +== Forced Induction ==
 +{{page>[NWH:VehiclePhysics2:Powertrain:EngineComponent_ForcedInduction]}}
 +
 +== Power Modifiers ==
 +Power modifiers can be used through scripting to modify the power of the engine. These are functions that return a ''float'' which denotes an engine power coefficient. Example:
 +
 +<code>
 +public float AddBoost()
 +{
 +   if(boostIsActive)
 +   { 
 +       return 1.5f; // Increases power for 50%.
 +   }
 +}
 +...
 +myVehicleController.powertrain.engine.powerModifiers.Add(AddBoost);
 +</code>
 +
 +This is a fictional example. A concrete example can be found inside the TCS module which uses this mechanic to limit power when there is wheel spin.
 +
 +
  
NWH Vehicle Physics 2 Documentation

Table of Contents

  • About
  • Setup
  • Input
  • Vehicle Controller
  • Wheel Controller
  • NWH Common Scripts
  • Trailers
  • GUI
  • Multiplayer
  • Render Pipelines
  • Add-ons
  • FAQ
  • Troubleshooting
  • Demos
  • Changelog
  • Upgrade Notes
  • Support