In this guide we will see how to make your own car, which include its configuration files, sounds, textures and 3D meshes.
Introduction
First you need to choose the name of your car. For this guide we are going to call it “my_car”. Each time you see “my_car” in this guide you should replace it with your car name.
Tools
[section]# commentkey= value
For the textures, you will need any image manipulation program with the ability to export “png” and “dds” image.
For meshes, an add-on for Blender is provided (<install_dir>/asset/io_mesh_2.8.py). You can download Blender here:
https://www.blender.org/download/
or directly on Steam:
The instruction to install an add-on for Blender are there:
https://docs.blender.org/manual/en/latest/advanced/scripting/addon_tutorial.html#install-the-add-on
Image preview
Mesh
my_car (empty)
– chassis (mesh)
– chassis_asym (mesh)
– steering_wheel (mesh, Y up, rotate around Z)
– wiper_l (mesh)
– wiper_r (mesh)
– light_pod (mesh, auxiliary light for night stage)
– headlight (mesh, automatically mirrored, lighted up part of headlight)
– taillight (mesh, automatically mirrored, lighted up part of taillight)
– light_pod_light (mesh, automatically mirrored, lighted up light of light pod)
– disc_a_f (mesh, automatically mirrored, front disc for asphalt)
– disc_a_r (mesh, automatically mirrored, rear disc for asphalt)
– caliper_a_f (mesh, automatically mirrored, front caliper for asphalt)
– caliper_a_r (mesh, automatically mirrored, rear caliper for asphalt)
– disc_d_f (mesh, automatically mirrored, front disc for dirt)
– disc_d_r (mesh, automatically mirrored, rear disc for dirt)
– caliper_d_f (mesh, automatically mirrored, front caliper for dirt)
– caliper_d_r (mesh, automatically mirrored, rear caliper for dirt)– exhaust (empty, smoke position)
– dashboard (empty, Y up, Z toward driver, screen of dashboard, screen is 15cm x 8cm)
– driver (empty, position the driver seats)
– codriver (empty, position the codriver seats)– windows (mesh, transparent)
– headlight_glass (mesh, transparent, automatically mirrored)
– taillight_glass (mesh, transparent, automatically mirrored)
Chassis and chassis_asym are the main objects. They include everything that is not part of another object. The “asym” is here for your convenience. you can put all symmetric parts of the car in “chassis” and apply a “symmetry modifier”, and put all asymmetric part of car in “chassis_asym”.
The “light up” object are only visible when lights are turned up. They must be slightly in front of the base object to avoid clipping.
For automatically mirrored mesh, the export script will automatically create the object for the other side of the car.
The orientation of the car car must be z up and y forward. The origin of your car must be its center of gravity.
All meshes must be triangulated.
Select the base mesh and and export it: file>export>Virage RALLY mesh. Set export type to ‘car’ in export dialog window then export. The mesh file must be in ‘asset/car/’, be named “my_car.mesh”.
Texture
A car has 3 textures:
- suffix ‘_d’: diffuse color, RGB with BC1/DXT1 compression,
- suffix ‘_bs’: specular, grayscale with BC4/ATI1/3DC+ compression, black=matt, white=shiny,
- suffix ‘_d_t’: diffuse of transparent meshes, RGBA with BC3/DXT5 compression.
You texture folder should look like this:
└ asset
└ texture
└ my_car
├ my_car_d.dds
├ my_car_bs.dds
└ my_car_d_t.dds
Sound
A car has 4 sounds:
- backfire (exhaust backfire)
- engine (engine loop at 6000 rpm)
- start (engine starting)
- turbo (turbo blow off valve)
Your sound folder should look like this:
Configuration file
It describes the physics and resources used by the car. You should copy an existing one and tweak the values for your car.
For configuration that represent a position, the 3 values are in square bracket, for example:
wheel_mount0= [-0.8932, +1.024, -0.1120]
The first axis move the object left or right, positive value move it to the right.
The second axis move the object back or front, positive value move it to the front.
The third axis move the object up or down, positive value move it up.
Configuration that are adjustable take 3 values, for example:
front_stiffness= 25000.0, 95000.0, 13
means the suspension stiffness is adjustable from 25000N/m to 95000N/m with 13 steps in between. To make the car setup file reusable for all cars, it is advised to keep the same number of step as the base game file. If a property has 0 step, then it will not be adjustable.
File starts with the description of the car as it appears in the menu.
description= 4WD, 380, 6600, 450, 5600, 1190
This description would say in game:
“4WD, 380HP @ 6600rpm, 450Nm @ 5600rpm, 1190kg”
First field must be “AWD”, “FWD” or “RWD”. Other must match the properties of the car.
There are 5 cameras in game. This set the position in meter relative to center of gravity and a its rotation with a quaternion.
[camera_node]
# id, local position, local rotation,
close= [ 0.0, -4.8, 1.29], [0.707, 0.707, 0.0, 0.0]
far= [ 0.0, -6.7, 1.64], [0.707, 0.707, 0.0, 0.0]
cockpit= [-0.323, -0.42, 0.48], [0.707, 0.707, 0.0, 0.0]
bonnet= [ 0.0, 0.83, 0.46], [0.707, 0.707, 0.0, 0.0]
bumper= [ 0.0, 2.01, 0.00], [0.707, 0.707, 0.0, 0.0]
Name of the shader used for car.
[shader]body= car
Wheels are shared between car. You can find them in asset/mesh/wheel.
[wheel]asphalt= 18_8_A_00dirt= 15_7_D_00snow= 15_7_S_00
Torque in Nm for brake. Order is front left, front right, left rear and right rear. Bias between front and rear is adjustable so it takes 3 values (min, max, step).
[brake]torque= [1950.0, 1950.0, 1500.0, 1500.0]#Nm, max torquebias= 0.45, 0.95, 11
Gear ratios. Order is reverse, neutral (always 0), 1st, 2nd, …
Final gear ratio is adjustable.
[gearbox]ratio= -3.5, 0.0, 3.2727, 2.6667, 2.2, 1.7857, 1.4736, 1.2380final_ratio= 0.21, 0.27, 7
Front and read differential should be locked (0) or torsen (1). Center one can be locked (0), torsen (1), FWD (2), RWD (3). Locking on torsen can be adjusted (1=locked, 0=open). If center differential is “FWD”, then car is front wheel drive and rear differential value is ignored.
[differential]#0= locked,1= torsen,2= FWD,3= RWDcenter= 0 front= 1 rear= 1 # %locking center_param= 0.0, 1.0, 0front_param= 0.2, 0.7, 5rear_param= 0.2, 0.7, 5
Mass of car and driver in kg and moment of inertia in kgm².
[dynamics]mass= 1360.0 #kg, mass of car + driver # 1190/1350inertia= [1500.0, 700.0, 1600.0] #kgm², moment of inertia
Configuration of the engine.
“dyno” is a list of torque in Nm for 0, 1000rpm, 2000rpm…
If engine reach rpm_max, then ignition is cut.
“shift” and “downshift” is used for automatic gearbox. “redline” for dashboard.
“friction” define how fast the engine rev down when the throttle is lifted up.
[engine]
# 0 1 2 3 4 5 6 7 9 10 11 kRPM
dyno = [40, 60, 180, 320, 430, 450, 445, 372, 180, 30, 0] #Nm
rpm_idle= 2000.0 #rpm
rpm_max= 8500.0 #rpm
rpm_downshift= 5000.0
rpm_shift= 7250.0
rpm_redline= 7750.0
inertia= 0.07 #kgm², moment of inertia
engine_braking= 0.01 #Nms/rad
friction= 5.0 #Nm
position= [0.00, 1.20, 0.00] # for sound node
exhaust_position= [0.0, -2.07, -0.30] # for sound node, not for smoke
Wheel and steering geometry.
Toe and camber are adjustable, in degree.
[geometry]
kingpin_offset= 0.16 # m
kingpin_angle= -6.0 # °
caster= 5.0 # °
front_toe= -2.0, 2.0, 41
rear_toe= -2.0, 2.0, 41
front_camber= -3.0, 3.0, 61
rear_camber= -3.0, 3.0, 61[steering]
ackerman= 0.35 #ackerman effect, 0.0= parallel sterring, 1.0= full ackerman
max= 0.78 #0.785375 #rad, max steering angle
rate= 2.0 #rad/s, max rate of change of steering
steeringwheel_rot= 540 #°
Position of wheel in meter when suspension is fully compressed.
[suspension]
wheel_mount0= [-0.8932, +1.024, -0.1120] # front left
wheel_mount1= [+0.8932, +1.024, -0.1120] # front right
wheel_mount2= [-0.8932, -1.471, -0.1120] #rear left
wheel_mount3= [+0.8932, -1.471, -0.1120] #rear right
Some hack to decrease rolling.
roll_fix= [0.22, 0.22, 0.20, 0.20]
Suspension setup.
“vlim” is the threshold between high speed and low speed compression in m/s.
“bump_stop” is a coefficient that define how hard is the end of travel.
“dampcl”: low speed compression damping in Ns/m,
“dampch”: high speed compression damping in Ns/m,
“dampr”: rebound damping in Ns/m.
vlim= [0.2, 0.2, 0.2, 0.2] #m/s, low/high speed limit
bump_stop= [3.4, 3.4, 3.5, 3.5]front_ride_height= 0.08, 0.18, 21
front_travel= 0.1, 0.29, 21
front_stiffness= 25000.0, 95000.0, 13
front_dampcl= 2900.0, 5500.0, 25
front_dampch= 1500.0, 2800.0, 25
front_dampr= 4800.0, 9100.0, 25
front_antiroll= 4000.0, 40000.0, 15rear_ride_height= 0.08, 0.18, 21
rear_travel= 0.1, 0.28, 21
rear_stiffness= 20000.0, 75000.0, 13
rear_dampcl= 2400.0, 4500.0, 25
rear_dampch= 1200.0, 2300.0, 25
rear_dampr= 3900.0, 7500.0, 25
rear_antiroll= 4000.0, 40000.0, 15
Properties of the turbo.
[turbo]
boost= 0.2
inertia= 8.0E-4 #kgm², moment of inertia
rpm_max= 280000.0
Collision shape of the car is a sphere compound. Maximum of 16 spheres, from s0 to s15. Symmetry is apllied automatically, so you should provide spheres only for the right side.
[collision]
# 16 sphere max (s0 … s15)
# position radius
s0= [+0.241820, +1.522920, -0.073015], +0.347763
s1= [+0.491726, +1.304021, -0.011286], +0.405892
s10= [+0.291234, -1.358011, +0.362175], +0.459587
s2= [+0.436873, +0.762743, +0.026115], +0.459587
s3= [+0.401397, +0.165716, +0.026115], +0.459587
s4= [+0.400578, -0.450256, +0.026115], +0.459587
s5= [+0.446449, -1.070135, +0.026115], +0.459587
s6= [+0.521461, -1.615644, -0.032071], +0.381047
s7= [+0.191170, -1.769692, -0.056560], +0.347763
s8= [+0.270454, -0.056695, +0.365341], +0.459587
s9= [+0.291234, -0.663526, +0.379773], +0.459587