Vehicle Configuration – DayZ Category

From Bohemia Interactive Community
Jump to navigation Jump to search
(Blanked the page)
Line 1: Line 1:
{{TOC|side}}
This page describes all basics of the DayZ vehicle simulation and its configuration.


== Legend ==
The following table describes some shortcuts, symbols and units used inside this page.
{| class="wikitable"
! style="text-align: left;"| symbol !! style="text-align: left;"| meaning
|- style="vertical-align:top;"
| kg || kilogram (mass unit)
|- style="vertical-align:top;"
| km || kilometer (unit of length)
|- style="vertical-align:top;"
| km/h || kilometers per hour (unit of speed)
|- style="vertical-align:top;"
| kW || kilowatt (unit of power)
|- style="vertical-align:top;"
| l || liter (unit of volume)
|- style="vertical-align:top;"
| m || meter (unit of length)
|- style="vertical-align:top;"
| N || Newton (unit of force)
|- style="vertical-align:top;"
| Nm || Newton-meter (unit of torque)
|- style="vertical-align:top;"
| RPM || revolutions per minute
|}
----
== Debugging ==
You can debug all simulation properties directly in game when using the Diag binary of the game.
The debug is accessible through the [https://community.bistudio.com/wiki/DayZ:Diag_Menu#Simulation| diag menu] (holding {{Controls|Win|Alt}} keys) where you can navigate using the arrow keys.
To access car simulation window and controls, in the diag menu go to Game -> Vehicles -> Simulation.
----
== Wheels ==
TBD.
== Model ==
This section explains all the basics inside the model that influence the car simulation.
=== Geometry LOD ===
Make sure your car has a Geometry LOD with convex components. Every component's vertex should have weight assigned. From these weights the total mass of vehicle and its center of mass is computed.
Wheel hubs should have their own components as well, to prevent the vehicle from sinking into the ground without wheels.
=== FireGeometry LOD ===
Inside the fire geometry LOD there must be a proxy object placed with the correct name of the wheel slot so the simulation can attach a wheel and suspension to that position.
== Config ==
This section explains all parts related to the simulation of the CarScript config class.
=== Crew ===
Crew module specifies all available positions inside a car for players. Every position has its own class where the class name is the name of the crew member position (like Driver, CoDriver etc.)
{| class="wikitable"
! style="text-align: left;"| property !! style="text-align: left;"| type !! style="text-align: left;"| description
|- style="vertical-align:top;"
| actionSel || string || Name of the named selection(s) in view or fire geometry LOD of the model. This selection is used as entry point for user action.
|- style="vertical-align:top;"
| proxyPos || string || Name of the named proxy selection in view geometry LOD of the model. This proxy is used as position where to put player inside car. '''This proxy has to have defined bone inside skeleton config of the car.'''
|- style="vertical-align:top;"
| getInPos || string || Name of the selection point from which player gets in/out the car.
|- style="vertical-align:top;"
| getInDir || string || Name of the selection of second point serving as direction from the first one.
|- style="vertical-align:top;"
| isDriver || boolean || Indicates if this crew position serves for driver. '''There can be max. one driver position at the time.'''
|}
Example
<pre>
class Crew
{
    class Driver
    {
        actionSel = "seat_driver";
        proxyPos = "crewDriver";
        getInPos = "pos_driver";
        getInDir = "pos_driver_dir";
        isDriver = true;
    };
    class CoDriver
    {
        actionSel = "seat_coDriver";
        proxyPos = "crewCoDriver";
        getInPos = "pos_coDriver";
        getInDir = "pos_coDriver_dir";
    };
};
</pre>
=== SimulationModule ===
SimulationModule class contains car's controls properties, engine and drivetrain configuration.
;drive
: Determines drivetrain configuration of the car.
[[File:drivetrains.png|1024px|drivetrains]]
==== Steering ====
The steering class determines how the steering wheel behaves when the steering keys are pressed. To make steering on the keyboard less painful, we have introduced so-called steering curves to help players maintain better control of the vehicle.
Every point of the curve determines how fast the steering wheel rotates based on vehicle speed.
'''Increase''' speed curve controls the steering when performing classic steering maneuver.
'''Decrease''' speed curve controls the steering when performing counter steering maneuver (for example when car wheels are turned left and player starts steering right).
'''Centering''' speed curve controls how fast the steering get back to neutral position when no steering input is given.
Example
<pre>
class Steering
{
    maxSteeringAngle = 35; // maximum angle by which the wheel on the steered axle can turn
    increaseSpeed[] = {
          0,  40, // at  0 km/h, steering speed is 40 degrees per second
        60,  20, // at  60 km/h, steering speed is 20 degrees per second
        100,  10  // at 100 km/h, steering speed is 10 degrees per second
    };
    decreaseSpeed[] = {
          0,  80, // at  0 km/h, counter steering speed is 80 degrees per second
        60,  40, // at  60 km/h, counter steering speed is 40 degrees per second
        90,  20  // at  90 km/h, counter steering speed is 20 degrees per second
    };
    centeringSpeed[] = {
          0,  0, // at  0 km/h, centering speed is  0 degrees per second
        15,  18, // at  15 km/h, centering speed is 18 degrees per second
        60,  30, // at  60 km/h, centering speed is 30 degrees per second
        100,  45  // at 100 km/h, centering speed is 45 degrees per second
    };
};
</pre>
==== Throttle ====
The throttle class determines how the throttle is reacting to the player's input. When using a keyboard it might be difficult to control the car smoothly, so various helpers have been introduced.
There are 3 main modes how to control the throttle: Gentle, default, and turbo.
'''Gentle''' - when this modifier is used, the max pressure on the gas pedal is limited by ''gentleThrust'' value from the config file.
'''Default''' - used when the action for acceleration is active without any modifiers. The max pressure on the gas pedal is limited by ''defaultThrust'' value from the config file.
'''Turbo''' - when this modifier is used, it means that the player is flooring the gas pedal.
Example
<pre>
class Throttle
{
    reactionTime = 1.0; // how long it takes to get wanted value of thrust (in seconds)
    defaultThrust = 0.85; // thrust value when only the action for acceleration is active
    gentleThrust  = 0.7;  // thrust value when the VehicleSlow keyboard key is pressed together with acceleration
    turboCoef  = 4.0;  // how many times is reaction time faster when full thrust is applied
    gentleCoef = 0.75; // how many times is reaction time slower when gentle thrust is applied
};
</pre>
==== Brake ====
{| class="wikitable"
! style="text-align: left;"| property !! style="text-align: left;"| type !! style="text-align: left;"| description
|- style="vertical-align:top;"
| pressureBySpeed || array of pair of floats || How much brake pressure is applied with respect to car's speed.
|- style="vertical-align:top;"
| reactionTime || float || How long (in seconds) it takes to get 100% brake pressure when panic braking is applied.<br/>Panic braking is applied when holding LShift (by default controls) key while braking.<br/>In other words how long it takes to floor the brake pedal.
|- style="vertical-align:top;"
| driverless || float in range [0, 1] || How much brake the game should apply when no driver is present.
|}
Example
<pre>
class Brake
{
    pressureBySpeed[] = {
        0, 0.43, // at  0 km/h, apply 43% of brake pressure
      20, 0.35, // at  20 km/h, apply 35% of brake pressure
      100, 0.31  // at 100 km/h, apply 31% of brake pressure
    };
    reactionTime = 0.25;
    driverless  = 0.1;
};
</pre>
==== Aerodynamics ====
The aerodynamic simulation consists of two main factors, frontal aerodynamic drag and downforce.<br/>
The frontal drag practically determines maximal forward speed of car. Downforce can be used to increase load on tires thus increasing their grip. This is the reason why racing cars has additional spoilers and wings.
{| class="wikitable"
! style="text-align: left;"| property !! style="text-align: left;"| type !! style="text-align: left;"| description
|- style="vertical-align:top;"
| frontalArea || float || Frontal area of car in squared meters.
|- style="vertical-align:top;"
| dragCoefficient || float || Coefficient used to quantify the air resistance of a car. You can read more about this value on [https://en.wikipedia.org/wiki/Drag_coefficient here]. See list of example values [https://en.wikipedia.org/wiki/Automobile_drag_coefficient here].<br/>Negative values are forbidden, car simulation does not calculate upwards lift force.
|- style="vertical-align:top;"
| downforceCoefficient || float || Coefficient of a downwards lift force. Usually this value is in range [0, 3]. More explanation of the topic can be found [https://en.wikipedia.org/wiki/Downforce here].
|- style="vertical-align:top;"
| downforceOffset || array of 3 floats || Local position offset from car's center of mass indicating where the downforce should be applied.
|}
Example
<pre>
class Aerodynamics
{
    // drag
    frontalArea    = 2.2;
    dragCoefficient = 0.45;
    // downforce
    downforceCoefficient = 0.8;
    downforceOffset[] = { 0, 0.4, -2.2 };
};
</pre>
==== Engine ====
Power source of the car. DayZ allows users to manually insert its torque curve allowing for simulation of various engines from classic internal combustion engines to electric ones.
==== Clutch ====
A clutch is a mechanical part that engages and disengages engine from transmission. When not fully engaged it allows engine and drivetrain to operate in different rotating speeds through slipping.
{| class="wikitable"
! style="text-align: left;"| property !! style="text-align: left;"| type !! style="text-align: left;"| description
|- style="vertical-align:top;"
| maxTorqueTransfer || float || Maximal torque in Nm that the clutch can transfer before it starts to slip.
|- style="vertical-align:top;"
| uncoupleTime || float || Time in seconds to disengage clutch.
|- style="vertical-align:top;"
| coupleTime || float || Time in seconds to engage clutch.
|}
Example
<pre>
class Clutch
{
  maxTorqueTransfer = 400;
  uncoupleTime = 0.3;
  coupleTime  = 0.3;
};
</pre>
==== Gearbox ====
Connects engine and driveline. Simply put, it is a set of gears that allow the rotational speed of the driveline to be varied while maintaining RPM of the engine within its effective range.
The gearbox has one reverse gear ratio so the car can go backwards and multiple forward gear ratios.
There are two types:<br/>
'''Manual''' - Player must change all gears manually to prevent overrevving the engine.<br/>
'''Automatic''' - Player manually changes only the direction of movement by choosing between R (reverse) and D (drive) modes.
Note that the types effectively change the way how a player controls the car, but the automatic gearbox also has more forward gears to allow the car to move at higher speeds.
Example
<pre>
class Gearbox
{
  // for automatic use GEARBOX_AUTOMATIC constant
  type = GEARBOX_MANUAL;
  // reverse gear ratio
  reverse = 3.51;
  // forward gear ratios
  ratios[] = {
      3.50,
      2.26,
      1.45,
      1.00
  };
};
</pre>
==== CentralDifferential ====
Valid only for AWD and 642 drivetrains. It is the differential connecting gearbox with the rest of the driveline.
==== Axles ====
===== Differential =====
===== Suspension =====
===== Wheels =====
[[Category:DayZ]]
[[Category:DayZ: Vehicles]]

Revision as of 10:20, 23 January 2023

This category currently contains no pages or media.