City Car Driving

City Car Driving

Not enough ratings
User Manual for Dust Configuring and Clipping
By SteaveP
This document is a manual for configuring dust from under the wheels and clipping dust in the interior of cars created and added to the simulator “City Car Driving. Home Edition”.
   
Award
Favorite
Favorited
Unfavorite
Dust Configuring
Create a new directory with your car’s name in the folder “data/gamedata/particles/cars/”, enter it, create a dust configuration file with the extension “.ini” and name it, for example: “dustCar.ini”.
Open the file in a text editor (for instance, notepad) to create your dust configuration.
At first you can copy the settings from the file “data/gamedata/particles/dustCar.ini”.

Description of dust configuration parameters:

startColor = 0.38; 0.28; 0.18; 0.9 – color at the start of generation (RGBA).
endColor = 0.38; 0.28; 0.18; 0.9 – color in flight (RGBA).
sustainedColor = 0.38; 0.28; 0.18; 0.9 – the third color which remains unchanged (RGBA).
powerupColor = 0.38; 0.28; 0.18; 0.9 – color during power up.

A dust particle is colored gradually using the arctangent law, so its dynamics is configured with two values: the color change speed, and the start of coloring.

Particle color change from “startColor” to “endColor”:
engineCleanDelay= 1.5 – time in seconds between “particle life start” and “particle half colored”.
engineCleanCurve = 1 - coloring speed, the greater, the faster.

Particle color change from “startColor/endColor” to “sustainedColor”. The color change depends on the start of generation rather than the particle life:
airCleanDelay = 0 – time in seconds till 50% coloring.
airCleanCurve = 0 – coloring speed, the greater, the faster.

Particle color change to “powerupColor”:
powerupColorDelay = 0 – power (from 0 to 1) at which the particle will be half colored in “powerupColor”.
powerupColorCurve = 0 – color change intensity during power-up. The greater it is, the more the color change intensity will be when the required power is reached.

Dust generation irregularity in time (disabled/not used):
[Pulse]
PulseEnabled = false – enable/disable pulsing.
PulseMinCoef = 20 – “irregularity” coefficient.
PulseGenerateDeltaTime = 1.0 – time between pulses.

[Particles]
Filename = "system/dust_truck_particle/" – path to particle files “.n2” and “.nvx2” (in folders “export/meshes/” and “export/gfxlib/”).
Creating Particles
GenerationSpeedMax = 100 – particle generation speed per second at the maximum wheel rotation speed.
GenerationSpeedMiddle = 18 – particle generation speed per second at the point “GenerationMiddleCoef”.
GenerationMiddleCoef = 0.35 – a relative point [0, 1] in which the particle generation speed will be “GenerationSpeedMiddle”. Calculated as “Required_Rotation/Maximum_Rotation”.

GenerationVelocityCoef = 0.005 – particle generation velocity coefficient dependent on emitter velocity [1, infinity]. This coefficient will be used at 100 km/h. The other values are linearly interpolated taking into account that the coefficient is equal to 1 at 0 km.

ParticleVelocitySpeedCoef = 10.0 – particle speed coefficient dependent on emitter velocity.
ParticleVelocityLifetimeCoef = 1.3 – particle lifetime coefficient dependent on emitter velocity.

Particle lifetime:
LifetimeMax = 2.2 – particle lifetime – from “birth” to deletion from memory (max).
LifetimeMin = 1.0 – particle lifetime – from “birth” to deletion from memory (min).

ParticleDamping = 0.15 – particle damping speed, m/s.
StartAlpha = 0.001 – initial particle transparency.
StartFadeAlpha = 0.70 – particle transparency in the point “LifeToStartFade”.
LifeToStartFade = 0.3 – relative coefficient [0,1] of particle life after which the particle starts to fade.
DeathSizeCoef = 1.2 – coefficient of particle size (dependent on particle size in the point “LifeToStartFade”) which particles will have at death.

Particle motion and size:
StartWidth = 0.12 – initial particle size.
StartHeight = 0.12 – initial particle size.

Particle size in the point “LifeToStartFade” is selected randomly from the following value range:
MinWidth = 0.25
MinHeight = 0.25
MaxWidth = 0.45
MaxHeight = 0.45

Initial particle speed is selected randomly from the following value range:
SpeedMax = 0.08
SpeedMin = 0.05

Limits of the free coefficient of initial particle speed, which is set arbitrarily from the code:
SpeedCoefMin = 0.5
SpeedCoefMax = 5.0

Dispersion cone:
EmitterConeGrad = 10.0

Wind mass and force:
WindCoeff = 0.0
Mass = -0.0021

Power means dependency of parameters on RPM. It initially has an effect on particle number, but may also have an effect on particle speed, size, etc.
The final particle power is calculated as “Power * PowerCoef + AdditionalPower * AdditionalPowerCoef”.

PowerCoef = 0.0 – particle power coefficient.
AdditionalPowerCoef = 1.0 – particle additional power coefficient.

AdditionalPowerDecreaseSpeed = 0.0 – additional power decrease speed.
AdditionalPowerIncreaseSpeed = 0.0 – additional power increase speed.
PowerToSizeDependency = true - power to particle size dependency (enable/disable).
PowerSizeCoef = -7.1 – size coefficient dependent on power.
PowerSizeCoefMin = 1.0 – minimum size coefficient value.
PowerSpeedCoef = 5 - particle power to speed dependency coefficient.

PowerToEmitterConeGradDependency = false – emitter cone narrowing coefficient dependent on power (enable/disable).
PowerEmitterConeGradCoef = 0.5 – “0” – no dependency; negative values – the cone radius increases; positive values – the cone radius decreases.
Setting dust parameters in car config file
Then the dust configuration must be tied to the car. To do so, write the following line in the file “data/gamedata/cars/<My_car_name>/CarProperty.ini” (where “<My_car_name>” is your car’s name) to the directory
[common]: DustUnderWheelsConfigPath="particles/cars/<My_car_name>/dustCar.ini"
Model Modification for Clipping Dust in the Car Interior
To clip dust in the car interior, a new object must be added to the interior (saloon.n2). It is assigned the shader “ParticleClippingDepthShader”. The item must be convex, with its normals facing outward. Particles will be hidden inside the item.