http://wiki.vdrift.net/api.php?action=feedcontributions&user=Timo+6&feedformat=atomVDrift - User contributions [en]2024-03-28T10:31:10ZUser contributionsMediaWiki 1.35.2http://wiki.vdrift.net/index.php?title=Creating_tracks&diff=1330Creating tracks2014-12-24T22:51:09Z<p>Timo 6: /* Other Notes */ Fix tab instead of space</p>
<hr />
<div>==Video Tutorial==<br />
NaN has produced this nifty video tutorial (Windows, but mostly applicable to Linux too): http://www.youtube.com/watch?v=oju-vKVVaho<br />
<br />
==What you need==<br />
* VDrift<br />
* VDrift level editor<br />
* Blender 2.33 or higher. Tested on 2.45 with Python 2.5.1<br />
* Blender JOE export script. Get that here: https://github.com/VDrift/blender-scripts<br />
Get the '''export-all-joe-0.3.py''' script. The difference in the files is that one exports all the object in the scene and the other only exports the one that is selected.<br />
<br />
==Getting the level editor==<br />
In the Linux console, copy ''everything'' below:<br />
git clone https://github.com/VDrift/trackeditor vdrift-trackeditor<br />
<br />
==Directions for creating tracks==<br />
* Model the scene. See [[3D modeling]] for resources to help with this step.<br />
* If you use a 3D editor other than blender, import the track into blender.<br />
* Use the '''export-all-joe-0.3.py''' blender export script to export all objects. This script can be found in the VDrift art repository under the tools folder. The export script creates a number of '''.joe''' files and a '''list.txt''' file. The '''list.txt''' file may be named '''somename-list.txt''', in which case you should rename it to '''list.txt'''. At least one '''.joe''' file should get created for the curve track. Also verify that '''list.txt''' is mentioning all the '''.joe''' files. An empty '''list.txt''' will not load anything in the editor.<br />
* Create new folder for track in track editor folder ''TRACKEDITOR_TP'' (if your track is called parkinglot, the path could be '''/home/joe/trackeditor/data/tracks/parkinglot''').<br />
* Make folder '''''TRACKEDITOR_TP''/objects/'''<br />
* Copy all of the '''.joe''' files and the '''list.txt''' file to '''''TRACKEDITOR_TP''/objects/'''<br />
* Open track editor '''data/tracks/editor.config''' and set active track to ''TRACKEDITOR_TP''.<br />
* Create a '''''TRACKEDITOR_TP''/track.txt''' file with at least a line "cull faces = on". '''track.txt''' is modified by track editor to add all starting positions and lap sequence points. Read the track editor inhelp for more information.<br />
* Run the track editor. Trace the roadways and mark the starting position (press H for help). A track may not always appear on the screen. Move the mouse around and you could see it in the black space. The first time, check the console output of track editor for any warnings.<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''Why trace roadways?'''<br />
[[Image:Track-smoothing.png]]<br />
This is a visual depiction of the track smoothing that occurs when tracing a roadway. Imagine this image is showing the track surface from a side view. The black lines represent the track mesh, and the red lines represent the bezier patches. Once the track has been traced in the track editor, VDrift will use the red lines to do collision instead of the black lines. On the top, this represents a dip in the road. You can see how collision using the red line will behave properly. On the bottom, this represents a bump road. You can see that the red line doesn't change the magnitude of the bumps, it just makes them realistically smooth instead of unrealistically pointy.<br />
|}<br />
* <code>cd</code> to the '''trackeditor/joepack''' folder. Compile the joepack tool by running<br />
scons<br />
* <code>cd</code> to the '''''TRACKEDITOR_TP''/objects''' folder (this is important, the packfile stores relative paths) and run<br />
/path/to/trackeditor/joepack/joepack -c objects.jpk *.joe<br />
* If you want, this command will show you the files in the joepack to allow you to verify the previous step worked correctly:<br />
/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk<br />
* Copy ''TRACKEDITOR_TP'' into the main VDrift tracks folder ''VDRIFT_TP'' (for example '''/home/joe/vdrift/data/tracks/parkinglot'''). Erase '''''VDRIFT_TP''/objects/*.joe''' since they are all in the pack file now.<br />
* Add '''''VDRIFT_TP''/about.txt''' and ensure that the first line is the name of the track. You should put information about the track author, where the track came from, etc in the second line and on.<br />
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.<br />
* Create a track selection image (a 512x512 png file works best) and save it to '''''VDRIFT_TP''/trackshot.png'''<br />
* Open up all of the texture files in '''''TRACKEDITOR_TP''/objects''' and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects sometimes look better when not mipmapped), or be skyboxes.<br />
* Set the correct object properties using the '''trackeditor/listedit''' tool (more documentation to come).<br />
* Done!<br />
<br />
==Other Notes==<br />
* A track should be of a minimum size for loading within VDrift. If the editor is not allowing to adjust the camera poistions correctly, probably the track is very small. Scale everything in the blender twice or more and try again. <br />
* Starting points are set within the track editor. After the track is loaded, position the track like you were in the car on the track i.e. first person view. Press L to save the position as a starting position. Continue to add positions depending on your track. Also add a lap sequence i.e. lap starting/ending point track.<br />
* Track editor does not paint or mark the starting points or lap sequence numbers on the track. These are only saved in track.txt. Also, the editor will always continue adding more starting positions if track.txt had some already. Therefore, consider deleting everything in '''track.txt''' if you wish to reedit the positions.<br />
* A .joe file gets created when the track has a texture.<br />
* The export-joe script should be loaded within blender along with the track, and executed.<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Creating_tracks&diff=1329Creating tracks2014-12-24T22:42:21Z<p>Timo 6: /* Directions for creating tracks */ Fix formatting</p>
<hr />
<div>==Video Tutorial==<br />
NaN has produced this nifty video tutorial (Windows, but mostly applicable to Linux too): http://www.youtube.com/watch?v=oju-vKVVaho<br />
<br />
==What you need==<br />
* VDrift<br />
* VDrift level editor<br />
* Blender 2.33 or higher. Tested on 2.45 with Python 2.5.1<br />
* Blender JOE export script. Get that here: https://github.com/VDrift/blender-scripts<br />
Get the '''export-all-joe-0.3.py''' script. The difference in the files is that one exports all the object in the scene and the other only exports the one that is selected.<br />
<br />
==Getting the level editor==<br />
In the Linux console, copy ''everything'' below:<br />
git clone https://github.com/VDrift/trackeditor vdrift-trackeditor<br />
<br />
==Directions for creating tracks==<br />
* Model the scene. See [[3D modeling]] for resources to help with this step.<br />
* If you use a 3D editor other than blender, import the track into blender.<br />
* Use the '''export-all-joe-0.3.py''' blender export script to export all objects. This script can be found in the VDrift art repository under the tools folder. The export script creates a number of '''.joe''' files and a '''list.txt''' file. The '''list.txt''' file may be named '''somename-list.txt''', in which case you should rename it to '''list.txt'''. At least one '''.joe''' file should get created for the curve track. Also verify that '''list.txt''' is mentioning all the '''.joe''' files. An empty '''list.txt''' will not load anything in the editor.<br />
* Create new folder for track in track editor folder ''TRACKEDITOR_TP'' (if your track is called parkinglot, the path could be '''/home/joe/trackeditor/data/tracks/parkinglot''').<br />
* Make folder '''''TRACKEDITOR_TP''/objects/'''<br />
* Copy all of the '''.joe''' files and the '''list.txt''' file to '''''TRACKEDITOR_TP''/objects/'''<br />
* Open track editor '''data/tracks/editor.config''' and set active track to ''TRACKEDITOR_TP''.<br />
* Create a '''''TRACKEDITOR_TP''/track.txt''' file with at least a line "cull faces = on". '''track.txt''' is modified by track editor to add all starting positions and lap sequence points. Read the track editor inhelp for more information.<br />
* Run the track editor. Trace the roadways and mark the starting position (press H for help). A track may not always appear on the screen. Move the mouse around and you could see it in the black space. The first time, check the console output of track editor for any warnings.<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''Why trace roadways?'''<br />
[[Image:Track-smoothing.png]]<br />
This is a visual depiction of the track smoothing that occurs when tracing a roadway. Imagine this image is showing the track surface from a side view. The black lines represent the track mesh, and the red lines represent the bezier patches. Once the track has been traced in the track editor, VDrift will use the red lines to do collision instead of the black lines. On the top, this represents a dip in the road. You can see how collision using the red line will behave properly. On the bottom, this represents a bump road. You can see that the red line doesn't change the magnitude of the bumps, it just makes them realistically smooth instead of unrealistically pointy.<br />
|}<br />
* <code>cd</code> to the '''trackeditor/joepack''' folder. Compile the joepack tool by running<br />
scons<br />
* <code>cd</code> to the '''''TRACKEDITOR_TP''/objects''' folder (this is important, the packfile stores relative paths) and run<br />
/path/to/trackeditor/joepack/joepack -c objects.jpk *.joe<br />
* If you want, this command will show you the files in the joepack to allow you to verify the previous step worked correctly:<br />
/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk<br />
* Copy ''TRACKEDITOR_TP'' into the main VDrift tracks folder ''VDRIFT_TP'' (for example '''/home/joe/vdrift/data/tracks/parkinglot'''). Erase '''''VDRIFT_TP''/objects/*.joe''' since they are all in the pack file now.<br />
* Add '''''VDRIFT_TP''/about.txt''' and ensure that the first line is the name of the track. You should put information about the track author, where the track came from, etc in the second line and on.<br />
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.<br />
* Create a track selection image (a 512x512 png file works best) and save it to '''''VDRIFT_TP''/trackshot.png'''<br />
* Open up all of the texture files in '''''TRACKEDITOR_TP''/objects''' and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects sometimes look better when not mipmapped), or be skyboxes.<br />
* Set the correct object properties using the '''trackeditor/listedit''' tool (more documentation to come).<br />
* Done!<br />
<br />
==Other Notes==<br />
* A track should be of a minimum size for loading within VDrift. If the editor is not allowing to adjust the camera poistions correctly, probably the track is very small. Scale everything in the blender twice or more and try again. <br />
* Starting points are set within the track editor. After the track is loaded, position the track like you were in the car on the track i.e. first person view. Press L to save the position as a starting position. Continue to add positions depending on your track. Also add a lap sequence i.e. lap starting/ending point track.<br />
* Track editor does not paint or mark the starting points or lap sequence numbers on the track. These are only saved in track.txt. Also, the editor will always continue adding more starting positions if track.txt had some already. Therefore, consider deleting everything in '''track.txt''' if you wish to reedit the positions.<br />
* A .joe file gets created when the track has a texture.<br />
* The export-joe script should be loaded within blender along with the track, and executed.<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Category:Historical&diff=1282Category:Historical2012-09-01T11:20:08Z<p>Timo 6: Historical information</p>
<hr />
<div>These pages contain information that is no longer true for the latest versions of VDrift or is generally outdated, but is kept for those who may still be running old versions, or for general interest.</div>Timo 6http://wiki.vdrift.net/index.php?title=Tire_parameters&diff=1281Tire parameters2012-09-01T11:17:36Z<p>Timo 6: Update categories</p>
<hr />
<div>Example from '''carparts/tire/touring''':<br />
restitution = 0.1<br />
tread = 0.25<br />
rolling-resistance = 1.3e-2, 6.5e-6<br />
# Lateral force<br />
a0=1.55<br />
a1=-55<br />
a2=1750<br />
a3=1900<br />
a4=7.2<br />
a5=0.014<br />
a6=-0.24<br />
a7=1.0<br />
a8=-0.03<br />
a9=-0.0013<br />
a10=-0.15<br />
a111=-8.5<br />
a112=-0.29<br />
a12=17.8<br />
a13=-2.4<br />
# Longitudinal force<br />
b0=1.65<br />
b1=-110<br />
b2=1800<br />
b3=23.3<br />
b4=410<br />
b5=0.075<br />
b6=0<br />
b7=0.055<br />
b8=-0.024<br />
b9=0.014<br />
b10=0.26<br />
# Aligning moment<br />
c0=2.2<br />
c1=-4.3<br />
c2=-4.4<br />
c3=-1.9<br />
c4=-9.6<br />
c5=0.0225<br />
c6=0<br />
c7=0.044<br />
c8=-0.58<br />
c9=0.18<br />
c10=0.043<br />
c11=0.048<br />
c12=-0.0035<br />
c13=-0.18<br />
c14=0.14<br />
c15=-1.029<br />
c16=0.27<br />
c17=-1.1<br />
Restitution defines tire restitution (not implemented atm). The tread parameter ranges over arbitrary values of 0.0 to 1.0, where 0.0 is a road tire and 1.0 is an off-road tire. The two elements of rolling-resistance are the constant and velocity-squared terms, respectively. The longitudinal, transverse, and aligning section each contain a vector of “magic formula” coefficients as presented in Motor Vehicle Dynamics, Genta (1997). A description is shown below:<br />
Shape factor ........................................... A0<br />
Load infl. on lat. friction coeff (*1000)... (1/kN) .... A1<br />
Lateral friction coefficient at load = 0 (*1000) ....... A2<br />
Maximum stiffness ........................ (N/deg) ..... A3<br />
Load at maximum stiffness ................ (kN) ........ A4<br />
Camber infiuence on stiffness ............ (%/deg/100) . A5<br />
Curvature change with load ............................. A6<br />
Curvature at load = 0 .................................. A7<br />
Horizontal shift because of camber ........(deg/deg).... A8<br />
Load influence on horizontal shift ........(deg/kN)..... A9<br />
Horizontal shift at load = 0 ..............(deg)........ A10<br />
Camber influence on vertical shift ........(N/deg/kN)... A111<br />
Camber influence on vertical shift ........(N/deg/kN**2) A112<br />
Load influence on vertical shift ..........(N/kN)....... A12<br />
Vertical shift at load = 0 ................(N).......... A13<br />
<br />
Shape factor ........................................... B0<br />
Load infl. on long. friction coeff (*1000)... (1/kN) ... B1<br />
Longitudinal friction coefficient at load = 0 (*1000)... B2<br />
Curvature factor of stiffness ............ (N/%/kN**2) . B3<br />
Change of stiffness with load at load = 0 (N/%/kN) ..... B4<br />
Change of progressivity of stiffness/load (1/kN) ....... B5<br />
Curvature change with load ............................. B6<br />
Curvature change with load ............................. B7<br />
Curvature at load = 0 .................................. B8<br />
Load influence on horizontal shift ....... (%/kN) ...... B9<br />
Horizontal shift at load = 0 ............. (%) ......... B10<br />
Load influence on vertical shift ......... (N/kN) ...... B11<br />
Vertical shift at load = 0 ............... (N) ......... B12<br />
<br />
Shape factor ........................................... C0<br />
Load influence of peak value ............ (Nm/kN**2) ... C1<br />
Load influence of peak value ............ (Nm/kN) ...... C2<br />
Curvature factor of stiffness ........... (Nm/deg/kN**2) C3<br />
Change of stiffness with load at load = 0 (Nm/deg/kN) .. C4<br />
Change of progressivity of stiffness/load (1/kN) ....... C5<br />
Camber influence on stiffness ........... (%/deg/100) .. C6<br />
Curvature change with load ............................. C7<br />
Curvature change with load ............................. C8<br />
Curvature at load = 0 .................................. C9<br />
Camber influence of stiffness .......................... C10<br />
Camber influence on horizontal shift......(deg/deg)..... C11<br />
Load influence on horizontal shift........(deg/kN)...... C12<br />
Horizontal shift at load = 0..............(deg)......... C13<br />
Camber influence on vertical shift........(Nm/deg/kN**2) C14<br />
Camber influence on vertical shift........(Nm/deg/kN)... C15<br />
Load influence on vertical shift..........(Nm/kN)....... C16<br />
Vertical shift at load = 0................(Nm).......... C17<br />
More information can be found at http://members.xoom.virgilio.it/adiaforo/epcjk.htm or if it's down try http://web.archive.org/web/20050913052226/http://members.xoom.virgilio.it/adiaforo/epcjk.htm<br />
<br />
There is a graphical tire parameters editor to adjust/review the parameters: http://svn.vdrift.net/viewvc.cgi<br />
<br />
[[Category:Cars]]<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Getting_cars/it&diff=1280Getting cars/it2012-09-01T11:16:55Z<p>Timo 6: Update categories</p>
<hr />
<div><small>[[Getting cars|English]] - [[Getting cars/it|Italiano]]</small><br />
<br />
==Aggiungere altre autovetture==<br />
<br />
Questo articolo spiega come si aggiungono altre autovetture per VDrift e come si installano.<br />
<br />
==Trovare ulteriori autovetture==<br />
* Una gamma di autovetture si possono trovare sul sito [http://cars.vdrift.net cars.vdrift.net]. Apri semplicemente la pagina dell'autovettura che vuoi scaricare e se lo stato visualizza ''playable'' è possibile utilizzarlo per giocare con VDrift. Quindi scarichi il file .zip o .tar.gz<br />
* Puoi anche scaricare autovetture da svn. Clicca i link nell'[[List of cars|elenco di autovetture]] (per il momento disponibile solo in inglese) per andare sulla pagina e quindi clicca sul link 'Download GNU Tarball'.<br />
<br />
==Installare le autovetture==<br />
A questo punto dovresti disporre di un file .zip o .tar.gz. Entrambi sono formati compattati. Per scompattare i files puoi utilizzare software come '''Ark''' o '''File roller''' per Linux e [http://www.7-zip.org/ 7zip] per Windows. Sono tutti software liberi. Durante la scompattazione normalmente si crea una cartella con il nome dell'autovettura. Questa cartella (che dovrebbe contenere files che si chiamano about.txt e body.joe) nella cartella '''... vdrift/data/cars'''. Quindi eseguire VDrift e la nuova autovettura è pronta per essere guidata!<br />
<br />
[[Category:Autovetture]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Category:Autovetture&diff=1279Category:Autovetture2012-09-01T11:16:19Z<p>Timo 6: Add link to English page</p>
<hr />
<div><small>[[:Category:Cars|English]] - [[:Category:Autovetture|Italiano]]</small></div>Timo 6http://wiki.vdrift.net/index.php?title=Category:Cars&diff=1278Category:Cars2012-09-01T11:16:06Z<p>Timo 6: Add link to Italian page</p>
<hr />
<div><small>[[:Category:Cars|English]] - [[:Category:Autovetture|Italiano]]</small><br />
<br />
These pages contain information about VDrift cars.</div>Timo 6http://wiki.vdrift.net/index.php?title=Listedit_tool&diff=1277Listedit tool2012-09-01T11:09:58Z<p>Timo 6: Update categories</p>
<hr />
<div>Listedit is part of the [[Track editor]] tools that simplifies working on [[Track files and formats#objects/list.txt|list.txt]] files. It is a command line style program.<br />
<br />
==list.txt format==<br />
The list.txt file contains object definitions in sections, separated by a blank line. A description of each field in the list.txt file can be found at the following location:<br />
<br />
https://github.com/VDrift/trackeditor/blob/master/listedit/format.txt<br />
<br />
The numbers next to each of the lines is important to the way the listedit program works.<br />
<br />
==Commands==<br />
The basic commands are<br />
* '''load'''<br />
* '''save'''<br />
* '''ls'''<br />
* '''set'''<br />
* '''quit'''<br />
* '''addparam'''<br />
<br />
Load, save, and quit are obvious. You can supply arguments to load and save to specify the file if you want. The ls and set commands work using the object list file format.<br />
<br />
===ls===<br />
The first argument to ls is the object property you want to search. For example, specify 1 if you want to search objects based on the texture filename. The second argument to ls is what you want to search for. You can use * and ? wildcards. For example, to find all of the objects that use a texture called sky*, you'd do: <br />
ls 1 sky*<br />
<br />
To find all of the objects that have the skybox property set to true (1), do: <br />
ls 4 1<br />
<br />
===set===<br />
The '''set''' command is similar to '''ls'''. It allows you to both search for objects and set their properties in one step. The first two arguments to set are exactly the same as ls. The second two arguments the property you want to set on the objects that match your search. For example, say want to set the skybox property to true for all objects that have a texture starting with "sky"... you'd do:<br />
set 1 sky* 4 1<br />
<br />
{{note|All of the objects will start with default properties.}}<br />
<br />
===addparam===<br />
This command takes 1 argument. This command will add one parameter to each object and is primarily used when upgrading a list.txt file from an old version (say, with 14 parameters per object) to a new version (say, with 15 parameters per object). The argument is the default value that all objects will start with for the new parameter.<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Using_SCons&diff=1276Using SCons2012-09-01T11:09:33Z<p>Timo 6: Update categories</p>
<hr />
<div>[http://scons.org/ SCons] is a replacement for autotools written in Python.<br />
<br />
{{note|Throughout the <code>scons</code> command will be used; if you are using scons-local that is distributed with VDrift you'll need to replace every instance of <code>scons</code> with <code>./scons.py</code>.}}<br />
<br />
==Compile==<br />
To [[Compiling|compile VDrift]], simply run SCons. It reads the root level SCons configuration file, SConstruct, as well as the configuration files in subdirectories (called SConscript), when it is run to see what to do.<br />
scons<br />
SCons starts by checking your system for available libraries. If things go well, this will look something like this:<br />
<br />
you@yourcomputer:~/games/vdrift$ scons<br />
scons: Reading SConscript files ...<br />
Checking for main() in C library GL... yes<br />
Checking for main() in C library GLU... yes<br />
Checking for main() in C library openal... yes<br />
Checking for C++ header file SDL/SDL.h... yes<br />
Checking for C++ header file SDL/SDL_image.h... yes<br />
Checking for C++ header file SDL/SDL_net.h... yes<br />
scons: done reading SConscript files.<br />
<br />
Now, SCons will begin compiling VDrift, one file at a time, starting with the Vamos files and ending with linking the main executable. When changes to the source files are made, <code>scons</code> must be run again to update the build.<br />
<br />
==Clean==<br />
When building a project it is sometimes necessary to "clean" a build (remove all files produced by the build). This can be done with the <code>-c</code> flag:<br />
scons -c<br />
All the object and binary executable files will be removed. Then when you run <code>scons</code> again, all the files will be rebuilt.<br />
<br />
==Help==<br />
If you wish to list the options available at build time you may do so by executing <code>scons -h</code>. This will show all the available options, their default values, and their current values.<br />
<br />
==Quiet==<br />
If you want SCons to give less verbose output when compiling use the <code>-Q</code> option.<br />
<br />
[[Category:Development]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Old_Method_of_Compiling_on_Linux&diff=1275Old Method of Compiling on Linux2012-09-01T11:05:23Z<p>Timo 6: Update categories</p>
<hr />
<div>{{note|This page is deprecated and only kept for future reference. See [[Installing]] for current information.}}<br />
<br />
==Linux==<br />
===Prerequisites===<br />
Make sure you have all the required libraries and build tools. Make sure you also have the development files for each of the libraries.<br />
<br />
The required build tools include:<br />
<br />
* '''g++''' - The GNU C++ compiler<br />
* '''scons''' - A replacement for Make<br />
<br />
The required libraries include:<br />
<br />
* '''libsdl''' - Simple Direct Media Layer<br />
* '''libglew''' - OpenGL extension utilities<br />
* '''sdl-gfx''' - Graphics drawing primitives library for SDL<br />
* '''sdl-image''' - Image file loading library for SDL<br />
* '''vorbisfile''' - File loading library for the ogg vorbis format<br />
* '''libvorbis''' - The Vorbis General Audio Compression Codec<br />
* '''libbullet''' - Bullet Physics Library<br />
* '''libcurl''' - the multiprotocol file transfer library<br />
* '''libarchive''' - library for reading and writing archive formats<br />
* Boost C++ Libraries (header-file-only)<br />
* ASIO C++ Libraries (header-file-only)<br />
<br />
Your Linux distribution may have different package names and/or bundled differently. The list above should give enough information to search for applicable packages within your distribution's package manager.<br />
<br />
For Ubuntu, all the required packages may be installed using this command:<br />
sudo apt-get install g++ scons libsdl-gfx1.2-dev libsdl-image1.2-dev libsdl-net1.2-dev libvorbis-dev libglew-dev libbullet-dev libasio-dev libboost-dev libcurl4-gnutls-dev libarchive-dev<br />
<br />
For Ubuntu 8.04 you additionally need:<br />
sudo apt-get install libboost-date-time-dev libboost-regex-dev<br />
<br />
{{note|VDrift requires libglew version greater than 1.5.3.}}<br />
For Ubuntu:<br />
* https://launchpad.net/~amuzen/+archive/ppa<br />
* Or download http://glew.sourceforge.net/ the zipped or tared version of glew (repo one doesn't build) and do "make; sudo make install"<br />
<br />
====Bullet====<br />
As of SVN R2358 (2009-06-15 release and later), no steps are required to build bullet and you can continue to the next section.<br />
<br />
For the 2009-02-15 release, the only step required is to expand the Bullet source archive:<br />
tar zxvf bullet-2.73-sp1.tgz<br />
<br />
{{note|For older versions of VDrift, you will need to follow the [[Old Method of Compiling Bullet]].}}<br />
<br />
====SCons====<br />
As of the 2005-10-02 release, VDrift no longer uses ./configure, make, etc. (autotools). Now the project is built with [http://scons.org/ SCons]. You may want to read a little about [[Using SCons]].<br />
<br />
There are two ways to use SCons. The first way is to install scons on your system through your package manager, then you can use it simply by the name of the program, "scons". If you followed the directions for installing prerequisites for Ubuntu above, then you're done and can continue on to the next section. The second way is to use the scons-local package (included with VDrift) which will do the same thing but doesn't require that you install scons on your system. To do this, you must move the scons-local-0.96.95.tar.gz archive from tools to the root vdrift folder, un-tar the archive, and then use the <code>./scons.py</code> command instead of <code>scons</code>.<br />
<br />
===Get the Code===<br />
You can get the code from a source package for a particular version, or you can [[Getting the development version|get the development version]].<br />
====Source Package====<br />
[http://sourceforge.net/project/showfiles.php?group_id=137283 Download] the latest VDrift Linux source package. All the files in the package are in a directory called vdrift-'''version'''-src where '''version''' is something like 2009-06-15.<br />
<br />
Unpack the archive.<br />
<br />
tar jxvf vdrift-2009-06-15-src.tar.bz2<br />
<br />
=====Enter directory=====<br />
Now change directories into the location of your newly created VDrift source tree.<br />
cd vdrift-2009-06-15<br />
<br />
====Optional: Using scons-local instead of installing SCons====<br />
If you have decided not to install SCons on your system, you can use scons-local. To set it up, do the following:<br />
<br />
tar zxvf tools/scons-local-0.96.1.tar.gz<br />
<br />
{{note|Some of the following steps refer to the <code>scons</code> command, you should now replace that with <code>./scons.py</code>.}}<br />
<br />
===Compiling===<br />
To compile VDrift, just use the <code>scons</code> command.<br />
scons<br />
<br />
====Optional: Compile Options====<br />
You can use one or more compile options. To compile with optimization for a certain platform, you can use the '''arch''' option.<br />
scons arch=a64<br />
Compiling VDrift in '''release''' mode will turn off debugging options, and enable more compiler optimizations. VDrift runs much more quickly in release mode.<br />
scons release=1<br />
{{note|These options are probably best left off the first time you compile. If you have problems compiling or running VDrift, it is easier to debug with them off. Once you verify that VDrift is compiling, then recompile with these optimizations to improve performance.}}<br />
<br />
===Installing===<br />
VDrift does not need to be installed to work and you can run it from the folder where you compiled it. If you do want to install, use the SCons build target '''install'''. This command must be run as root.<br />
sudo scons install<br />
{{note|The <code>scons install</code> process was broken for several releases including the 2009-02-15 release and may fail to install needed datafiles. If you have release 2009-02-15 or earlier, run "sudo scons install" as noted above and then manually re-copy the data files to the installed destination folder:<br />
sudo cp -r data/* /usr/share/games/vdrift/data}}<br />
<br />
====Optional: Installation Location====<br />
You can change the installation prefix. For example, if you want VDrift to go in <code>/usr/local/share/games/vdrift</code>, you can change the '''prefix''' setting.<br />
scons install prefix=/usr/local<br />
<br />
{{note|There are many more build and install options, see the [[Using SCons]] page for more information.}}<br />
<br />
===Running===<br />
For release 2009-02-15 and earlier, if you used the default install locations, VDrift can be run with the command:<br />
/usr/share/games/vdrift/bin/vdrift<br />
For release 2009-06-15 and later, if you used the default install locations, VDrift can be run with the command:<br />
/usr/local/bin/vdrift<br />
<br />
[[Category:Development]]<br />
[[Category:Historical]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Enabling_force_feedback_in_kernel&diff=1274Enabling force feedback in kernel2012-09-01T11:04:59Z<p>Timo 6: Update categories</p>
<hr />
<div>Here is how to enable force feedback on Ubuntu 8.10 64 bits kernels (should also work on 32 bits ones):<br />
<br />
==For the G25 owners==<br />
If you use a G25 wheel, you need to patch your kernel to be able to use it in its native mode<br />
First create a patch file named G25.patch for the kernel ( patches for 2.6.27 and 2.6.28 are provided ).<br />
<br />
===kernel 2.6.27===<br />
diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-ff.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-ff.c<br />
--- linux-source-2.6.27/drivers/hid/usbhid/hid-ff.c 2008-10-10 00:13:53.000000000 +0200 <br />
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-ff.c 2009-02-23 22:21:27.000000000 +0100 <br />
@@ -57,6 +57,7 @@ <br />
{ 0x46d, 0xc286, hid_lgff_init }, /* Logitech Force 3D Pro Joystick */ <br />
{ 0x46d, 0xc294, hid_lgff_init }, /* Logitech Formula Force EX */ <br />
{ 0x46d, 0xc295, hid_lgff_init }, /* Logitech MOMO force wheel */<br />
+ { 0x46d, 0xc299, hid_lgff_init }, /* Logitech G25 wheel */<br />
{ 0x46d, 0xca03, hid_lgff_init }, /* Logitech MOMO force wheel */<br />
#endif<br />
#ifdef CONFIG_LOGIRUMBLEPAD2_FF<br />
diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-lgff.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-lgff.c<br />
--- linux-source-2.6.27/drivers/hid/usbhid/hid-lgff.c 2008-10-10 00:13:53.000000000 +0200<br />
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-lgff.c 2009-02-23 22:23:22.000000000 +0100<br />
@@ -55,6 +55,7 @@<br />
{ 0x046d, 0xc286, ff_joystick },<br />
{ 0x046d, 0xc294, ff_joystick },<br />
{ 0x046d, 0xc295, ff_joystick },<br />
+ { 0x046d, 0xc299, ff_joystick },<br />
{ 0x046d, 0xca03, ff_joystick },<br />
};<br />
diff -Naur linux-source-2.6.27/drivers/hid/usbhid/hid-quirks.c linux-source-2.6.27.orig/drivers/hid/usbhid/hid-quirks.c<br />
--- linux-source-2.6.27/drivers/hid/usbhid/hid-quirks.c 2009-03-13 18:54:14.000000000 +0100<br />
+++ linux-source-2.6.27.orig/drivers/hid/usbhid/hid-quirks.c 2009-02-23 22:25:45.000000000 +0100<br />
@@ -316,6 +316,7 @@<br />
#define USB_DEVICE_ID_LOGITECH_HARMONY_64 0xc14f<br />
#define USB_DEVICE_ID_LOGITECH_EXTREME_3D 0xc215<br />
#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294<br />
+#define USB_DEVICE_ID_LOGITECH_WHEELG25 0xc299<br />
#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a<br />
#define USB_DEVICE_ID_LOGITECH_KBD 0xc311<br />
#define USB_DEVICE_ID_S510_RECEIVER 0xc50c<br />
@@ -625,6 +626,7 @@<br />
{ USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },<br />
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_EXTREME_3D, HID_QUIRK_NOGET },<br />
{ USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEEL, HID_QUIRK_NOGET },<br />
+ { USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_WHEELG25, HID_QUIRK_NOGET },<br />
{ USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_WIRELESS_OPTICAL_DESKTOP_3_0, HID_QUIRK_NOGET },<br />
{ USB_VENDOR_ID_PETALYNX, USB_DEVICE_ID_PETALYNX_MAXTER_REMOTE, HID_QUIRK_NOGET },<br />
{ USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET },<br />
<br />
===kernel 2.6.28===<br />
diff -Naur linux-source-2.6.28/drivers/hid/hid-core.c linux-source-2.6.28.patched/drivers/hid/hid-core.c<br />
--- linux-source-2.6.28/drivers/hid/hid-core.c 2009-04-08 06:38:33.000000000 +0200<br />
+++ linux-source-2.6.28.patched/drivers/hid/hid-core.c 2009-04-10 14:15:27.000000000 +0200<br />
@@ -1290,6 +1290,7 @@<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_FORCE3D_PRO) },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL) },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2) },<br />
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL) },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2) },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_SIDEWINDER_GV) },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_NE4K) },<br />
diff -Naur linux-source-2.6.28/drivers/hid/hid-ids.h linux-source-2.6.28.patched/drivers/hid/hid-ids.h<br />
--- linux-source-2.6.28/drivers/hid/hid-ids.h 2008-12-25 00:26:37.000000000 +0100<br />
+++ linux-source-2.6.28.patched/drivers/hid/hid-ids.h 2009-04-10 14:12:44.000000000 +0200<br />
@@ -291,6 +291,7 @@<br />
#define USB_DEVICE_ID_LOGITECH_FORCE3D_PRO 0xc286<br />
#define USB_DEVICE_ID_LOGITECH_WHEEL 0xc294<br />
#define USB_DEVICE_ID_LOGITECH_MOMO_WHEEL 0xc295<br />
+#define USB_DEVICE_ID_LOGITECH_G25_WHEEL 0xc299<br />
#define USB_DEVICE_ID_LOGITECH_ELITE_KBD 0xc30a<br />
#define USB_DEVICE_ID_LOGITECH_KBD 0xc311<br />
#define USB_DEVICE_ID_S510_RECEIVER 0xc50c<br />
diff -Naur linux-source-2.6.28/drivers/hid/hid-lg.c linux-source-2.6.28.patched/drivers/hid/hid-lg.c<br />
--- linux-source-2.6.28/drivers/hid/hid-lg.c 2008-12-25 00:26:37.000000000 +0100<br />
+++ linux-source-2.6.28.patched/drivers/hid/hid-lg.c 2009-04-10 14:14:17.000000000 +0200<br />
@@ -304,6 +304,8 @@<br />
.driver_data = LG_FF },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_MOMO_WHEEL2),<br />
.driver_data = LG_FF },<br />
+ { HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_G25_WHEEL),<br />
+ .driver_data = LG_FF },<br />
{ HID_USB_DEVICE(USB_VENDOR_ID_LOGITECH, USB_DEVICE_ID_LOGITECH_RUMBLEPAD2),<br />
.driver_data = LG_FF2 },<br />
{ }<br />
<br />
==Enabling force feedback in the kernel==<br />
===Prepare to compile a kernel===<br />
Make sure you have everything needed to compile your kernel :<br />
sudo apt-get install fakeroot build-essential makedumpfile libncurses5 libncurses5-dev kernel-package<br />
sudo apt-get build-dep linux<br />
Get the kernel source code :<br />
sudo apt-get install linux-source<br />
Now we are ready to start :<br />
Prepare your environment:<br />
mkdir ~/src<br />
cd ~/src<br />
tar xjvf /usr/src/linux-source-<version>.tar.bz2<br />
cd linux-source-<version><br />
<br />
===Apply the G25 patch if needed===<br />
Copy the G25.patch file into the source directory ( ~/src ) and<br />
patch -p1 <../G25.patch<br />
The output should be something like that:<br />
patching file drivers/hid/usbhid/hid-ff.c<br />
patching file drivers/hid/usbhid/hid-lgff.c<br />
patching file drivers/hid/usbhid/hid-quirks.c<br />
<br />
===Configure the new kernel===<br />
Get the running kernel configuration:<br />
cp -vi /boot/config-`uname -r` .config<br />
Adjust the kernel configuration:<br />
make oldconfig<br />
make menuconfig<br />
Go to Device Drivers , and HID Devices <br />
and enable the following options<br />
Force feedback support (EXPERIMENTAL)<br />
PID device support<br />
Logitech devices support<br />
Logitech Rumblepad 2 support<br />
PantherLord/GreenAsia based device support<br />
ThrustMaster devices support<br />
Zeroplus based game controller support<br />
With the 2.6.27 kernel on Ubuntu 8.10, I have to disable paravirtualized guest support otherwise the kernel cleaning fail.<br />
This is not needed on 2.6.28 on Ubuntu 9.04 beta (2.6.28.11)<br />
Go to Processor type and features and disable the following:<br />
Paravirtualized guest support<br />
<br />
===Compile and package the new kernel===<br />
make-kpkg clean<br />
fakeroot make-kpkg --initrd --append-to-version=-ff kernel-image kernel-headers<br />
You now have 2 new package files in ~/src.<br />
<br />
===Install the new kernel===<br />
sudo dpkg -i linux-image-2.6.27.18-ff_2.6.27.18-ff-10.00.Custom_amd64.deb linux-headers-2.6.27.18-ff_2.6.27.18-ff-10.00.Custom_amd64.deb<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_parameters_for_vdrift-2009-06-15_and_older&diff=1273Car parameters for vdrift-2009-06-15 and older2012-09-01T11:01:25Z<p>Timo 6: Update categories</p>
<hr />
<div>The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
For unit conversion you can go to: [http://www.sonar-equipment.com/useful_conversion_factors_table1_p00.htm ''This Site''].<br />
<br />
The .car file contains several sections. Each section will now be described, along with example values from the XS.car file. The XS has performance comparable to the Honda S2000.<br />
<br />
==Coordinate system==<br />
A vector of 3 floats ( 1.0, 3.0, 1.5 ) will be interpreted as distances from the car body model origin. See [[Coordinate systems]] for a detailed description.<br />
<br />
==Top level parameters==<br />
<pre><br />
drive = RWD<br />
</pre><br />
The "drive" parameter accepts values "RWD", "FWD", "AWD" that correspond to rear wheel drive, front wheel drive, and all wheel drive, respectively.<br />
<br />
<pre><br />
version = 2<br />
</pre><br />
The file format version. The only change between version 1 and version 2 is the move to coordinate system version 2, which is described in [[Coordinate systems]]. If no version is specified version 1 is assumed. VDrift is backward compatible with previous file formats. VDrift is not forward compatible with new file formats -- that is, VDrift will refuse to load a file specifying format version 3 if VDrift's code only supports version 2.<br />
<br />
==Steering==<br />
<pre><br />
max-angle = 33.19<br />
</pre><br />
This defines the maximum angle that the wheels will turn in each direction. For the XS, when the steering wheel is full left, the wheels would be at -33.19 degrees.<br />
<br />
==Engine==<br />
<pre><br />
position = 0.86, 0.0, -0.21<br />
mass = 140.0<br />
max-power = 1.79e5<br />
peak-engine-rpm = 7800.0<br />
rpm-limit = 9000.0<br />
inertia = 0.25<br />
idle = 0.02<br />
start-rpm = 1000<br />
stall-rpm = 350<br />
fuel-consumption = 1e-9<br />
torque-friction = 0.0003<br />
torque-curve-00 = 1000, 140.0<br />
torque-curve-01 = 2000, 149.14<br />
torque-curve-02 = 2200, 145.07<br />
torque-curve-03 = 2500, 147.78<br />
torque-curve-04 = 3000, 169.50<br />
torque-curve-05 = 3300, 172.19<br />
torque-curve-06 = 4000, 169.50<br />
torque-curve-07 = 4500, 166.77<br />
torque-curve-08 = 5600, 172.19<br />
torque-curve-09 = 5800, 170.83<br />
torque-curve-10 = 6000, 168.12<br />
torque-curve-11 = 6100, 177.61<br />
torque-curve-12 = 6200, 186.42<br />
torque-curve-13 = 6300, 192.53<br />
torque-curve-14 = 6500, 195.92<br />
torque-curve-15 = 6700, 195.92<br />
torque-curve-16 = 7000, 195.24<br />
torque-curve-17 = 7600, 190.49<br />
torque-curve-18 = 8000, 184.39<br />
torque-curve-19 = 8200, 183.04<br />
torque-curve-20 = 8300, 146.43<br />
torque-curve-21 = 9500, 146.43<br />
</pre><br />
The position and mass parameters affect the weight distribution of the car. The torque curve is calculated from max-power and peak-engine-rpm using a polynomial expression given in Motor Vehicle Dynamics, Genta (1997), where peak-engine-rpm is the engine speed at which the maximum power output (max-power) is achieved. Alternatively, the torque curve can be explicitly defined, as in the example above. A rev limit can be set with rpm-limit. The rotational inertia of the moving parts is inertia. idle is the throttle position at idle. Starting the engine initially sets the engine speed to start-rpm. Letting the engine speed drop below stall-rpm makes the engine stall. The rate of fuel consumption is set with fuel-consumption. The actual fuel consumed each second (in units of liters) is the fuel-consumption parameter times RPM times throttle (throttle is from 0.0 to 1.0, where 1.0 is full throttle).<br />
<br />
==Clutch==<br />
<pre><br />
sliding = 0.27<br />
radius = 0.15<br />
area = 0.75<br />
max-pressure = 11079.26<br />
</pre><br />
The clutch is described by its sliding friction coefficient, radius, area and maximum applied pressure. The torque capacity(maximum transmitted torque) of the clutch is TC = sliding * radius * area * max-pressure. It should be somewhere between one and two times the maximum enine torque. TC = 1.25 * max-engine-torque is a good start value.<br />
<br />
==Transmission==<br />
<pre><br />
gears = 6<br />
gear-ratio-r = -2.8<br />
gear-ratio-1 = 3.133<br />
gear-ratio-2 = 2.045<br />
gear-ratio-3 = 1.481<br />
gear-ratio-4 = 1.161<br />
gear-ratio-5 = 0.943<br />
gear-ratio-6 = 0.763<br />
shift-time = 0.2<br />
</pre><br />
The number of forward gears is set with the gears parameter. The gear ration for reverse and all of the forward gears is then defined. The shift-time tag tells how long it takes, in total seconds, to change gears (when autoclutch is enabled). Half the time is spent changing the gear and the other half is spent letting the clutch out. This parameter is not required and defaults to 0.2 seconds, which is a reasonable value for a manual transmission. F1 cars take about 50 ms, by comparison.<br />
<br />
==Differential==<br />
<pre><br />
final-drive = 4.100<br />
anti-slip = 600.0<br />
anti-slip-torque = 1<br />
anti-slip-torque-deceleration-factor = 0<br />
</pre><br />
The final drive provides an additional gear reduction. The anti-slip parameter defines the maximum anti-slip torque. For speed-sensitive differentials, it also defines the anti-slip torque per radian per second of speed difference between the wheels. If the differential is speed-sensitive, the anti-slip-torque and anti-slip-torque-deceleration-factor parameters must be omitted or set to zero. If the differential is torque-sensitive, then anti-slip-torque defines the amount of anti-slip torque per input torque. The anti-slip-torque-deceleration-factor defines the amount of anti-slip torque per negative input torque. For a 1-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to zero, for a 2-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to 1.0, for 1.5-way, set it between 0.0 and 1.0.<br />
<br />
==Fuel tank==<br />
<pre><br />
position = -0.8, -0.1, -0.26<br />
capacity = 0.0492<br />
volume = 0.0492<br />
fuel-density = 730.0<br />
</pre><br />
The fuel tank's position, the current volume of fuel and the density of the fuel affect the car's weight distribution. The capacity tag sets the maximum volume of fuel that the tank can hold. The initial volume is set with the volume tag. The density of the fuel is set with fuel-density.<br />
<br />
==Suspension==<br />
Front/rear parameters are broken into two fields. Per-wheel parameters are broken into four fields. In the example below the front suspension is shown, followed by the front left wheel suspension parameters.<br />
<pre><br />
[ suspension-front ]<br />
spring-constant = 49131.9<br />
spring-factor-1 = 0.052, 1.0<br />
spring-factor-2 = 0.055, 1.2<br />
bounce = 2588<br />
rebound = 2612<br />
damper-factor-1 = 0.08,1.0<br />
damper-factor-2 = 0.1, 0.7<br />
travel = 0.19<br />
camber = -1.33<br />
caster = 6.12<br />
toe = 0.0<br />
anti-roll = 8000.0<br />
</pre><br />
<pre><br />
[ suspension-FL ]<br />
hinge = 0,0,0<br />
</pre><br />
The spring-constant is the '''wheel rate''' in N/m. The spring-factor-1 and 2 parameters define a curve for the spring response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is the suspension displacement in meters and y is the factor to be applied to the spring coefficient. In this example, the spring factor will be 1.0 when the displacement is between 0 and 0.052 m, and then the spring factor will change linearly to 1.2 at 0.055 m (and beyond). The spring factor gets multiplied by the spring-constant. You can put as many spring-factor points as you want (just increase the spring-factor- number for each additional point). Note that displacement values are relative to the "zero g", "zero force" position. For best results, start VDrift with the -debug option and observe suspension displacements during maneuvering to determine where you want to put your points.<br />
<br />
The bounce and rebound parameters are the damping coefficients for compression and expansion of the suspension, respectively, in units of N/m/s. The damper-factor-1 and 2 parameters define a curve for the damper response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is an absolute value of suspension velocity in m/s and y is the factor to be applied to the damping coefficient. In this example, the damper factor will be 1.0 when the compression velocity absolute value is between 0 and 0.08 m/s, and then the damper factor will change linearly to 0.7 at 0.1 m/s (and beyond). The damper factor gets applied to the bonce or rebound damper coefficient, depending on the direction of travel. You can put as many damper-factor points as you want (just increase the damper-factor- number for each additional point).<br />
<br />
The hinge is the center of the wheel's path as the suspension moves. The location of the hinge is determined by suspension geometry, and may be outside of the car itself.<br />
<br />
Wheel alignment is set with the camber, caster, and toe tags. All angles are in degrees.<br />
<br />
Note that the suspension position parameter and the max-compression-velocity parameters are no longer used and can be omitted.<br />
<br />
==Tire==<br />
Front/rear parameters are broken into two fields. In the example below the front tire section is shown.<br />
<pre><br />
radius = 0.29<br />
rolling-resistance = 1.3e-2, 6.5e-6<br />
rotational-inertia = 10.0<br />
tread = 0.0<br />
# Lateral force<br />
a0=1.6<br />
a1=-38<br />
a2=1201<br />
a3=1914<br />
a4=8.7<br />
a5=0.014<br />
a6=-0.24<br />
a7=1.0<br />
a8=-0.03<br />
a9=-0.0013<br />
a10=-0.15<br />
a111=-8.5<br />
a112=-0.29<br />
a12=17.8<br />
a13=-2.4<br />
# Longitudinal force<br />
b0=1.7<br />
b1=-80<br />
b2=1571<br />
b3=23.3<br />
b4=300<br />
b5=0<br />
b6=0.0068<br />
b7=0.055<br />
b8=-0.024<br />
b9=0.014<br />
b10=0.26<br />
b11=-86<br />
b12=350<br />
# Aligning moment<br />
c0=2.3<br />
c1=-3.8<br />
c2=-3.14<br />
c3=-1.16<br />
c4=-7.2<br />
c5=0.0<br />
c6=0.0<br />
c7=0.044<br />
c8=-0.58<br />
c9=0.18<br />
c10=0.043<br />
c11=0.048<br />
c12=-0.0035<br />
c13=-0.18<br />
c14=0.14<br />
c15=-1.029<br />
c16=0.27<br />
c17=-1.1<br />
</pre><br />
The two elements of rolling-resistance are the constant and velocity-squared terms, respectively. Radius defines the radius of the tire. The tread parameter ranges over arbitrary values of 0.0 to 1.0, where 0.0 is a road tire and 1.0 is an off-road tire. The longitudinal, transverse, and aligning section each contain a vector of “magic formula” coefficients as presented in Motor Vehicle Dynamics, Genta (1997). A description is shown below:<br />
<pre><br />
Shape factor ........................................... A0<br />
Load infl. on lat. friction coeff (*1000)... (1/kN) .... A1<br />
Lateral friction coefficient at load = 0 (*1000) ....... A2<br />
Maximum stiffness ........................ (N/deg) ..... A3<br />
Load at maximum stiffness ................ (kN) ........ A4<br />
Camber infiuence on stiffness ............ (%/deg/100) . A5<br />
Curvature change with load ............................. A6<br />
Curvature at load = 0 .................................. A7<br />
Horizontal shift because of camber ........(deg/deg).... A8<br />
Load influence on horizontal shift ........(deg/kN)..... A9<br />
Horizontal shift at load = 0 ..............(deg)........ A10<br />
Camber influence on vertical shift ........(N/deg/kN)... A111<br />
Camber influence on vertical shift ........(N/deg/kN**2) A112<br />
Load influence on vertical shift ..........(N/kN)....... A12<br />
Vertical shift at load = 0 ................(N).......... A13<br />
<br />
Shape factor ........................................... B0<br />
Load infl. on long. friction coeff (*1000)... (1/kN) ... B1<br />
Longitudinal friction coefficient at load = 0 (*1000)... B2<br />
Curvature factor of stiffness ............ (N/%/kN**2) . B3<br />
Change of stiffness with load at load = 0 (N/%/kN) ..... B4<br />
Change of progressivity of stiffness/load (1/kN) ....... B5<br />
Curvature change with load ............................. B6<br />
Curvature change with load ............................. B7<br />
Curvature at load = 0 .................................. B8<br />
Load influence on horizontal shift ....... (%/kN) ...... B9<br />
Horizontal shift at load = 0 ............. (%) ......... B10<br />
Load influence on vertical shift ......... (N/kN) ...... B11<br />
Vertical shift at load = 0 ............... (N) ......... B12<br />
<br />
Shape factor ........................................... C0<br />
Load influence of peak value ............ (Nm/kN**2) ... C1<br />
Load influence of peak value ............ (Nm/kN) ...... C2<br />
Curvature factor of stiffness ........... (Nm/deg/kN**2) C3<br />
Change of stiffness with load at load = 0 (Nm/deg/kN) .. C4<br />
Change of progressivity of stiffness/load (1/kN) ....... C5<br />
Camber influence on stiffness ........... (%/deg/100) .. C6<br />
Curvature change with load ............................. C7<br />
Curvature change with load ............................. C8<br />
Curvature at load = 0 .................................. C9<br />
Camber influence of stiffness .......................... C10<br />
Camber influence on horizontal shift......(deg/deg)..... C11<br />
Load influence on horizontal shift........(deg/kN)...... C12<br />
Horizontal shift at load = 0..............(deg)......... C13<br />
Camber influence on vertical shift........(Nm/deg/kN**2) C14<br />
Camber influence on vertical shift........(Nm/deg/kN)... C15<br />
Load influence on vertical shift..........(Nm/kN)....... C16<br />
Vertical shift at load = 0................(Nm).......... C17<br />
</pre><br />
More information can be found at http://members.xoom.virgilio.it/adiaforo/epcjk.htm or if it's down try http://web.archive.org/web/20050913052226/http://members.xoom.virgilio.it/adiaforo/epcjk.htm<br />
<br />
==Brakes==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
friction = 0.73<br />
max-pressure = 4.0e6<br />
bias = 0.60<br />
radius = 0.14<br />
area = 0.015<br />
</pre><br />
The bias parameter is the fraction of braking pressure applied to the front brakes (in the front brake section) or the rear brakes (in the rear brake section). To make sense, the rear value should equal 1.0 minus the front value. The maximum brake torque is calculated as friction * area * bias * max-pressure * radius. Some fraction of this value is applied based on the brake pedal.<br />
<br />
==Driver==<br />
<pre><br />
position = -0.62, -0.35, -0.12<br />
mass = 90.0<br />
view-position = -0.64, 0.35, 0.30<br />
hood-mounted-view-position = 0.55, 0, 0.17<br />
view-stiffness = 0.0<br />
</pre><br />
The position and mass affect the weight distribution of the car. The view positions define 3D coordinates for camera placement. The view-stiffness parameter defines the stiffness of the camera bounce effect, where 0.0 is a sports car and 1.0 is F1-ish.<br />
<br />
==Drag==<br />
<pre><br />
position = 0.0, 0.0, 0.2<br />
frontal-area = 2<br />
drag-coefficient = 0.3<br />
</pre><br />
The frontal area and coefficient of drag, set with frontal-area and drag-coefficient, are used to calculate the drag force.<br />
<br />
==Wing==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
position = 1.9, 0.0, 0.60<br />
frontal-area = 0.2<br />
drag-coefficient = 0.0<br />
surface-area = 0.3<br />
lift-coefficient = -0.5<br />
efficiency = 0.95<br />
</pre><br />
Downforce can be added with wings. The amount of downforce is determined by the value in the lift-coefficient tag. If the lift coefficient is positive, upforce is generated. This is usually undesirable for cars. The efficiency determines how much drag is added as downforce increases. The surface-area is the surface area of the wing. This value is also used in the drag calculation.<br />
<br />
==Wheel==<br />
Per-wheel parameters are broken into four fields. In the example below the front left wheel is shown.<br />
<pre><br />
position = 1.14, 0.76, -0.47<br />
roll-height = 0.29<br />
mass = 18.14<br />
restitution = 0.1<br />
</pre><br />
<br />
==Contact-points==<br />
<pre><br />
mass = 0.05<br />
position-00 = 1.96, 0.37, -0.24<br />
position-01 = 1.96, -0.37, -0.24<br />
position-02 = 1.52, 0.83, 0.16<br />
position-03 = 1.52, -0.83, 0.16<br />
position-04 = -0.10, 0.89, -0.24<br />
position-05 = -0.10, -0.89, -0.24<br />
position-06 = -2.18, -0.83, -0.10<br />
position-07 = -2.18, 0.83, -0.10<br />
</pre><br />
These values are used for weight distribution and balance only. They no longer perform any contact-related function. So, contact-points are the same as particles (defined below), but the syntax is slightly different.<br />
<br />
==Particle==<br />
These parameters are broken into a series of values starting at 00 and going to some number less than 100. The particle-00 is shown below.<br />
<pre><br />
mass = 30.0<br />
position = -1.28, 0.0, -0.36<br />
</pre><br />
These values are used for weight distribution and balance.<br />
<br />
[[Category:Cars]]<br />
[[Category:Files]]<br />
[[Category:Historical]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_parameters_for_vdrift-2010-06-30&diff=1272Car parameters for vdrift-2010-06-302012-09-01T11:00:46Z<p>Timo 6: Update categories</p>
<hr />
<div>* [[Car parameters for vdrift-2009-06-15 and older]]<br />
<br />
The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
For unit conversion you can go to: [http://www.sonar-equipment.com/useful_conversion_factors_table1_p00.htm ''This Site''].<br />
<br />
The .car file contains several sections. Each section will now be described, along with example values from the XS.car file. The XS has performance comparable to the Honda S2000.<br />
<br />
==Coordinate system==<br />
A vector of 3 floats ( 1.0, 3.0, 1.5 ) will be interpreted as distances from the car body model origin. See [[Coordinate systems]] for a detailed description.<br />
<br />
==Top level parameters==<br />
<pre><br />
drive = RWD<br />
</pre><br />
The "drive" parameter accepts values "RWD", "FWD", "AWD" that correspond to rear wheel drive, front wheel drive, and all wheel drive, respectively.<br />
<br />
<pre><br />
version = 2<br />
</pre><br />
The file format version. The only change between version 1 and version 2 is the move to coordinate system version 2, which is described in [[Coordinate systems]]. If no version is specified version 1 is assumed. VDrift is backward compatible with previous file formats. VDrift is not forward compatible with new file formats -- that is, VDrift will refuse to load a file specifying format version 3 if VDrift's code only supports version 2.<br />
<br />
==Engine==<br />
<pre><br />
[engine]<br />
position = 0.86, 0.0, -0.21<br />
mass = 140.0<br />
max-power = 1.79e5<br />
peak-engine-rpm = 7800.0<br />
rpm-limit = 9000.0<br />
inertia = 0.25<br />
idle = 0.02<br />
start-rpm = 1000<br />
stall-rpm = 350<br />
fuel-consumption = 1e-9<br />
torque-friction = 0.0003<br />
torque-curve-00 = 1000, 140.0<br />
torque-curve-01 = 2000, 149.14<br />
torque-curve-02 = 2200, 145.07<br />
torque-curve-03 = 2500, 147.78<br />
torque-curve-04 = 3000, 169.50<br />
torque-curve-05 = 3300, 172.19<br />
torque-curve-06 = 4000, 169.50<br />
torque-curve-07 = 4500, 166.77<br />
torque-curve-08 = 5600, 172.19<br />
torque-curve-09 = 5800, 170.83<br />
torque-curve-10 = 6000, 168.12<br />
torque-curve-11 = 6100, 177.61<br />
torque-curve-12 = 6200, 186.42<br />
torque-curve-13 = 6300, 192.53<br />
torque-curve-14 = 6500, 195.92<br />
torque-curve-15 = 6700, 195.92<br />
torque-curve-16 = 7000, 195.24<br />
torque-curve-17 = 7600, 190.49<br />
torque-curve-18 = 8000, 184.39<br />
torque-curve-19 = 8200, 183.04<br />
torque-curve-20 = 8300, 146.43<br />
torque-curve-21 = 9500, 146.43<br />
</pre><br />
The position and mass parameters affect the weight distribution of the car. The torque curve is calculated from max-power and peak-engine-rpm using a polynomial expression given in Motor Vehicle Dynamics, Genta (1997), where peak-engine-rpm is the engine speed at which the maximum power output (max-power) is achieved. Alternatively, the torque curve can be explicitly defined, as in the example above. A rev limit can be set with rpm-limit. The rotational inertia of the moving parts is inertia. idle is the throttle position at idle. Starting the engine initially sets the engine speed to start-rpm. Letting the engine speed drop below stall-rpm makes the engine stall. The rate of fuel consumption is set with fuel-consumption. The actual fuel consumed each second (in units of liters) is the fuel-consumption parameter times RPM times throttle (throttle is from 0.0 to 1.0, where 1.0 is full throttle).<br />
<br />
==Clutch==<br />
<pre><br />
[clutch]<br />
sliding = 0.27<br />
radius = 0.15<br />
area = 0.75<br />
max-pressure = 11079.26<br />
</pre><br />
The clutch is described by its sliding friction coefficient, radius, area and maximum applied pressure. The torque capacity(maximum transmitted torque) of the clutch is TC = sliding * radius * area * max-pressure. It should be somewhere between one and two times the maximum enine torque. TC = 1.25 * max-engine-torque is a good start value.<br />
<br />
==Transmission==<br />
<pre><br />
[transmission]<br />
gears = 6<br />
gear-ratio-r = -2.8<br />
gear-ratio-1 = 3.133<br />
gear-ratio-2 = 2.045<br />
gear-ratio-3 = 1.481<br />
gear-ratio-4 = 1.161<br />
gear-ratio-5 = 0.943<br />
gear-ratio-6 = 0.763<br />
shift-time = 0.2<br />
</pre><br />
The number of forward gears is set with the gears parameter. The gear ration for reverse and all of the forward gears is then defined. The shift-time tag tells how long it takes, in total seconds, to change gears (when autoclutch is enabled). Half the time is spent changing the gear and the other half is spent letting the clutch out. This parameter is not required and defaults to 0.2 seconds, which is a reasonable value for a manual transmission. F1 cars take about 50 ms, by comparison.<br />
<br />
==Differential==<br />
<pre><br />
[differential]<br />
final-drive = 4.100<br />
anti-slip = 600.0<br />
anti-slip-torque = 1<br />
anti-slip-torque-deceleration-factor = 0<br />
</pre><br />
The final drive provides an additional gear reduction. The anti-slip parameter defines the maximum anti-slip torque. For speed-sensitive differentials, it also defines the anti-slip torque per radian per second of speed difference between the wheels. If the differential is speed-sensitive, the anti-slip-torque and anti-slip-torque-deceleration-factor parameters must be omitted or set to zero. If the differential is torque-sensitive, then anti-slip-torque defines the amount of anti-slip torque per input torque. The anti-slip-torque-deceleration-factor defines the amount of anti-slip torque per negative input torque. For a 1-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to zero, for a 2-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to 1.0, for 1.5-way, set it between 0.0 and 1.0.<br />
<br />
==Fuel tank==<br />
<pre><br />
[fuel-tank]<br />
position = 0.0, -1.0, -0.26<br />
capacity = 0.0492<br />
volume = 0.0492<br />
fuel-density = 730.0<br />
</pre><br />
The fuel tank's position, the current volume of fuel and the density of the fuel affect the car's weight distribution. The capacity tag sets the maximum volume of fuel that the tank can hold. The initial volume is set with the volume tag. The density of the fuel is set with fuel-density.<br />
<br />
==Driver==<br />
<pre><br />
[driver]<br />
position = -0.35, -0.57, 0.0<br />
view-position = -0.35, -0.64, 0.30<br />
hood-mounted-view-position = 0, 0.55, 0.17<br />
view-stiffness = 0.0<br />
</pre><br />
The position determines driver model position. The view positions define 3D coordinates for camera placement. The view-stiffness parameter defines the stiffness of the camera bounce effect, where 0.0 is a sports car and 1.0 is F1-ish.<br />
<br />
==View==<br />
<pre><br />
[view]<br />
name-1 = wheel-front-right # observe wheel and chassis moves<br />
position-1 = 3.0, 1.0, 0.75 # X(+right), Y(+front), Z(+up)<br />
angle-1 = 20.0, 90.0 # +down/-up, +left/-right<br />
</pre><br />
Up to 9 additional views are supported(1-9). Position, angle determine camera position, orientation relative to car body.<br />
<br />
==Aerodevice==<br />
<pre><br />
[aerodevice-2]<br />
position = 0.0, -2.14, 0.37<br />
frontal-area = 0.05<br />
drag-coefficient = 0.0<br />
surface-area = 0.5<br />
lift-coefficient = -0.7<br />
efficiency = 0.95<br />
</pre><br />
An aerodevice describes the aerodynamics(car body, front/rear wing) of the car. Up to ten devices are supported. Most cars will use up to three. The frontal area and coefficient of drag, set with frontal-area and drag-coefficient, are used to calculate the drag force.<br />
<br />
Downforce can be added with the optional parameters surface-area, lift-coefficient, efficiency. If the lift coefficient is positive, upforce is generated. This is usually undesirable for cars. The efficiency determines how much drag is added as downforce increases. The surface-area is the surface area of the wing. This value is also used in the drag calculation.<br />
<br />
==Coilover==<br />
<pre><br />
[coilover-front]<br />
spring-constant = 49131.9<br />
spring-factor-1 = 0.052, 1.0<br />
spring-factor-2 = 0.055, 1.2<br />
bounce = 2600<br />
rebound = 7900<br />
damper-factor-1 = 0.08,1.0<br />
damper-factor-2 = 0.1, 0.7<br />
travel = 0.19<br />
anti-roll = 800.0<br />
</pre><br />
The spring-constant is the '''wheel rate''' in N/m. The spring-factor-1 and 2 parameters define a curve for the spring response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is the suspension displacement in meters and y is the factor to be applied to the spring coefficient. In this example, the spring factor will be 1.0 when the displacement is between 0 and 0.052 m, and then the spring factor will change linearly to 1.2 at 0.055 m (and beyond). The spring factor gets multiplied by the spring-constant. You can put as many spring-factor points as you want (just increase the spring-factor- number for each additional point). Note that displacement values are relative to the "zero g", "zero force" position. For best results, start VDrift with the -debug option and observe suspension displacements during maneuvering to determine where you want to put your points.<br />
<br />
The bounce and rebound parameters are the damping coefficients for compression and expansion of the suspension, respectively, in units of N/m/s. The damper-factor-1 and 2 parameters define a curve for the damper response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is an absolute value of suspension velocity in m/s and y is the factor to be applied to the damping coefficient. In this example, the damper factor will be 1.0 when the compression velocity absolute value is between 0 and 0.08 m/s, and then the damper factor will change linearly to 0.7 at 0.1 m/s (and beyond). The damper factor gets applied to the bonce or rebound damper coefficient, depending on the direction of travel. You can put as many damper-factor points as you want (just increase the damper-factor- number for each additional point).<br />
<br />
==Tire==<br />
<pre><br />
[tire-front]<br />
size = 215/45r17<br />
type = touring<br />
texture = touring<br />
</pre><br />
Size determines tire dimensions, weight, inertia of the tire. Tire textures are stored in '''carparts/tire/textures'''. Tire types are stored in '''carparts/tire'''. More info about tire type definition can be found here: [[Tire_parameters]]<br />
<br />
==Brake==<br />
<pre><br />
[brake-front]<br />
friction = 0.4<br />
max-pressure = 4.0e6<br />
bias = 0.65<br />
radius = 0.14<br />
area = 0.015<br />
rotor = rotor_shiny_slotted_drilled<br />
</pre><br />
The bias parameter is the fraction of braking pressure applied to the front brakes (in the front brake section) or the rear brakes (in the rear brake section). To make sense, the rear value should equal 1.0 minus the front value. The maximum brake torque is calculated as friction * area * bias * max-pressure * radius. Some fraction of this value is applied based on the brake pedal. Brake rotor is the optional brake rotor texture. If set a brake rotor model is generated. Rotor textures are stored in '''carparts/brake/textures'''.<br />
<br />
==Wheel==<br />
<pre><br />
[wheel-0]<br />
orientation = left<br />
tire = tire-front<br />
brake = brake-front<br />
model = oem_wheel<br />
</pre><br />
The number of wheels is fixed to four(0-3). For a FWD car the wheels 0 and 1 are powered, for RWD the wheels 2, 3. The orientation determines the wheel facing direction. The referenced tire has to be defined in the same car file. The same goes for the brake. The wheel model has to reside in the car folder or '''carparts/wheel'''. <br />
<br />
==Suspension==<br />
<pre><br />
[suspension-0]<br />
coilover = coilover-front<br />
wheel-hub = -0.736, 1.14, -0.47 #track front/rear 1471/1509<br />
position = -0.73, 1.14, -0.03<br />
hinge = 0,0,0<br />
camber = -1.33<br />
caster = 6.12<br />
toe = 0.0<br />
ackermann = 0<br />
steering = 33.19<br />
</pre><br />
Suspension has to be defined per wheel.<br />
The referenced coilover has to be defined in the same car file.<br />
Wheel hub is the wheel position for a fully extended suspension.<br />
The position parameter is not used atm.<br />
The hinge is the center of the wheel's path as the suspension moves. The location of the hinge is determined by suspension geometry, and may be outside of the car itself.<br />
<br />
Wheel alignment is set with the camber, caster, and toe. All angles are in degrees. For a "negative camber" the left wheel camber has to be negative, the right wheel camber positive.<br />
<br />
Ackermann and steering are optional.<br />
Ackermann is the steering arm angle relative to wheel. Ideal ackermann(100%) is atan(0.5* track / wheelbase). For the right wheel positive ackermann is positive, for the left negative.<br />
Steering is the maximum steering angle of the wheel(for ackermann = 0). A negative steering leads to a reverted steering.<br />
<br />
==Particle==<br />
<pre><br />
[particle-00]<br />
mass = 30.0<br />
position = 0.0, -1.28, -0.36<br />
</pre><br />
These values are used for weight distribution and rotational inertia. Up to 100 particles are supported. Most cars will use 6-10.<br />
<br />
[[Category:Cars]]<br />
[[Category:Files]]<br />
[[Category:Historical]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_parameters_for_vdrift-2009-06-15_and_older&diff=1271Car parameters for vdrift-2009-06-15 and older2012-09-01T10:59:55Z<p>Timo 6: Update categories</p>
<hr />
<div>The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
For unit conversion you can go to: [http://www.sonar-equipment.com/useful_conversion_factors_table1_p00.htm ''This Site''].<br />
<br />
The .car file contains several sections. Each section will now be described, along with example values from the XS.car file. The XS has performance comparable to the Honda S2000.<br />
<br />
==Coordinate system==<br />
A vector of 3 floats ( 1.0, 3.0, 1.5 ) will be interpreted as distances from the car body model origin. See [[Coordinate systems]] for a detailed description.<br />
<br />
==Top level parameters==<br />
<pre><br />
drive = RWD<br />
</pre><br />
The "drive" parameter accepts values "RWD", "FWD", "AWD" that correspond to rear wheel drive, front wheel drive, and all wheel drive, respectively.<br />
<br />
<pre><br />
version = 2<br />
</pre><br />
The file format version. The only change between version 1 and version 2 is the move to coordinate system version 2, which is described in [[Coordinate systems]]. If no version is specified version 1 is assumed. VDrift is backward compatible with previous file formats. VDrift is not forward compatible with new file formats -- that is, VDrift will refuse to load a file specifying format version 3 if VDrift's code only supports version 2.<br />
<br />
==Steering==<br />
<pre><br />
max-angle = 33.19<br />
</pre><br />
This defines the maximum angle that the wheels will turn in each direction. For the XS, when the steering wheel is full left, the wheels would be at -33.19 degrees.<br />
<br />
==Engine==<br />
<pre><br />
position = 0.86, 0.0, -0.21<br />
mass = 140.0<br />
max-power = 1.79e5<br />
peak-engine-rpm = 7800.0<br />
rpm-limit = 9000.0<br />
inertia = 0.25<br />
idle = 0.02<br />
start-rpm = 1000<br />
stall-rpm = 350<br />
fuel-consumption = 1e-9<br />
torque-friction = 0.0003<br />
torque-curve-00 = 1000, 140.0<br />
torque-curve-01 = 2000, 149.14<br />
torque-curve-02 = 2200, 145.07<br />
torque-curve-03 = 2500, 147.78<br />
torque-curve-04 = 3000, 169.50<br />
torque-curve-05 = 3300, 172.19<br />
torque-curve-06 = 4000, 169.50<br />
torque-curve-07 = 4500, 166.77<br />
torque-curve-08 = 5600, 172.19<br />
torque-curve-09 = 5800, 170.83<br />
torque-curve-10 = 6000, 168.12<br />
torque-curve-11 = 6100, 177.61<br />
torque-curve-12 = 6200, 186.42<br />
torque-curve-13 = 6300, 192.53<br />
torque-curve-14 = 6500, 195.92<br />
torque-curve-15 = 6700, 195.92<br />
torque-curve-16 = 7000, 195.24<br />
torque-curve-17 = 7600, 190.49<br />
torque-curve-18 = 8000, 184.39<br />
torque-curve-19 = 8200, 183.04<br />
torque-curve-20 = 8300, 146.43<br />
torque-curve-21 = 9500, 146.43<br />
</pre><br />
The position and mass parameters affect the weight distribution of the car. The torque curve is calculated from max-power and peak-engine-rpm using a polynomial expression given in Motor Vehicle Dynamics, Genta (1997), where peak-engine-rpm is the engine speed at which the maximum power output (max-power) is achieved. Alternatively, the torque curve can be explicitly defined, as in the example above. A rev limit can be set with rpm-limit. The rotational inertia of the moving parts is inertia. idle is the throttle position at idle. Starting the engine initially sets the engine speed to start-rpm. Letting the engine speed drop below stall-rpm makes the engine stall. The rate of fuel consumption is set with fuel-consumption. The actual fuel consumed each second (in units of liters) is the fuel-consumption parameter times RPM times throttle (throttle is from 0.0 to 1.0, where 1.0 is full throttle).<br />
<br />
==Clutch==<br />
<pre><br />
sliding = 0.27<br />
radius = 0.15<br />
area = 0.75<br />
max-pressure = 11079.26<br />
</pre><br />
The clutch is described by its sliding friction coefficient, radius, area and maximum applied pressure. The torque capacity(maximum transmitted torque) of the clutch is TC = sliding * radius * area * max-pressure. It should be somewhere between one and two times the maximum enine torque. TC = 1.25 * max-engine-torque is a good start value.<br />
<br />
==Transmission==<br />
<pre><br />
gears = 6<br />
gear-ratio-r = -2.8<br />
gear-ratio-1 = 3.133<br />
gear-ratio-2 = 2.045<br />
gear-ratio-3 = 1.481<br />
gear-ratio-4 = 1.161<br />
gear-ratio-5 = 0.943<br />
gear-ratio-6 = 0.763<br />
shift-time = 0.2<br />
</pre><br />
The number of forward gears is set with the gears parameter. The gear ration for reverse and all of the forward gears is then defined. The shift-time tag tells how long it takes, in total seconds, to change gears (when autoclutch is enabled). Half the time is spent changing the gear and the other half is spent letting the clutch out. This parameter is not required and defaults to 0.2 seconds, which is a reasonable value for a manual transmission. F1 cars take about 50 ms, by comparison.<br />
<br />
==Differential==<br />
<pre><br />
final-drive = 4.100<br />
anti-slip = 600.0<br />
anti-slip-torque = 1<br />
anti-slip-torque-deceleration-factor = 0<br />
</pre><br />
The final drive provides an additional gear reduction. The anti-slip parameter defines the maximum anti-slip torque. For speed-sensitive differentials, it also defines the anti-slip torque per radian per second of speed difference between the wheels. If the differential is speed-sensitive, the anti-slip-torque and anti-slip-torque-deceleration-factor parameters must be omitted or set to zero. If the differential is torque-sensitive, then anti-slip-torque defines the amount of anti-slip torque per input torque. The anti-slip-torque-deceleration-factor defines the amount of anti-slip torque per negative input torque. For a 1-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to zero, for a 2-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to 1.0, for 1.5-way, set it between 0.0 and 1.0.<br />
<br />
==Fuel tank==<br />
<pre><br />
position = -0.8, -0.1, -0.26<br />
capacity = 0.0492<br />
volume = 0.0492<br />
fuel-density = 730.0<br />
</pre><br />
The fuel tank's position, the current volume of fuel and the density of the fuel affect the car's weight distribution. The capacity tag sets the maximum volume of fuel that the tank can hold. The initial volume is set with the volume tag. The density of the fuel is set with fuel-density.<br />
<br />
==Suspension==<br />
Front/rear parameters are broken into two fields. Per-wheel parameters are broken into four fields. In the example below the front suspension is shown, followed by the front left wheel suspension parameters.<br />
<pre><br />
[ suspension-front ]<br />
spring-constant = 49131.9<br />
spring-factor-1 = 0.052, 1.0<br />
spring-factor-2 = 0.055, 1.2<br />
bounce = 2588<br />
rebound = 2612<br />
damper-factor-1 = 0.08,1.0<br />
damper-factor-2 = 0.1, 0.7<br />
travel = 0.19<br />
camber = -1.33<br />
caster = 6.12<br />
toe = 0.0<br />
anti-roll = 8000.0<br />
</pre><br />
<pre><br />
[ suspension-FL ]<br />
hinge = 0,0,0<br />
</pre><br />
The spring-constant is the '''wheel rate''' in N/m. The spring-factor-1 and 2 parameters define a curve for the spring response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is the suspension displacement in meters and y is the factor to be applied to the spring coefficient. In this example, the spring factor will be 1.0 when the displacement is between 0 and 0.052 m, and then the spring factor will change linearly to 1.2 at 0.055 m (and beyond). The spring factor gets multiplied by the spring-constant. You can put as many spring-factor points as you want (just increase the spring-factor- number for each additional point). Note that displacement values are relative to the "zero g", "zero force" position. For best results, start VDrift with the -debug option and observe suspension displacements during maneuvering to determine where you want to put your points.<br />
<br />
The bounce and rebound parameters are the damping coefficients for compression and expansion of the suspension, respectively, in units of N/m/s. The damper-factor-1 and 2 parameters define a curve for the damper response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is an absolute value of suspension velocity in m/s and y is the factor to be applied to the damping coefficient. In this example, the damper factor will be 1.0 when the compression velocity absolute value is between 0 and 0.08 m/s, and then the damper factor will change linearly to 0.7 at 0.1 m/s (and beyond). The damper factor gets applied to the bonce or rebound damper coefficient, depending on the direction of travel. You can put as many damper-factor points as you want (just increase the damper-factor- number for each additional point).<br />
<br />
The hinge is the center of the wheel's path as the suspension moves. The location of the hinge is determined by suspension geometry, and may be outside of the car itself.<br />
<br />
Wheel alignment is set with the camber, caster, and toe tags. All angles are in degrees.<br />
<br />
Note that the suspension position parameter and the max-compression-velocity parameters are no longer used and can be omitted.<br />
<br />
==Tire==<br />
Front/rear parameters are broken into two fields. In the example below the front tire section is shown.<br />
<pre><br />
radius = 0.29<br />
rolling-resistance = 1.3e-2, 6.5e-6<br />
rotational-inertia = 10.0<br />
tread = 0.0<br />
# Lateral force<br />
a0=1.6<br />
a1=-38<br />
a2=1201<br />
a3=1914<br />
a4=8.7<br />
a5=0.014<br />
a6=-0.24<br />
a7=1.0<br />
a8=-0.03<br />
a9=-0.0013<br />
a10=-0.15<br />
a111=-8.5<br />
a112=-0.29<br />
a12=17.8<br />
a13=-2.4<br />
# Longitudinal force<br />
b0=1.7<br />
b1=-80<br />
b2=1571<br />
b3=23.3<br />
b4=300<br />
b5=0<br />
b6=0.0068<br />
b7=0.055<br />
b8=-0.024<br />
b9=0.014<br />
b10=0.26<br />
b11=-86<br />
b12=350<br />
# Aligning moment<br />
c0=2.3<br />
c1=-3.8<br />
c2=-3.14<br />
c3=-1.16<br />
c4=-7.2<br />
c5=0.0<br />
c6=0.0<br />
c7=0.044<br />
c8=-0.58<br />
c9=0.18<br />
c10=0.043<br />
c11=0.048<br />
c12=-0.0035<br />
c13=-0.18<br />
c14=0.14<br />
c15=-1.029<br />
c16=0.27<br />
c17=-1.1<br />
</pre><br />
The two elements of rolling-resistance are the constant and velocity-squared terms, respectively. Radius defines the radius of the tire. The tread parameter ranges over arbitrary values of 0.0 to 1.0, where 0.0 is a road tire and 1.0 is an off-road tire. The longitudinal, transverse, and aligning section each contain a vector of “magic formula” coefficients as presented in Motor Vehicle Dynamics, Genta (1997). A description is shown below:<br />
<pre><br />
Shape factor ........................................... A0<br />
Load infl. on lat. friction coeff (*1000)... (1/kN) .... A1<br />
Lateral friction coefficient at load = 0 (*1000) ....... A2<br />
Maximum stiffness ........................ (N/deg) ..... A3<br />
Load at maximum stiffness ................ (kN) ........ A4<br />
Camber infiuence on stiffness ............ (%/deg/100) . A5<br />
Curvature change with load ............................. A6<br />
Curvature at load = 0 .................................. A7<br />
Horizontal shift because of camber ........(deg/deg).... A8<br />
Load influence on horizontal shift ........(deg/kN)..... A9<br />
Horizontal shift at load = 0 ..............(deg)........ A10<br />
Camber influence on vertical shift ........(N/deg/kN)... A111<br />
Camber influence on vertical shift ........(N/deg/kN**2) A112<br />
Load influence on vertical shift ..........(N/kN)....... A12<br />
Vertical shift at load = 0 ................(N).......... A13<br />
<br />
Shape factor ........................................... B0<br />
Load infl. on long. friction coeff (*1000)... (1/kN) ... B1<br />
Longitudinal friction coefficient at load = 0 (*1000)... B2<br />
Curvature factor of stiffness ............ (N/%/kN**2) . B3<br />
Change of stiffness with load at load = 0 (N/%/kN) ..... B4<br />
Change of progressivity of stiffness/load (1/kN) ....... B5<br />
Curvature change with load ............................. B6<br />
Curvature change with load ............................. B7<br />
Curvature at load = 0 .................................. B8<br />
Load influence on horizontal shift ....... (%/kN) ...... B9<br />
Horizontal shift at load = 0 ............. (%) ......... B10<br />
Load influence on vertical shift ......... (N/kN) ...... B11<br />
Vertical shift at load = 0 ............... (N) ......... B12<br />
<br />
Shape factor ........................................... C0<br />
Load influence of peak value ............ (Nm/kN**2) ... C1<br />
Load influence of peak value ............ (Nm/kN) ...... C2<br />
Curvature factor of stiffness ........... (Nm/deg/kN**2) C3<br />
Change of stiffness with load at load = 0 (Nm/deg/kN) .. C4<br />
Change of progressivity of stiffness/load (1/kN) ....... C5<br />
Camber influence on stiffness ........... (%/deg/100) .. C6<br />
Curvature change with load ............................. C7<br />
Curvature change with load ............................. C8<br />
Curvature at load = 0 .................................. C9<br />
Camber influence of stiffness .......................... C10<br />
Camber influence on horizontal shift......(deg/deg)..... C11<br />
Load influence on horizontal shift........(deg/kN)...... C12<br />
Horizontal shift at load = 0..............(deg)......... C13<br />
Camber influence on vertical shift........(Nm/deg/kN**2) C14<br />
Camber influence on vertical shift........(Nm/deg/kN)... C15<br />
Load influence on vertical shift..........(Nm/kN)....... C16<br />
Vertical shift at load = 0................(Nm).......... C17<br />
</pre><br />
More information can be found at http://members.xoom.virgilio.it/adiaforo/epcjk.htm or if it's down try http://web.archive.org/web/20050913052226/http://members.xoom.virgilio.it/adiaforo/epcjk.htm<br />
<br />
==Brakes==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
friction = 0.73<br />
max-pressure = 4.0e6<br />
bias = 0.60<br />
radius = 0.14<br />
area = 0.015<br />
</pre><br />
The bias parameter is the fraction of braking pressure applied to the front brakes (in the front brake section) or the rear brakes (in the rear brake section). To make sense, the rear value should equal 1.0 minus the front value. The maximum brake torque is calculated as friction * area * bias * max-pressure * radius. Some fraction of this value is applied based on the brake pedal.<br />
<br />
==Driver==<br />
<pre><br />
position = -0.62, -0.35, -0.12<br />
mass = 90.0<br />
view-position = -0.64, 0.35, 0.30<br />
hood-mounted-view-position = 0.55, 0, 0.17<br />
view-stiffness = 0.0<br />
</pre><br />
The position and mass affect the weight distribution of the car. The view positions define 3D coordinates for camera placement. The view-stiffness parameter defines the stiffness of the camera bounce effect, where 0.0 is a sports car and 1.0 is F1-ish.<br />
<br />
==Drag==<br />
<pre><br />
position = 0.0, 0.0, 0.2<br />
frontal-area = 2<br />
drag-coefficient = 0.3<br />
</pre><br />
The frontal area and coefficient of drag, set with frontal-area and drag-coefficient, are used to calculate the drag force.<br />
<br />
==Wing==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
position = 1.9, 0.0, 0.60<br />
frontal-area = 0.2<br />
drag-coefficient = 0.0<br />
surface-area = 0.3<br />
lift-coefficient = -0.5<br />
efficiency = 0.95<br />
</pre><br />
Downforce can be added with wings. The amount of downforce is determined by the value in the lift-coefficient tag. If the lift coefficient is positive, upforce is generated. This is usually undesirable for cars. The efficiency determines how much drag is added as downforce increases. The surface-area is the surface area of the wing. This value is also used in the drag calculation.<br />
<br />
==Wheel==<br />
Per-wheel parameters are broken into four fields. In the example below the front left wheel is shown.<br />
<pre><br />
position = 1.14, 0.76, -0.47<br />
roll-height = 0.29<br />
mass = 18.14<br />
restitution = 0.1<br />
</pre><br />
<br />
==Contact-points==<br />
<pre><br />
mass = 0.05<br />
position-00 = 1.96, 0.37, -0.24<br />
position-01 = 1.96, -0.37, -0.24<br />
position-02 = 1.52, 0.83, 0.16<br />
position-03 = 1.52, -0.83, 0.16<br />
position-04 = -0.10, 0.89, -0.24<br />
position-05 = -0.10, -0.89, -0.24<br />
position-06 = -2.18, -0.83, -0.10<br />
position-07 = -2.18, 0.83, -0.10<br />
</pre><br />
These values are used for weight distribution and balance only. They no longer perform any contact-related function. So, contact-points are the same as particles (defined below), but the syntax is slightly different.<br />
<br />
==Particle==<br />
These parameters are broken into a series of values starting at 00 and going to some number less than 100. The particle-00 is shown below.<br />
<pre><br />
mass = 30.0<br />
position = -1.28, 0.0, -0.36<br />
</pre><br />
These values are used for weight distribution and balance.<br />
<br />
[[Category:Cars]]<br />
[[Category:Historical]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Old_Numerical_Integration&diff=1270Old Numerical Integration2012-09-01T10:59:01Z<p>Timo 6: Update categories</p>
<hr />
<div>Numerical integration constitutes a broad family of algorithms for calculating the numerical value of a definite integral. This the backbone of physics simulations because it allows calculation of velocity and position from forces (and therefore acceleration) applied to a rigid body.<br />
<br />
==Criteria==<br />
In realtime simulations, the most important integrator criteria are performance, stability, and accuracy. Performance refers to how long it takes to perform the integration for a given timestep. Stability refers to how well the integrator copes with stiff constraints such as high spring constants before errors becomes unacceptably large. Accuracy refers to how well the integrator matches the expected result, and includes whether or not the integrator damps out (loses energy) over time.<br />
<br />
==Euler Integration==<br />
The Euler method is a first order numerical procedure for solving ordinary differential equations (ODEs) with a given initial value. It is the most basic kind of explicit method for numerical integration for ordinary differential equations. The performance is excellent, but both stability and accuracy are poor. Because it is so simple, it unfortunately gets used very often. Vamos uses Euler integration.<br />
a = acceleration(state, t+dt)<br />
x += v*dt<br />
v += a*dt<br />
<br />
==Newton-Stormer-Verlet (NSV) / Symplectic Euler / Euler–Cromer algorithm==<br />
The Euler–Cromer algorithm or symplectic Euler method or Newton-Stormer-Verlet (NSV) method is a modification of the Euler method for solving Hamilton's equations, a system of ordinary differential equations that arises in classical mechanics. It is a symplectic integrator, which is a class of geometric integrators that is especially good at simulations of dynamics and hence it yields much better results than the standard Euler method. The performance is excellent, and stability is fair, and accuracy is excellent. Unbelievably, the algorithm is very simple and almost identical to the Euler method.<br />
a = acceleration(state, t+dt)<br />
v += a*dt<br />
x += v*dt<br />
<br />
==Velocity Verlet==<br />
Verlet integration is a numerical integration method originally designed for calculating the trajectories of particles in molecular dynamics simulations. The velocity verlet variant directly calculates velocity. The performance is fair, and both stability and accuracy are excellent.<br />
<br />
Unfortunately, calculating the velocity depends on knowing the acceleration for the current iteration, which poses a problem when the acceleration depends on the velocity (such as with a damper). Using the velocity from the last iteration to calculate the acceleration gets around this but may have implications on the accuracy of the method.<br />
if (not oldaccel)<br />
oldaccel = acceleration(state, t+dt)<br />
<br />
x += v*dt + 0.5*oldaccel*dt*dt<br />
a = acceleration(state, t+dt)<br />
v += 0.5*(a + oldaccel)*dt<br />
<br />
oldaccel = a<br />
<br />
==Runge Kutta 4==<br />
The Runge–Kutta methods are an important family of implicit and explicit iterative methods for the approximation of solutions of ordinary differential equations. The Runge Kutta 4 (or RK4) is a well-known 4th-order explicit Runge Kutta algorithm. The code snippet shown below is high level, and the actual implementation is a bit more complicated. Performance is poor, since the acceleration must be evaluated for all objects 4 times per iteration, stability is excellent, and accuracy is fair.<br />
Derivative a = evaluate(state, t)<br />
Derivative b = evaluate(state, t, dt*0.5f, a)<br />
Derivative c = evaluate(state, t, dt*0.5f, b)<br />
Derivative d = evaluate(state, t, dt, c)<br />
<br />
const float dxdt = 1.0f/6.0f * (a.dx + 2.0f*(b.dx + c.dx) + d.dx)<br />
const float dvdt = 1.0f/6.0f * (a.dv + 2.0f*(b.dv + c.dv) + d.dv)<br />
<br />
state.x = state.x + dxdt*dt<br />
state.v = state.v + dvdt*dt<br />
<br />
==Detailed Comparison: oscillating spring-mass==<br />
For comparing these algorithms I used a simple spring-mass oscillator, because it can be difficult to integrate when the spring is very stiff, but it can be analytically solved easily so I have something to compare the integrators to. In addition, its force calculation depends only on position, which allows the Velocity Verlet algorithm to work as it is commonly used. For this simulation the instantaneous acceleration input into all integrators is calculated as:<br />
a = -k*x/m;<br />
where k is the spring constant, x is the position, and m is the mass.<br />
<br />
The analytic solution is calculated as:<br />
A * cos (sqrt(k/m)*t)<br />
where A is the amplitude (and the initial position) and t is the time in seconds.<br />
<br />
The constants were set to:<br />
A = 0.5<br />
m = 250.0<br />
dt = 0.1<br />
<br />
[[File:M250a1k200dt01t20.pdf-cropped.png]]<br />
<br />
This is the first simulation, with k set to 200 and run for 20 seconds. The Euler integrator is already unstable, with quickly increasing error as time goes on. All of the other methods are similar for this simulation.<br />
<br />
[[File:M250a1k10000dt01t20.pdf.png]]<br />
<br />
The k constant has been increased to 10,000. At this value all of the non-Euler methods are initially similar, but....<br />
<br />
[[File:M250a1k10000dt01t200.pdf.png]]<br />
<br />
This is the same k constant of 10,000 after ~200 seconds. The RK4 integrator is losing energy, while the NSV and Velocity Verlet methods have amplitudes similar to the exact answer.<br />
<br />
[[File:M250a1k100000dt01t20.pdf.png]]<br />
<br />
The k constant has been increased to 100,000. The NSV integrator is unstable at this level. The RK4 integrator is almost uniformly zero. The only integrator that is still close to the exact value is the Velocity Verlet integrator.<br />
<br />
[[File:M250a1k100000dt01t200.pdf.png]]<br />
<br />
This is the same k constant of 100,000 after ~200 seconds. The Velocity Verlet integrator is doing pretty well here, mostly preserving energy. The RK4 integrator is zero.<br />
<br />
[[File:M250a1k1000000dt01t20.pdf.png]]<br />
<br />
The k constant is now 1,000,000. At this level both the RK4 and Velocity Verlet integrators quickly become unstable.<br />
<br />
==Detailed Comparison: spring-mass-damper==<br />
For realtime dynamics simulations, damping forces are usually applied. The damping force is proportional to the velocity state, while the spring force is proportional to the position state. Acceleration is calculated as:<br />
a = (-k*x - c*v)/m<br />
where:<br />
c = 2*sqrt(k*m)<br />
<br />
The analytic solution for the position is:<br />
(A + B*t)*exp(-w*t)<br />
where:<br />
w = sqrt(k/m);<br />
B = vo + w*xo;<br />
<br />
The constants were set to:<br />
m = 250.0<br />
A = 1.0<br />
xo = 1.0<br />
vo = 0.0<br />
dt = 0.1<br />
<br />
Because the Velocity Verlet algorithm shown above isn't technically correct since due to the damper the acceleration depends on the velocity, a modified Velocity Verlet algorithm was added to the comparison which is purported to give better results for these sorts of cases:<br />
if (not oldaccel)<br />
oldaccel = acceleration(state, t+dt)<br />
<br />
x += v*dt + 0.5*oldaccel*dt*dt<br />
v += 0.5*oldaccel*dt<br />
a = acceleration(state, t+dt)<br />
v += 0.5*a*dt<br />
<br />
oldaccel = a<br />
<br />
[[File:Damped-m250a1k10000dt01t10.png]]<br />
<br />
Cutting right to the chase, k=10,000 is where the unmodified Velocity Verlet algorithm starts to fall apart. The other integrators are similar, although note that the RK4 solution is right on top of the analytic solution.<br />
<br />
[[File:Damped-m250a1k15000dt01t10.png]]<br />
<br />
Increasing k to 15,000 results in the NSV starting to show major inaccuracies. Surprisingly, the Euler algorithm is still stable and doesn't show the same undesirable behavior as the NSV algorithm.<br />
<br />
[[File:Damped-m250a1k18000dt01t10.png]]<br />
<br />
At k = 18,000, the modified Verlet algorithm becomes unstable and we're left with only the Euler and RK4 algorithms. The Euler algorithm starts to have major error at k = 30,000, and the RK4 does the same at k = 80,000.<br />
<br />
==Summary==<br />
The results from the spring oscillator and critically damped spring are shown below as rankings for each integrator, with 1 being the best and 4 the worst. The rankings are based on when the method becomes unstable, with accuracy being used as a tie-breaker where necessary.<br />
{| cellspacing="0" border="1"<br />
!Method<br />
!Oscillating Spring<br />
!Critically Damped Spring<br />
|-<br />
!Euler<br />
|4<br />
|2<br />
|-<br />
!NSV<br />
|3<br />
|4<br />
|-<br />
!RK4<br />
|2<br />
|1<br />
|-<br />
!Velocity Verlet<br />
|1<br />
|3<br />
|}<br />
It should be noted that for the oscillating spring case, the RK4 integrator resulted in poor accuracy (zero response) while all of the other algorithms except the Euler method were still giving plausible results. Although the RK4 algorithm stayed stable until the same high k values as the Velocity Verlet algorithm, the velocity verlet algorithm's better accuracy at lower k values makes it clearly better for this case.<br />
<br />
The performance of the Euler, NSV, and Velocity Verlet integrators is similar, with the Euler and NSV methods resulting in slightly less arithmetic. The RK4 has worse performance and is more complicated. In fact, the RK4 results in 4 evaluations of the acceleration function per timestep. If this function is the performance bottleneck, then the other methods could be run with a smaller timestep (0.25*dt) with similar performance, and with a smaller timestep all methods (except the basic Euler) outperform the RK4 algorithm for both cases.<br />
<br />
The RK4 algorithm is very stable, but it comes at a performance and accuracy cost. The RK4 integrator loses energy and requires much more arithmetic. Better stability and accuracy could be achieved at the same performance level by running the Velocity Verlet algorithm with a smaller timestep.<br />
<br />
Based on the stability, accuracy, and performance of these integrators, I believe that the best algorithm for general realtime dynamics simulations is the modified Velocity Verlet algorithm.<br />
<br />
[[Category:Development]]<br />
[[Category:Historical]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Source_code_documentation&diff=1269Source code documentation2012-09-01T10:58:04Z<p>Timo 6: Update categories</p>
<hr />
<div>Doxygen documentation is available for VDrift. Currently only the Subversion trunk is available. It is generated daily from the latest version of the [[Getting the development version|Development version]].<br />
<br />
== Other versions ==<br />
Doxygen output for the last release will be added soon. When new releases are made, documentation will be made available with the release.<br />
<br />
== Read Online ==<br />
You can find [http://vdrift.net/doxygen/trunk/ Doxygen for VDrift trunk] at the following URL:<br />
http://vdrift.net/doxygen/trunk/<br />
<br />
== Download ==<br />
Downloadable PDF and Zip archives of the HTML version for offline browsing will be available soon.<br />
<br />
== Help improve documentation ==<br />
If you are writing new code for VDrift, it would help to write comments using a format Doxygen can take advantage of. Here are a few handy links describing how to do that:<br />
* [http://www.stack.nl/~dimitri/doxygen/docblocks.html Doxygen Manual: Documenting Code]<br />
* [http://www.stack.nl/~dimitri/doxygen/commands.html Doxygen Manual: Command Reference]<br />
* [http://www.stack.nl/~dimitri/doxygen/manual.html Entire Doxygen Manual]<br />
<br />
[[Category:Development]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Coding_guidelines&diff=1268Coding guidelines2012-09-01T10:57:42Z<p>Timo 6: Update categories</p>
<hr />
<div>==File extensions==<br />
Header files have .h extensions.<br />
Source implementation files have .cpp extensions.<br />
<br />
==Code==<br />
VDrift code is formatted using all tabs and no spaces. The following example demonstrates VDrift's coding style. <br />
<br />
class EXAMPLECLASS<br />
{<br />
private:<br />
int data;<br />
<br />
public:<br />
EXAMPLECLASS();<br />
~EXAMPLECLASS(); <br />
<br />
void MemberFunction();<br />
};<br />
<br />
// Add the sum of the number 1 - 10 to data.<br />
void EXAMPLECLASS::MemberFunction()<br />
{<br />
// loop and add i to data <-- Useless comment, should be avoided.<br />
for (int i = 1; i <= 10; i++)<br />
{<br />
data += i;<br />
}<br />
}<br />
<br />
==Indentation and Naming==<br />
Notice the use of ALL CAPS for class names. Function names should be presented in MixedCase?. Opening and closing curly brackets ({}) should be on their own line, and should not be indented. The enclosed statements however, should be indented. <br />
<br />
Control statements should have one space between the statement and the left paren. There should be no padding inside of the parens unless it helps readability, use your judgement. Function calls should have no spaces between the function name and the left paren. <br />
<br />
==Commenting==<br />
Do not overuse comments. Only comment code which has side effects, is not clear at first glance, or includes complex operations. It is OK to comment a section of code with a description of what that section does.<br />
<br />
It is a good idea to comment most non-trivial classes, methods, and instance variables. When commenting code, keep in mind that using [http://doxygen.org/ Doxygen] style comments will help to generate better documenation. See [[Source code documentation]] for more information.<br />
<br />
==Inheritance==<br />
Inheritance is generally discouraged ''except'' in simple cases where the base class is abstract and there is only one level of inheritance.<br />
<br />
In general, excessive use of inheritance compromises code readability and could be easily fixed by using a member variable instead of inheritance. For example, instead of making CAR inherit from ENGINE, the CAR should contain an ENGINE member.<br />
<br />
==Coupling/Dependency==<br />
Coupling (or dependency) is the degree to which each program module relies on each one of the other modules. Coupling should be eliminated between unrelated modules. De-coupling modules leads to greater code cohesion, and high cohesion is associated with several desirable traits of software including robustness, reliability, reusability, and understandability whereas low cohesion is associated with undesirable traits such as being difficult to maintain, difficult to test, difficult to reuse, and even difficult to understand.<br />
<br />
Program module (class) dependencies should be structured in a tree form, where higher level modules know about lower level modules, but lower level modules don't know about each other. For example, if there is a GAME module that contains a RENDERER module and a SETTINGS module, the code inside the GAME module should query the SETTINGS module and then initialize the RENDERER appropriately. That is, the GAME module would tell the SETTINGS module to go read the configuration file, ask the SETTINGS class "what's the display resolution supposed to be? how many bits per pixel? etc", and then make its calls to the RENDERER saying "okay, set up a display with this resolution, this many bits per pixel, etc". The RENDERER should ''not'' know anything about the SETTINGS module and should not access it. The advantage is that now the RENDERER doesn't need to know anything about a SETTINGS subsystem (and vice versa). If the SETTINGS subsystem is later rewritten, it doesn't (and shouldn't ever) cause any changes to code in the RENDERER. The RENDERER is now decoupled from the SETTINGS subsystem, and can now be re-used in a different project with a completely different SETTINGS subsystem. Decoupling also makes thread-safe coding easy.<br />
<br />
Globals and singletons cause excessive coupling due to their global-access properties and should be completely avoided.<br />
<br />
==Namespaces==<br />
Classes are declared in the global namespace, but can also be put in custom namespaces if appropriate.<br />
<br />
No include file should pollute the global namespace with a "using" directive. That is, lines such as "using namespace std" should not occur in any header (.h) file. All "using" directives should be put into the implementation source files (.cpp). This is because any source file that includes a header with a using directive will have its global namespace unexpectedly polluted in whatever way the header file specifies.<br />
<br />
For "using" directives in .cpp files, specific "using" declarations are preferred to "using namespace" declarations. That is, prefer "using std::string", "using std::endl", etc to "using namespace std". This is for readability.<br />
<br />
==Testing==<br />
Unit testing is encouraged. VDrift comes with the [http://quicktest.sourceforge.net QuickTest] unit testing framework. To use, simply #include "unittest.h" in your source code implementation files.<br />
<br />
{{note|Currently, not all of VDrift's code follows these guidelines, do not waste time cleaning up the code, unless you are re-writing that particular piece of it. There will be a time when the code will be cleaned up. Also code from the Vamos project, does not follow these guidelines either. Make sure all new code written for VDrift follows these guidelines.}}<br />
<br />
[[Category:Development]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Debugging&diff=1267Debugging2012-09-01T10:57:21Z<p>Timo 6: Update categories</p>
<hr />
<div>Debugging VDrift can help provide the developers with more information on problems, so they can be more effectively fixed. This article hopes to explain how to do this.<br />
<br />
==General==<br />
VDrift outputs most of its debugging info on to the console via "cout" statements. There are some logs kept in ~/.vdrift/logs/ but they are not used much. To get more output on the console, users can simply use the '''-verbose''' option when running the game:<br />
vdrift -verbose<br />
This will drastically increase the amount of debugging output. This may reduce game performance but makes it easier to get an idea of where problems are occurring.<br />
<br />
{{note|On Windows, the game is not usually run in a console so the debugging output can't be seen.}}<br />
<br />
==Linux==<br />
If the game crashes it is easiest to get information about the crash from GDB, the GNU Debugger. <br />
===GDB===<br />
On Linux debugging can be done using '''gdb'''. First, VDrift must be compiled with debugging symbols. To turn on debugging symbols simply use the '''release=0''' option when running SCons:<br />
scons release=0<br />
<br />
{{note|VDrift binary releases are stripped of debugging symbols to decrease the size of the binary. These will not produce any useful information if run with GDB.}}<br />
<br />
Now the binary (which is in the build/ directory if it is not installed) can be analyzed with GDB. Make sure you have the program '''gdb''' installed on your system, then run GDB on the vdrift binary (change "build/vdrift" to just "vdrift" if you ran '''scons install'''):<br />
gdb build/vdrift<br />
This will put you on the gdb shell where you can then run the game. Here you can also specify any command line arguments to pass to the game. '''-verbose''' is added here as an example, but no options are necessary for debugging.<br />
(gdb) run -verbose<br />
Now the game will run. You may notice that when running in GDB game performance is less than normal. This is a natural side effect of GDB and nothing to worry about.<br />
<br />
====Obtaining a backtrace====<br />
If the game crashes (commonly resulting in a "Segmentation Fault" error) while running in GDB it is possible to obtain a ''backtrace'' of the crash. This is basically the stack of function calls that happened to trigger the crash. To obtain a backtrace within GDB, wait for the game to crash, and then when returned to the GDB prompt, enter the '''backtrace''' command:<br />
(gdb) backtrace<br />
The output of this command can be posted on the VDrift forums for the developers to see. Please follow up on your post, as we may have other questions for you or may need you to perform other tests to properly identify the problem.<br />
<br />
<br />
[[Category:Development]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Testing&diff=1266Testing2012-09-01T10:56:48Z<p>Timo 6: Update categories</p>
<hr />
<div>VDrift includes a very simple unit testing framework for C++ code. It is derived from [http://quicktest.sourceforge.net/ QuickTest].<br />
<br />
==Running the Tests==<br />
To run unit tests, the test executable must first be built.<br />
<br />
===Building===<br />
In the VDrift source root, run:<br />
scons test<br />
<br />
===Executing===<br />
The executable is called '''vdrift-test''' and is compiled to the '''build/''' directory in the root of the VDrift source tree. To run it, simply do:<br />
build/vdrift-test<br />
<br />
===Results===<br />
The results are written to STDOUT. An example:<br />
[-------------- RUNNING UNIT TESTS --------------]<br />
src/matrix4.cpp(26): 'matrix4_test' FAILED: value1 (1) should be close to value2 (0)<br />
src/matrix4.cpp(27): 'matrix4_test' FAILED: value1 (10) should be close to value2 (20)<br />
src/matrix4.cpp(28): 'matrix4_test' FAILED: value1 (-1.19209e-07) should be close to value2 (-1)<br />
src/matrix4.cpp(33): 'matrix4_test' FAILED: value1 (1) should be close to value2 (0)<br />
src/matrix4.cpp(34): 'matrix4_test' FAILED: value1 (10) should be close to value2 (0)<br />
src/matrix4.cpp(35): 'matrix4_test' FAILED: value1 (-1.19209e-07) should be close to value2 (1)<br />
Results: 29 succeeded, 1 failed<br />
[-------------- UNIT TESTS FINISHED -------------]<br />
<br />
==Writing New Tests==<br />
Consult the [http://quicktest.sourceforge.net/usage.html QuickTest How to Use It] and the [http://quicktest.sourceforge.net/api.html QuickTest API Reference] for details on how to write unit tests using QuickTest.<br />
<br />
===Example Tests===<br />
To look at some example test code already in VDrift, look at '''src/*.cpp''' files which contain the macro <code>QT_TEST</code>.<br />
<br />
[[Category:Development]]</div>Timo 6http://wiki.vdrift.net/index.php?title=3D_modeling&diff=12653D modeling2012-09-01T10:55:25Z<p>Timo 6: Update categories</p>
<hr />
<div>==Blender==<br />
[http://blender.org/ Blender] is the best 3D modeling application to use for creating cars, tracks, and related 3D game art for VDrift. <br />
<br />
===General Use===<br />
* [http://wiki.blender.org/ Blender Wiki] - All the official Blender documentation, including the [http://wiki.blender.org/index.php/Doc:Manual User's Manual].<br />
* [http://blenderunderground.com/video-tutorials/ BlenderUnderground Blender Video Tutorials] - The Blender Basics series seeks to provide a way for those new to Blender, or those new to 3D graphics in general, to begin to master this powerful and capable application.<br />
* [http://www.blenderart.org/issues/ BlenderArt Magazine] - A magazine dedicated to Blender.<br />
<br />
===Modeling Cars===<br />
* [http://www.blendernation.com/2006/04/15/tutorial-modeling-a-toyota-celica/ BlenderNation Tutorial: Modeling a Toyota Celica] - If you want to learn how to model a car from reference pictures, then check out this tutorial. It covers techniques such as loading bitmaps in the 3D viewports, tracing them, mesh extrusion, normal correction and using subdivision surfaces. Aimed at intermediate level Blender users.<br />
* [http://issuu.com/blenderart_magazine/docs/blenderart_mag-8_eng BlenderArt Magazine, Issue 8: Car Modeling] - An entire magazine issue about modeling cars. <br />
<br />
===Modeling Tracks===<br />
* [http://supertuxkart.sourceforge.net/Blender_track_modelling_tutorial Super TuxKart Track Modeling Tutorial] - A little guide on how to build tracks with Blender and how to avoid common pitfalls. Some basic Blender knowledge is assumed.<br />
<br />
[[Category:Cars]]<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_parameters&diff=1264Car parameters2012-09-01T10:55:02Z<p>Timo 6: Update categories</p>
<hr />
<div>* [[Car parameters for vdrift-2010-06-30]]<br />
* [[Car parameters for vdrift-2009-06-15 and older]]<br />
<br />
The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
For unit conversion you can go to: [http://www.sonar-equipment.com/useful_conversion_factors_table1_p00.htm ''This Site''].<br />
<br />
The .car file contains several sections. Each section will now be described, along with example values from the XS.car file. The XS has performance comparable to the Honda S2000.<br />
<br />
==Coordinate system==<br />
The .car files use the [http://en.wikipedia.org/wiki/Cartesian_coordinate_system#In_three_dimensions right-handed (positive)] coordinate system for all parameters:<br />
* '''x axis''': negative is left, positive is right<br />
* '''y axis''': negative is back, positive is forward<br />
* '''z axis''': negative is down, positive is up<br />
<br />
==Common Parameters==<br />
<pre><br />
[section]<br />
texture = diffuse.png, misc1.png, misc2.png<br />
mesh = model.joe<br />
position = 0.736, 1.14, -0.47<br />
rotation = 0, 0, 30<br />
scale = -1, 1, 1<br />
color = 0.8, 0.1, 0.1<br />
draw = transparent<br />
mass = 40<br />
</pre><br />
Every car section supports a set of optional parameters to describe its graphic representation.<br />
<br />
Texture is a list of textures that has to contain at least one texture, usually the diffuse color texture. Mesh defines the model mesh to be used with the texture. Texture and mesh paths are relative to car(XS) and carparts(shared components) directory. <br />
<br />
Position/rotation(in degrees)/scale will transform the mesh relative to parent. Color defines the color of the mesh(to be blended with the texture according to its alpha channel). Draw allows the options transparent(according to first textures alpha channel) or emissive(won't be affected by lighting, used for brake/reverse light models).<br />
<br />
Mass is used to calculate car inertia, weight and center of mass.<br />
<br />
==Engine==<br />
<pre><br />
[engine]<br />
position = 0.86, 0.0, -0.21<br />
mass = 140.0<br />
max-power = 1.79e5<br />
peak-engine-rpm = 7800.0<br />
rpm-limit = 9000.0<br />
inertia = 0.25<br />
idle = 0.02<br />
start-rpm = 1000<br />
stall-rpm = 350<br />
fuel-consumption = 1e-9<br />
torque-friction = 0.0003<br />
torque-curve-00 = 1000, 140.0<br />
torque-curve-01 = 2000, 149.14<br />
torque-curve-02 = 2200, 145.07<br />
torque-curve-03 = 2500, 147.78<br />
torque-curve-04 = 3000, 169.50<br />
torque-curve-05 = 3300, 172.19<br />
torque-curve-06 = 4000, 169.50<br />
torque-curve-07 = 4500, 166.77<br />
torque-curve-08 = 5600, 172.19<br />
torque-curve-09 = 5800, 170.83<br />
torque-curve-10 = 6000, 168.12<br />
torque-curve-11 = 6100, 177.61<br />
torque-curve-12 = 6200, 186.42<br />
torque-curve-13 = 6300, 192.53<br />
torque-curve-14 = 6500, 195.92<br />
torque-curve-15 = 6700, 195.92<br />
torque-curve-16 = 7000, 195.24<br />
torque-curve-17 = 7600, 190.49<br />
torque-curve-18 = 8000, 184.39<br />
torque-curve-19 = 8200, 183.04<br />
torque-curve-20 = 8300, 146.43<br />
torque-curve-21 = 9500, 146.43<br />
</pre><br />
The position and mass parameters affect the weight distribution of the car. The torque curve is calculated from max-power and peak-engine-rpm using a polynomial expression given in Motor Vehicle Dynamics, Genta (1997), where peak-engine-rpm is the engine speed at which the maximum power output (max-power) is achieved. Alternatively, the torque curve can be explicitly defined, as in the example above. A rev limit can be set with rpm-limit. The rotational inertia of the moving parts is inertia. Idle is the throttle position at idle. Starting the engine initially sets the engine speed to start-rpm. Letting the engine speed drop below stall-rpm makes the engine stall. The rate of fuel consumption is set with fuel-consumption. The actual fuel consumed each second (in units of liters) is the fuel-consumption parameter times RPM times throttle (throttle is from 0.0 to 1.0, where 1.0 is full throttle).<br />
<br />
==Clutch==<br />
<pre><br />
[clutch]<br />
sliding = 0.27<br />
radius = 0.15<br />
area = 0.75<br />
max-pressure = 11079.26<br />
</pre><br />
The clutch is described by its sliding friction coefficient, radius, area and maximum applied pressure. The torque capacity(maximum transmitted torque) of the clutch is TC = sliding * radius * area * max-pressure. It should be somewhere between one and two times the maximum enine torque. TC = 1.25 * max-engine-torque is a good start value.<br />
<br />
==Transmission==<br />
<pre><br />
[transmission]<br />
gears = 6<br />
gear-ratio-r = -2.8<br />
gear-ratio-1 = 3.133<br />
gear-ratio-2 = 2.045<br />
gear-ratio-3 = 1.481<br />
gear-ratio-4 = 1.161<br />
gear-ratio-5 = 0.943<br />
gear-ratio-6 = 0.763<br />
shift-time = 0.2<br />
</pre><br />
The number of forward gears is set with the gears parameter. The gear ration for reverse and all of the forward gears is then defined. The shift-time tag tells how long it takes, in total seconds, to change gears (when autoclutch is enabled). Half the time is spent changing the gear and the other half is spent letting the clutch out. This parameter is not required and defaults to 0.2 seconds, which is a reasonable value for a manual transmission. F1 cars take about 50 ms, by comparison.<br />
<br />
==Differential==<br />
For '''FWD''' cars [differential.front] has to be defined. '''AWD''' cars require [differential.front], [differential.rear] and [differential.center].<br />
<pre><br />
[differential.rear]<br />
final-drive = 4.100<br />
anti-slip = 600.0<br />
anti-slip-torque = 1<br />
anti-slip-torque-deceleration-factor = 0<br />
</pre><br />
The final drive provides an additional gear reduction. The anti-slip parameter defines the maximum anti-slip torque. For speed-sensitive differentials, it also defines the anti-slip torque per radian per second of speed difference between the wheels. If the differential is speed-sensitive, the anti-slip-torque and anti-slip-torque-deceleration-factor parameters must be omitted or set to zero. If the differential is torque-sensitive, then anti-slip-torque defines the amount of anti-slip torque per input torque. The anti-slip-torque-deceleration-factor defines the amount of anti-slip torque per negative input torque. For a 1-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to zero, for a 2-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to 1.0, for 1.5-way, set it between 0.0 and 1.0.<br />
<br />
==Fuel tank==<br />
<pre><br />
[fuel-tank]<br />
position = 0.0, -1.0, -0.26<br />
capacity = 0.0492<br />
volume = 0.0492<br />
fuel-density = 730.0<br />
</pre><br />
The fuel tank's position, the current volume of fuel and the density of the fuel affect the car's weight distribution. The capacity tag sets the maximum volume of fuel that the tank can hold. The initial volume is set with the volume tag. The density of the fuel is set with fuel-density.<br />
<br />
==Camera==<br />
<pre><br />
[camera]<br />
view-position = -0.35, -0.64, 0.30<br />
hood-mounted-view-position = 0, 0.55, 0.17<br />
view-stiffness = 0.0<br />
</pre><br />
The view positions define 3D coordinates for camera placement. The view-stiffness parameter defines the stiffness of the camera bounce effect, where 0.0 is a sports car and 1.0 is F1-ish.<br />
<br />
==Wing==<br />
<pre><br />
[wing.rear]<br />
position = 0.0, -2.14, 0.37<br />
frontal-area = 0.05<br />
drag-coefficient = 0.0<br />
surface-area = 0.5<br />
lift-coefficient = -0.7<br />
efficiency = 0.95<br />
</pre><br />
Wing identifiers front, center, rear are arbitrary(can be chosen freely). A wing describes the aerodynamics(car body, front/rear wing) of the car. A car has to have at least one wing, to capture body drag. Most cars will use up to three. The frontal area and coefficient of drag, set with frontal-area and drag-coefficient, are used to calculate the drag force.<br />
<br />
Downforce can be added with the optional parameters surface-area, lift-coefficient, efficiency. If the lift coefficient is positive, upforce is generated. This is usually undesirable for cars. The efficiency determines how much drag is added as downforce increases. The surface-area is the surface area of the wing. This value is also used in the drag calculation.<br />
<br />
==Wheel==<br />
<pre><br />
[wheel.fl]<br />
texture = oem_wheel.png, oem_wheel-misc1.png<br />
mesh = oem_wheel.joe<br />
position = -0.736, 1.14, -0.47 #track front/rear 1471/1509<br />
camber = 0.5<br />
caster = 6.0<br />
toe = -0.16<br />
ackermann = 8.46 # 50% ackermann<br />
steering = 30<br />
</pre><br />
The number of wheels is fixed to four: fl, fr, rl, rr. For a FWD car the wheels fl and fr are powered, for RWD the wheels rl and rr.<br />
<br />
The wheel mesh is the wheel disk mesh(wheel mesh without rim). The mesh will be scaled according to tire dimensions, has to fit into a unit cube. The rim mesh is generated automatically.<br />
<br />
Wheel alignment is set with the camber, caster, and toe. All angles are in degrees. For a "negative camber" the left wheel camber has to be negative, the right wheel camber positive.<br />
<br />
Ackermann and steering are optional. Ackermann is the steering arm angle relative to wheel. Ideal ackermann(100%) is atan(0.5* track / wheelbase). For the right wheel positive ackermann is positive, for the left negative. Steering is the maximum steering angle of the wheel(for ackermann = 0). A negative steering leads to a reverted steering.<br />
<br />
==Suspension==<br />
<pre><br />
[wheel.fl.hinge]<br />
wheel = -0.736, 1.14, -0.47<br />
chassis = 0.0, 0.99, -0.55<br />
</pre><br />
Suspension has to be defined per wheel. Hinge suspension is equivalent to a parallel double wishbone setup. The hinge link is attached at chassis to car body and at wheel to wheel hub.<br />
<br />
<pre><br />
[wheel.fl.macpherson-strut]<br />
strut-top = -0.66, 1.34, 0.05<br />
strut-end = -0.70, 1.34, -0.505<br />
hinge = -0.36, 1.34, -0.44<br />
</pre><br />
Alternatively a macpherson-strut setup can be used. Hinge is the lower link attachment point to car body. The wheel attachment point is the wheel hub position.<br />
<br />
==Coilover==<br />
<pre><br />
[wheel.fl.coilover]<br />
spring-constant = 49131.9<br />
bounce = 2600<br />
rebound = 7900<br />
damper-factor-1 = 0.06, 1.2<br />
damper-factor-2 = 0.08, 1.1<br />
damper-factor-3 = 0.1, 1<br />
damper-factor-4 = 0.2, 0.9<br />
damper-factor-5 = 0.5, 0.5<br />
damper-factor-6 = 1, 0.3<br />
damper-factor-7 = 5, 0.1<br />
travel = 0.19<br />
anti-roll = 800.0<br />
</pre><br />
Each wheel has a coilover(spring-damper unit). The spring-constant is the '''wheel rate''' in N/m. The spring-factor-1 and 2 parameters define a curve for the spring response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is the suspension displacement in meters and y is the factor to be applied to the spring coefficient. In this example, the spring factor will be 1.0 when the displacement is between 0 and 0.052 m, and then the spring factor will change linearly to 1.2 at 0.055 m (and beyond). The spring factor gets multiplied by the spring-constant. You can put as many spring-factor points as you want (just increase the spring-factor- number for each additional point). Note that displacement values are relative to the "zero g", "zero force" position. For best results, start VDrift with the -debug option and observe suspension displacements during maneuvering to determine where you want to put your points.<br />
<br />
The bounce and rebound parameters are the damping coefficients for compression and expansion of the suspension, respectively, in units of N/m/s. The damper-factor-1 and 2 parameters define a curve for the damper response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is an absolute value of suspension velocity in m/s and y is the factor to be applied to the damping coefficient. In this example, the damper factor will be 1.0 when the compression velocity absolute value is between 0 and 0.08 m/s, and then the damper factor will change linearly to 0.7 at 0.1 m/s (and beyond). The damper factor gets applied to the bonce or rebound damper coefficient, depending on the direction of travel. You can put as many damper-factor points as you want (just increase the damper-factor- number for each additional point).<br />
<br />
The travel is the maximum wheel travel from wheel extended position. Anti-roll in N/m is currently incorrectly associated with the wheel coilover, acts between front wheels fl and fr and rear wheels rl and rr.<br />
<br />
==Tire==<br />
<pre><br />
[wheel.fl.tire]<br />
texture = tire/touring.png<br />
size = 215, 45, 17<br />
type = &tire/touring<br />
</pre><br />
Tire size determines tire dimensions:<br />
* section width in millimeters, measured from sidewall to sidewall<br />
* ratio of sidewall height to section width in percent<br />
* diameter of the wheel in inches<br />
Each wheel has a tire section. Tire size is used to calculate wheel weight and inertia. The tire mesh is optional and has to be centered at origin and fit into a unit box. It will be scaled according to tire dimensions. If omitted a default mesh is generated/used.<br />
<br />
Tire type is a tire subsection [wheel.fl.tire.type], here a reference. This means car loader will look for a [tire/touring] section and alternatively for a file tire/touring relative to car and carparts directory. The first found section definition is used. More info about tire type definition can be found here: [[Tire parameters]]<br />
<br />
==Brake==<br />
<pre><br />
[wheel.rl.brake]<br />
texture = rotor_shiny_slotted_drilled.png<br />
friction = 0.6<br />
max-pressure = 4.0e6<br />
bias = 0.45<br />
radius = 0.14<br />
area = 0.015<br />
handbrake = 1.0<br />
</pre><br />
The bias parameter is the fraction of braking pressure applied to the front brakes (in the front <span class="plainlinks">[http://how2gainweightfast.org <span style="color:black;font-weight:normal;text-decoration:none!important;background:none!important; text-decoration:none;">weight gain</span>]</span> brake section) or the rear brakes (in the rear brake section). To make sense, the rear value should equal 1.0 minus the front value. The maximum brake torque is calculated as friction * area * bias * max-pressure * radius. Handbrake determines the handbrake influence factor. Texture is an optional brake rotor texture. If set a brake rotor model is generated.<br />
<br />
==Steering==<br />
<pre><br />
[steering]<br />
texture = steering_wheel.png<br />
mesh = steering_wheel.joe<br />
position = -0.37, 0.44, 0.09<br />
rotation = 87.5, 0.0, 0.0<br />
max-angle = 320<br />
</pre><br />
Steering defines the steering device. The rotation of the steering model is constrained by max-angle. The rotation axis is the local z-axis of the steering mesh.<br />
<br />
==Particle==<br />
<pre><br />
[particle.00]<br />
position = 0.0, -1.28, -0.36<br />
mass = 30.0<br />
</pre><br />
These values are used for weight distribution and rotational inertia. Most cars will use 6-10.<br />
<br />
==Light==<br />
<pre><br />
[light-brake]<br />
texture = brake.png<br />
mesh = body.joe<br />
draw = emissive<br />
<br />
[light-reverse]<br />
texture = reverse.png<br />
mesh = body.joe<br />
draw = emissive<br />
</pre><br />
Car lights are treated as car shape models. light-brake is set emissive during braking, light-reverse if reverse gear is selected.<br />
<br />
==Car shape==<br />
<pre><br />
[driver]<br />
texture = driver2.png, driver-misc1.png<br />
mesh = driver.joe<br />
position = -0.37, 0.07, 0.05<br />
mass = 90.0<br />
<br />
[body]<br />
texture = body00.png<br />
mesh = body.joe<br />
<br />
[interior]<br />
texture = interior.png<br />
mesh = interior.joe<br />
<br />
[glass]<br />
texture = glass.png<br />
mesh = glass.joe<br />
draw = transparent<br />
</pre><br />
The car shape can consist of an arbitrary number of models with arbitrary names excluding the reserved ones: engine, clutch, ...<br />
<br />
Shape hierarchies [body.foo] are not supported.<br />
<br />
[[Category:Cars]]<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Creating_cars&diff=1263Creating cars2012-09-01T10:54:38Z<p>Timo 6: Update categories</p>
<hr />
<div>This article gives a rough idea of what it takes to create a car for VDrift.<br />
<br />
==Get the Art Tools==<br />
Download the [https://github.com/VDrift/blender-scripts Blender export scripts] from [[Getting the development version|GitHub]].<br />
<br />
==Create Models==<br />
You will need to create 3D models using Blender for the car's body, the glass pieces, and the wheels. Each different model must be a separate Blender object and each must have a separate texture. Models must be entirely made of triangles. Units of the models are in meters.<br />
<br />
===Coordinate Systems===<br />
See [[Coordinate systems]]<br />
<br />
===Shading and Smoothing===<br />
Faces (and perhaps individual vertices) can be set to smooth or solid shading, and that will get exported in the joe file. The best way to do smoothing is to select all of the faces, set solid, and then select groups that should be blended together and do set smooth individually. That makes it so that smooth parts that intersect in a hard edge have correct normals. Don't use any double-sided faces.<br />
<br />
===Body Model===<br />
In the model pack you will find a Blender file "test.blend". This is the default car model. The glass is one object and the rest of the car is one object. This allows you to export the glass as a "glass.joe" file and the rest of the car as a "body.joe" file. The car should be in the neighborhood of 3500 faces (car and windows combined), although less is of course possible and more is probably also acceptable. The body can be placed anywhere, although by convention the body is usually placed so that the center of the model is near the origin.<br />
<br />
===Interior Model===<br />
The interior model should fit inside the body model to provide the inside of the car. This is a separate model so it can appear flat instead of shiny like the painted exterior. The interior model should share the center point or object handle of the body model so they fit together perfectly without being translated.<br />
<br />
===Wheel Model===<br />
The file "wheel.blend" is the default wheel model. Try to keep your wheel model under 1000 faces. The wheel model must be centered at the origin.<br />
<br />
==Texture the Models==<br />
A single UV map can be used per object for texturing. The .png files are the textures for each associated .joe model. The textures must be 512x512 24- or 32-bit PNG images. Their names should be the same as the model they coordinate with except for the .png extension at the end. For example, the texture for the model "body.joe" must be named "body.png".<br />
<br />
===Brake lights===<br />
Add a texture "brake.png" that is the same as the body graphic, but the brake lights are now on and the rest of the file is black. This should be a 24-bit png file (no alpha channel).<br />
<br />
==Export the Models==<br />
Using the Python scripts ("export-joe-0.3.py" and "export-all-joe-0.3.py") you can export objects modeled in Blender to JOE format. The mesh needs to be all triangles before export. The currently selected object is exported. Object level transformations are not exported, so make sure any rotation or moving or scaling is done in edit mode, not object mode. You can actually position the car wherever you want, but all of your positioning must match up with the values in the car's .car file. The default exporter setting of 1 frame is what you should use. The export-all script exports all the objects to files based on the objects' names.<br />
<br />
==About file==<br />
Write a short text file about your car. This goes in the about.txt file. This information is displayed in the car selection menu. Please include information such as authorship and license. See the other cars for examples.<br />
<br />
==Car Definition File==<br />
Finally you must write car definition file, which contains all of the [[car parameters]]. You can start by copying tools/cars/blank.car and entering values to fit your vehicle. Try to find accurate information regarding the specifications of the car and duplicate it as closely as possible. The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
<br />
Needless to say, it requires a lot of knowledge to create a car definition file from scratch so it is suggested that you try using values from other cars. Many of the [http://www.racer-xtreme.com/ community-made cars for Racer] have very similar values that can be used for VDrift.<br />
<br />
==Locations==<br />
All the files needed for a car go into the directory '''data/cars/car_name/''', where ''car_name'' is the short name of the car.<br />
<br />
==Need Help?==<br />
Try the related wiki articles on [[car files and formats]], [[car parameters]], or the [[car modeling tutorial]]. If you get stuck, feel free to ask questions in our [http://vdrift.net/Forum/viewforum.php?f=1 VDrift.net Help forum] or on [http://vdrift.net/staticpages/index.php?page=irc-chat VDrift IRC]<br />
<br />
==Contribute==<br />
Once you create a new car please contribute it back to the game so that others can enjoy it. The best way to do this is to start a thread in our [http://vdrift.net/Forum/viewforum.php?f=5 Development forum] or to create an account on [http://cars.vdrift.net cars.vdrift.net] and upload it there.<br />
<br />
[[Category:Cars]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_files_and_formats&diff=1262Car files and formats2012-09-01T10:54:11Z<p>Timo 6: Add category</p>
<hr />
<div>Files within a car's folder:<br />
<br />
*CARNAME.car: [[Configfile_format]], list of [[car parameters]].<br />
*about.txt: text format, first line contains the car name, other lines contain additional info.<br />
*body.joe: [[JOE format]], car body geometry.<br />
*body00.png: PNG format, the body.joe UV texture. Additional body textures and colors can be placed in the folder using names body01.png, body02.png, etc.<br />
*brake.png: PNG format, an additive texture using the body.joe UV texture containing brake lights.<br />
*collision.joe: [[JOE format]], collision box geometry. Note that as of R2396, this file is no longer required.<br />
*engine.wav: WAVE format, engine sound at 7000 RPM.<br />
*glass.joe: [[JOE format]], geometry data for any glass elements from the car body (such as windows).<br />
*glass.png: PNG format, the glass.joe UV texture. Texture transparency is supported.<br />
*interior.joe: [[JOE format]], geometry data for the car's interior.<br />
*interior.png: PNG format, the interior.joe UV texture.<br />
*oem_wheel.joe: [[JOE format]], geometry data to be used for the wheels.<br />
*oem_wheel.png: PNG format, the oem_wheel.joe UV texture.<br />
*reverse.png: PNG format, an additive texture using the body.joe UV texture containing reverse lights.<br />
<br />
[[Category:Cars]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Getting_cars&diff=1261Getting cars2012-09-01T10:53:42Z<p>Timo 6: Formatting style updates</p>
<hr />
<div><small>[[Getting cars|English]] - [[Getting cars/it|Italiano]]</small><br />
<br />
A small selection of cars are distributed in the release VDrift packages. This page describes how to get some more.<br />
<br />
==List of cars==<br />
The following cars are in the [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data data repository] of VDrift. To see pictures of some of the cars visit the [http://cars.vdrift.net cars.vdrift.net] website.<br />
<br />
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"><br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/350Z/ 350Z]: Nissan 350Z<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/360/ 360]: Ferrari 360 Modena<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/3S/ 3S]: Mazda 3<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/ATT/ ATT]: Audi TT<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/AX2/ AX2]: Fictional Concept Car<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/C7/ C7]: Lotus Super Seven<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/CO/ CO]: AC Shelby Cobra<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/CS/ CS]: Porsche 911 Clubsport<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/CT/ CT]: Porsche Carrera Turbo<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/DCH/ DCH]: Dodge Challenger (1970)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/DSN/ DSN]: Dacia Supernova<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/EF/ EF]: Ferrari Enzo<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/F1-02/ F1-02]: F1 car (2002)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/F40/ F40]: Ferrari F40<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/FE/ FE]: Ford Escort MKII Rally<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/FF/ FF]: Formula Ford<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/G-P34/ G-P34]: Tyrrell P34<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/G4/ G4]: Ford GT40<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/GT/ GT]: Ford Mustang GT<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/GTR/ GTR]: Ford Mustang GT (non-drift version)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/GTV6/ GTV6]: Alfa Romeo GTV6<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/KF1-91/ KF1-91]: KF1 1991<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/KF1K/ KF1K]: KF1<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/KF1T/ KF1T]: KF1<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/LE/ LE]: Lotus Elise<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/LGN/ LNG]: Dacia Logan<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/M3/ M3]: BMW E30 M3<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/M3D/ M3D]: BMW M3 SPEED World Challenge<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/M7/ M7]: Mazda RX-7 FC<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/M8/ M8]: Mazda RX-8<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/MC/ MC]: Mini Cooper (new style)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/MI/ MI]: Mini Cooper (old style)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/NS/ NS]: Nissan Skyline R32<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/RG/ RG]: Renault 12 Gordini<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/RS2/ RS2]: Subaru Imprezza RS 2.5<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/SB/ SB]: Sand buggy<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/SV/ SV]: Lamborghini Miura SV<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/T73/ T73]: Lotus 43<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/TC/ TC]: Toyota Celica ST185 Rally<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/TC6/ TC6]: Toyota Celica (6th generation)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/TL/ TL]: Toyota Levin<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/TL2/ TL2]: Toyota Levin (model version 2)<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/TRA/ TRA]: Trabant 601<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/XG/ XG]: BMW 330cxi<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/XM/ XM]: BMW M3 SPEED World Challenge<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/XS/ XS]: Honda S2000<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/cars/Z06/ Z06]: Chevrolet C5 Corvette Z06<br />
</div><br />
<br />
==Downloading==<br />
Click the links in the list above then click the "Download GNU Tarball" link near the bottom of the page.<br />
<br />
==Installing==<br />
Uncompress the .tar.gz file. This should create a folder with the short name of the car containing files like '''about.txt''' and '''body.joe'''. Move that folder to '''vdrift/data/cars''' folder. Run VDrift and your new car will be ready to drive!<br />
<br />
==Updating==<br />
You can update cars from within VDrift itself. Go to Updates -> Check for updates. If any are available go Back -> Manage Cars, select the car to update and click "Download".<br />
<br />
==See also==<br />
* [[Getting tracks]]<br />
<br />
[[Category:Cars]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Car_parameters_for_vdrift-2009-06-15_and_older&diff=1260Car parameters for vdrift-2009-06-15 and older2012-09-01T10:50:37Z<p>Timo 6: Update categories</p>
<hr />
<div>The units are all in [http://scienceworld.wolfram.com/physics/MKS.html MKS] (meters, kilograms, seconds). It might also help to read [http://www.miata.net/sport/Physics/ ''The Physics of Racing''] by Brian Beckman.<br />
For unit conversion you can go to: [http://www.sonar-equipment.com/useful_conversion_factors_table1_p00.htm ''This Site''].<br />
<br />
The .car file contains several sections. Each section will now be described, along with example values from the XS.car file. The XS has performance comparable to the Honda S2000.<br />
<br />
==Coordinate system==<br />
A vector of 3 floats ( 1.0, 3.0, 1.5 ) will be interpreted as distances from the car body model origin. See [[Coordinate systems]] for a detailed description.<br />
<br />
==Top level parameters==<br />
<pre><br />
drive = RWD<br />
</pre><br />
The "drive" parameter accepts values "RWD", "FWD", "AWD" that correspond to rear wheel drive, front wheel drive, and all wheel drive, respectively.<br />
<br />
<pre><br />
version = 2<br />
</pre><br />
The file format version. The only change between version 1 and version 2 is the move to coordinate system version 2, which is described in [[Coordinate systems]]. If no version is specified version 1 is assumed. VDrift is backward compatible with previous file formats. VDrift is not forward compatible with new file formats -- that is, VDrift will refuse to load a file specifying format version 3 if VDrift's code only supports version 2.<br />
<br />
==Steering==<br />
<pre><br />
max-angle = 33.19<br />
</pre><br />
This defines the maximum angle that the wheels will turn in each direction. For the XS, when the steering wheel is full left, the wheels would be at -33.19 degrees.<br />
<br />
==Engine==<br />
<pre><br />
position = 0.86, 0.0, -0.21<br />
mass = 140.0<br />
max-power = 1.79e5<br />
peak-engine-rpm = 7800.0<br />
rpm-limit = 9000.0<br />
inertia = 0.25<br />
idle = 0.02<br />
start-rpm = 1000<br />
stall-rpm = 350<br />
fuel-consumption = 1e-9<br />
torque-friction = 0.0003<br />
torque-curve-00 = 1000, 140.0<br />
torque-curve-01 = 2000, 149.14<br />
torque-curve-02 = 2200, 145.07<br />
torque-curve-03 = 2500, 147.78<br />
torque-curve-04 = 3000, 169.50<br />
torque-curve-05 = 3300, 172.19<br />
torque-curve-06 = 4000, 169.50<br />
torque-curve-07 = 4500, 166.77<br />
torque-curve-08 = 5600, 172.19<br />
torque-curve-09 = 5800, 170.83<br />
torque-curve-10 = 6000, 168.12<br />
torque-curve-11 = 6100, 177.61<br />
torque-curve-12 = 6200, 186.42<br />
torque-curve-13 = 6300, 192.53<br />
torque-curve-14 = 6500, 195.92<br />
torque-curve-15 = 6700, 195.92<br />
torque-curve-16 = 7000, 195.24<br />
torque-curve-17 = 7600, 190.49<br />
torque-curve-18 = 8000, 184.39<br />
torque-curve-19 = 8200, 183.04<br />
torque-curve-20 = 8300, 146.43<br />
torque-curve-21 = 9500, 146.43<br />
</pre><br />
The position and mass parameters affect the weight distribution of the car. The torque curve is calculated from max-power and peak-engine-rpm using a polynomial expression given in Motor Vehicle Dynamics, Genta (1997), where peak-engine-rpm is the engine speed at which the maximum power output (max-power) is achieved. Alternatively, the torque curve can be explicitly defined, as in the example above. A rev limit can be set with rpm-limit. The rotational inertia of the moving parts is inertia. idle is the throttle position at idle. Starting the engine initially sets the engine speed to start-rpm. Letting the engine speed drop below stall-rpm makes the engine stall. The rate of fuel consumption is set with fuel-consumption. The actual fuel consumed each second (in units of liters) is the fuel-consumption parameter times RPM times throttle (throttle is from 0.0 to 1.0, where 1.0 is full throttle).<br />
<br />
==Clutch==<br />
<pre><br />
sliding = 0.27<br />
radius = 0.15<br />
area = 0.75<br />
max-pressure = 11079.26<br />
</pre><br />
The clutch is described by its sliding friction coefficient, radius, area and maximum applied pressure. The torque capacity(maximum transmitted torque) of the clutch is TC = sliding * radius * area * max-pressure. It should be somewhere between one and two times the maximum enine torque. TC = 1.25 * max-engine-torque is a good start value.<br />
<br />
==Transmission==<br />
<pre><br />
gears = 6<br />
gear-ratio-r = -2.8<br />
gear-ratio-1 = 3.133<br />
gear-ratio-2 = 2.045<br />
gear-ratio-3 = 1.481<br />
gear-ratio-4 = 1.161<br />
gear-ratio-5 = 0.943<br />
gear-ratio-6 = 0.763<br />
shift-time = 0.2<br />
</pre><br />
The number of forward gears is set with the gears parameter. The gear ration for reverse and all of the forward gears is then defined. The shift-time tag tells how long it takes, in total seconds, to change gears (when autoclutch is enabled). Half the time is spent changing the gear and the other half is spent letting the clutch out. This parameter is not required and defaults to 0.2 seconds, which is a reasonable value for a manual transmission. F1 cars take about 50 ms, by comparison.<br />
<br />
==Differential==<br />
<pre><br />
final-drive = 4.100<br />
anti-slip = 600.0<br />
anti-slip-torque = 1<br />
anti-slip-torque-deceleration-factor = 0<br />
</pre><br />
The final drive provides an additional gear reduction. The anti-slip parameter defines the maximum anti-slip torque. For speed-sensitive differentials, it also defines the anti-slip torque per radian per second of speed difference between the wheels. If the differential is speed-sensitive, the anti-slip-torque and anti-slip-torque-deceleration-factor parameters must be omitted or set to zero. If the differential is torque-sensitive, then anti-slip-torque defines the amount of anti-slip torque per input torque. The anti-slip-torque-deceleration-factor defines the amount of anti-slip torque per negative input torque. For a 1-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to zero, for a 2-way torque-sensitive LSD, set anti-slip-torque-deceleration-factor to 1.0, for 1.5-way, set it between 0.0 and 1.0.<br />
<br />
==Fuel tank==<br />
<pre><br />
position = -0.8, -0.1, -0.26<br />
capacity = 0.0492<br />
volume = 0.0492<br />
fuel-density = 730.0<br />
</pre><br />
The fuel tank's position, the current volume of fuel and the density of the fuel affect the car's weight distribution. The capacity tag sets the maximum volume of fuel that the tank can hold. The initial volume is set with the volume tag. The density of the fuel is set with fuel-density.<br />
<br />
==Suspension==<br />
Front/rear parameters are broken into two fields. Per-wheel parameters are broken into four fields. In the example below the front suspension is shown, followed by the front left wheel suspension parameters.<br />
<pre><br />
[ suspension-front ]<br />
spring-constant = 49131.9<br />
spring-factor-1 = 0.052, 1.0<br />
spring-factor-2 = 0.055, 1.2<br />
bounce = 2588<br />
rebound = 2612<br />
damper-factor-1 = 0.08,1.0<br />
damper-factor-2 = 0.1, 0.7<br />
travel = 0.19<br />
camber = -1.33<br />
caster = 6.12<br />
toe = 0.0<br />
anti-roll = 8000.0<br />
</pre><br />
<pre><br />
[ suspension-FL ]<br />
hinge = 0,0,0<br />
</pre><br />
The spring-constant is the '''wheel rate''' in N/m. The spring-factor-1 and 2 parameters define a curve for the spring response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is the suspension displacement in meters and y is the factor to be applied to the spring coefficient. In this example, the spring factor will be 1.0 when the displacement is between 0 and 0.052 m, and then the spring factor will change linearly to 1.2 at 0.055 m (and beyond). The spring factor gets multiplied by the spring-constant. You can put as many spring-factor points as you want (just increase the spring-factor- number for each additional point). Note that displacement values are relative to the "zero g", "zero force" position. For best results, start VDrift with the -debug option and observe suspension displacements during maneuvering to determine where you want to put your points.<br />
<br />
The bounce and rebound parameters are the damping coefficients for compression and expansion of the suspension, respectively, in units of N/m/s. The damper-factor-1 and 2 parameters define a curve for the damper response. These can be omitted if desired, in which case a factor of 1.0 will be used everywhere. Points are defined by specifying an x,y pair where x is an absolute value of suspension velocity in m/s and y is the factor to be applied to the damping coefficient. In this example, the damper factor will be 1.0 when the compression velocity absolute value is between 0 and 0.08 m/s, and then the damper factor will change linearly to 0.7 at 0.1 m/s (and beyond). The damper factor gets applied to the bonce or rebound damper coefficient, depending on the direction of travel. You can put as many damper-factor points as you want (just increase the damper-factor- number for each additional point).<br />
<br />
The hinge is the center of the wheel's path as the suspension moves. The location of the hinge is determined by suspension geometry, and may be outside of the car itself.<br />
<br />
Wheel alignment is set with the camber, caster, and toe tags. All angles are in degrees.<br />
<br />
Note that the suspension position parameter and the max-compression-velocity parameters are no longer used and can be omitted.<br />
<br />
==Tire==<br />
Front/rear parameters are broken into two fields. In the example below the front tire section is shown.<br />
<pre><br />
radius = 0.29<br />
rolling-resistance = 1.3e-2, 6.5e-6<br />
rotational-inertia = 10.0<br />
tread = 0.0<br />
# Lateral force<br />
a0=1.6<br />
a1=-38<br />
a2=1201<br />
a3=1914<br />
a4=8.7<br />
a5=0.014<br />
a6=-0.24<br />
a7=1.0<br />
a8=-0.03<br />
a9=-0.0013<br />
a10=-0.15<br />
a111=-8.5<br />
a112=-0.29<br />
a12=17.8<br />
a13=-2.4<br />
# Longitudinal force<br />
b0=1.7<br />
b1=-80<br />
b2=1571<br />
b3=23.3<br />
b4=300<br />
b5=0<br />
b6=0.0068<br />
b7=0.055<br />
b8=-0.024<br />
b9=0.014<br />
b10=0.26<br />
b11=-86<br />
b12=350<br />
# Aligning moment<br />
c0=2.3<br />
c1=-3.8<br />
c2=-3.14<br />
c3=-1.16<br />
c4=-7.2<br />
c5=0.0<br />
c6=0.0<br />
c7=0.044<br />
c8=-0.58<br />
c9=0.18<br />
c10=0.043<br />
c11=0.048<br />
c12=-0.0035<br />
c13=-0.18<br />
c14=0.14<br />
c15=-1.029<br />
c16=0.27<br />
c17=-1.1<br />
</pre><br />
The two elements of rolling-resistance are the constant and velocity-squared terms, respectively. Radius defines the radius of the tire. The tread parameter ranges over arbitrary values of 0.0 to 1.0, where 0.0 is a road tire and 1.0 is an off-road tire. The longitudinal, transverse, and aligning section each contain a vector of “magic formula” coefficients as presented in Motor Vehicle Dynamics, Genta (1997). A description is shown below:<br />
<pre><br />
Shape factor ........................................... A0<br />
Load infl. on lat. friction coeff (*1000)... (1/kN) .... A1<br />
Lateral friction coefficient at load = 0 (*1000) ....... A2<br />
Maximum stiffness ........................ (N/deg) ..... A3<br />
Load at maximum stiffness ................ (kN) ........ A4<br />
Camber infiuence on stiffness ............ (%/deg/100) . A5<br />
Curvature change with load ............................. A6<br />
Curvature at load = 0 .................................. A7<br />
Horizontal shift because of camber ........(deg/deg).... A8<br />
Load influence on horizontal shift ........(deg/kN)..... A9<br />
Horizontal shift at load = 0 ..............(deg)........ A10<br />
Camber influence on vertical shift ........(N/deg/kN)... A111<br />
Camber influence on vertical shift ........(N/deg/kN**2) A112<br />
Load influence on vertical shift ..........(N/kN)....... A12<br />
Vertical shift at load = 0 ................(N).......... A13<br />
<br />
Shape factor ........................................... B0<br />
Load infl. on long. friction coeff (*1000)... (1/kN) ... B1<br />
Longitudinal friction coefficient at load = 0 (*1000)... B2<br />
Curvature factor of stiffness ............ (N/%/kN**2) . B3<br />
Change of stiffness with load at load = 0 (N/%/kN) ..... B4<br />
Change of progressivity of stiffness/load (1/kN) ....... B5<br />
Curvature change with load ............................. B6<br />
Curvature change with load ............................. B7<br />
Curvature at load = 0 .................................. B8<br />
Load influence on horizontal shift ....... (%/kN) ...... B9<br />
Horizontal shift at load = 0 ............. (%) ......... B10<br />
Load influence on vertical shift ......... (N/kN) ...... B11<br />
Vertical shift at load = 0 ............... (N) ......... B12<br />
<br />
Shape factor ........................................... C0<br />
Load influence of peak value ............ (Nm/kN**2) ... C1<br />
Load influence of peak value ............ (Nm/kN) ...... C2<br />
Curvature factor of stiffness ........... (Nm/deg/kN**2) C3<br />
Change of stiffness with load at load = 0 (Nm/deg/kN) .. C4<br />
Change of progressivity of stiffness/load (1/kN) ....... C5<br />
Camber influence on stiffness ........... (%/deg/100) .. C6<br />
Curvature change with load ............................. C7<br />
Curvature change with load ............................. C8<br />
Curvature at load = 0 .................................. C9<br />
Camber influence of stiffness .......................... C10<br />
Camber influence on horizontal shift......(deg/deg)..... C11<br />
Load influence on horizontal shift........(deg/kN)...... C12<br />
Horizontal shift at load = 0..............(deg)......... C13<br />
Camber influence on vertical shift........(Nm/deg/kN**2) C14<br />
Camber influence on vertical shift........(Nm/deg/kN)... C15<br />
Load influence on vertical shift..........(Nm/kN)....... C16<br />
Vertical shift at load = 0................(Nm).......... C17<br />
</pre><br />
More information can be found at http://members.xoom.virgilio.it/adiaforo/epcjk.htm or if it's down try http://web.archive.org/web/20050913052226/http://members.xoom.virgilio.it/adiaforo/epcjk.htm<br />
<br />
==Brakes==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
friction = 0.73<br />
max-pressure = 4.0e6<br />
bias = 0.60<br />
radius = 0.14<br />
area = 0.015<br />
</pre><br />
The bias parameter is the fraction of braking pressure applied to the front brakes (in the front brake section) or the rear brakes (in the rear brake section). To make sense, the rear value should equal 1.0 minus the front value. The maximum brake torque is calculated as friction * area * bias * max-pressure * radius. Some fraction of this value is applied based on the brake pedal.<br />
<br />
==Driver==<br />
<pre><br />
position = -0.62, -0.35, -0.12<br />
mass = 90.0<br />
view-position = -0.64, 0.35, 0.30<br />
hood-mounted-view-position = 0.55, 0, 0.17<br />
view-stiffness = 0.0<br />
</pre><br />
The position and mass affect the weight distribution of the car. The view positions define 3D coordinates for camera placement. The view-stiffness parameter defines the stiffness of the camera bounce effect, where 0.0 is a sports car and 1.0 is F1-ish.<br />
<br />
==Drag==<br />
<pre><br />
position = 0.0, 0.0, 0.2<br />
frontal-area = 2<br />
drag-coefficient = 0.3<br />
</pre><br />
The frontal area and coefficient of drag, set with frontal-area and drag-coefficient, are used to calculate the drag force.<br />
<br />
==Wing==<br />
Front/rear parameters are broken into two fields. In the example below the front section is shown.<br />
<pre><br />
position = 1.9, 0.0, 0.60<br />
frontal-area = 0.2<br />
drag-coefficient = 0.0<br />
surface-area = 0.3<br />
lift-coefficient = -0.5<br />
efficiency = 0.95<br />
</pre><br />
Downforce can be added with wings. The amount of downforce is determined by the value in the lift-coefficient tag. If the lift coefficient is positive, upforce is generated. This is usually undesirable for cars. The efficiency determines how much drag is added as downforce increases. The surface-area is the surface area of the wing. This value is also used in the drag calculation.<br />
<br />
==Wheel==<br />
Per-wheel parameters are broken into four fields. In the example below the front left wheel is shown.<br />
<pre><br />
position = 1.14, 0.76, -0.47<br />
roll-height = 0.29<br />
mass = 18.14<br />
restitution = 0.1<br />
</pre><br />
<br />
==Contact-points==<br />
<pre><br />
mass = 0.05<br />
position-00 = 1.96, 0.37, -0.24<br />
position-01 = 1.96, -0.37, -0.24<br />
position-02 = 1.52, 0.83, 0.16<br />
position-03 = 1.52, -0.83, 0.16<br />
position-04 = -0.10, 0.89, -0.24<br />
position-05 = -0.10, -0.89, -0.24<br />
position-06 = -2.18, -0.83, -0.10<br />
position-07 = -2.18, 0.83, -0.10<br />
</pre><br />
These values are used for weight distribution and balance only. They no longer perform any contact-related function. So, contact-points are the same as particles (defined below), but the syntax is slightly different.<br />
<br />
==Particle==<br />
These parameters are broken into a series of values starting at 00 and going to some number less than 100. The particle-00 is shown below.<br />
<pre><br />
mass = 30.0<br />
position = -1.28, 0.0, -0.36<br />
</pre><br />
These values are used for weight distribution and balance.<br />
<br />
[[Category:Cars]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Importing_Racer_tracks&diff=1259Importing Racer tracks2012-09-01T10:48:59Z<p>Timo 6: Update categories</p>
<hr />
<div>==Directions for importing Racer tracks==<br />
{{note|These instructions are meant for Linux}}<br />
<br />
* Unzip and put racer files in temporary folder ''RACER_TP'' (temporary track path). Make sure the path has no spaces (dof2joe doesn't like spaces).<br />
* Create new folder for track in track editor folder ''TRACKEDITOR_TP''.<br />
* Convert all texture names to lowercase in ''RACER_TP'' via<br />
find . -type f -name \*.tga|sort -r|awk '{f=tolower($1);<br />
if(f!=$1 && p[f]!=1){print "mv "$1" "f}p[$1]=1}' | /bin/sh<br />
* Make folder '''''TRACKEDITOR_TP''/objects/'''<br />
* Run the following command:<br />
dof2joe/dof2joe -p TRACKEDITOR_TP/objects/ RACER_TP/*.dof<br />
If there are thousands of .dof files, you may have to do this in steps to avoid a "too many arguments" error from your shell. This will take a while. Textures are automatically converted using nconvert. No filenames should have spaces.<br />
* Open track editor '''data/tracks/editor.config''' and set active track to ''TRACKEDITOR_TP''.<br />
* Run the track editor. Trace the roadways and mark the starting position (press H for help).<br />
* cd to the '''''TRACKEDITOR_TP''/objects''' folder (this is important, the packfile stores relative paths) and run<br />
joepack/joepack -c objects.jpk *.joe<br />
* Copy ''TRACKEDITOR_TP'' into the main VDrift tracks folder ''VDRIFT_TP''. Erase '''''VDRIFT_TP''/objects/*.joe''' (since they are in the pack file).<br />
* Add '''''VDRIFT_TP''/about.txt''' and ensure that the first line is the name of the track.<br />
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.<br />
* Add the track selection screenshot to '''''VDRIFT_TP''/trackshot.png''' (hopefully these png files will be moved into the folders of the individual tracks soon).<br />
* Open up all of the texture files in '''''TRACKEDITOR_TP''/objects''' and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects should not be mipmapped), or be skyboxes.<br />
* Any textures that have transparent areas are usually colored #FF00FF in the Racer textures. You'll need to make these truly transparent in the PNG files. An easy way to do this is to use ImageMagick. Use the commands<br />
mogrify -transparent rgb\(255,0,255\) *.png<br />
mogrify -fill rgb\(128,128,128\) -opaque rgba\(255,0,255,0\) *.png<br />
This can be scripted to speed things up of course.<br />
* Set the correct object properties using the '''trackeditor/listedit''' [[Listedit tool]].<br />
* Done!<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Creating_tracks&diff=1258Creating tracks2012-09-01T10:48:30Z<p>Timo 6: Formatting style updates</p>
<hr />
<div>==Video Tutorial==<br />
NaN has produced this nifty video tutorial (Windows, but mostly applicable to Linux too): http://www.youtube.com/watch?v=oju-vKVVaho<br />
<br />
==What you need==<br />
* VDrift<br />
* VDrift level editor<br />
* Blender 2.33 or higher. Tested on 2.45 with Python 2.5.1<br />
* Blender JOE export script. Get that here: https://github.com/VDrift/blender-scripts<br />
Get the '''export-all-joe-0.3.py''' script. The difference in the files is that one exports all the object in the scene and the other only exports the one that is selected.<br />
<br />
==Getting the level editor==<br />
In the Linux console, copy ''everything'' below:<br />
git clone https://github.com/VDrift/trackeditor vdrift-trackeditor<br />
<br />
==Directions for creating tracks==<br />
* Model the scene. See [[3D modeling]] for resources to help with this step.<br />
* If you use a 3D editor other than blender, import the track into blender.<br />
* Use the '''export-all-joe-0.3.py''' blender export script to export all objects. This script can be found in the VDrift art repository under the tools folder. The export script creates a number of '''.joe''' files and a '''list.txt''' file. The '''list.txt''' file may be named '''somename-list.txt''', in which case you should rename it to '''list.txt'''. At least one '''.joe''' file should get created for the curve track. Also verify that '''list.txt''' is mentioning all the '''.joe''' files. An empty '''list.txt''' will not load anything in the editor.<br />
* Create new folder for track in track editor folder ''TRACKEDITOR_TP'' (if your track is called parkinglot, the path could be '''/home/joe/trackeditor/data/tracks/parkinglot''').<br />
* Make folder '''''TRACKEDITOR_TP''/objects/'''<br />
* Copy all of the '''.joe''' files and the '''list.txt''' file to '''''TRACKEDITOR_TP''/objects/'''<br />
* Open track editor '''data/tracks/editor.config''' and set active track to ''TRACKEDITOR_TP''.<br />
* Create a '''''TRACKEDITOR_TP''/track.txt'' file with at least a line "cull faces = on". '''track.txt''' is modified by track editor to add all starting positions and lap sequence points. Read the track editor inhelp for more information.<br />
* Run the track editor. Trace the roadways and mark the starting position (press H for help). A track may not always appear on the screen. Move the mouse around and you could see it in the black space. The first time, check the console output of track editor for any warnings.<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''Why trace roadways?'''<br />
[[Image:Track-smoothing.png]]<br />
This is a visual depiction of the track smoothing that occurs when tracing a roadway. Imagine this image is showing the track surface from a side view. The black lines represent the track mesh, and the red lines represent the bezier patches. Once the track has been traced in the track editor, VDrift will use the red lines to do collision instead of the black lines. On the top, this represents a dip in the road. You can see how collision using the red line will behave properly. On the bottom, this represents a bump road. You can see that the red line doesn't change the magnitude of the bumps, it just makes them realistically smooth instead of unrealistically pointy.<br />
|}<br />
* <code>cd</code> to the '''trackeditor/joepack''' folder. Compile the joepack tool by running<br />
scons<br />
* <code>cd</code> to the '''''TRACKEDITOR_TP''/objects''' folder (this is important, the packfile stores relative paths) and run<br />
/path/to/trackeditor/joepack/joepack -c objects.jpk *.joe<br />
* If you want, this command will show you the files in the joepack to allow you to verify the previous step worked correctly:<br />
/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk<br />
* Copy ''TRACKEDITOR_TP'' into the main VDrift tracks folder ''VDRIFT_TP'' (for example '''/home/joe/vdrift/data/tracks/parkinglot'''). Erase '''''VDRIFT_TP''/objects/*.joe''' since they are all in the pack file now.<br />
* Add '''''VDRIFT_TP''/about.txt''' and ensure that the first line is the name of the track. You should put information about the track author, where the track came from, etc in the second line and on.<br />
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.<br />
* Create a track selection image (a 512x512 png file works best) and save it to '''''VDRIFT_TP''/trackshot.png'''<br />
* Open up all of the texture files in '''''TRACKEDITOR_TP''/objects''' and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects sometimes look better when not mipmapped), or be skyboxes.<br />
* Set the correct object properties using the '''trackeditor/listedit''' tool (more documentation to come).<br />
* Done!<br />
<br />
==Other Notes==<br />
* A track should be of a minimum size for loading within VDrift. If the editor is not allowing to adjust the camera poistions correctly, probably the track is very small. Scale everything in the blender twice or more and try again. <br />
* Starting points are set within the track editor. After the track is loaded, position the track like you were in the car on the track i.e. first person view. Press L to save the position as a starting position. Continue to add positions depending on your track. Also add a lap sequence i.e. lap starting/ending point track.<br />
* Track editor does not paint or mark the starting points or lap sequence numbers on the track. These are only saved in track.txt. Also, the editor will always continue adding more starting positions if track.txt had some already. Therefore, consider deleting everything in '''track.txt''' if you wish to reedit the positions.<br />
* A .joe file gets created when the track has a texture.<br />
* The export-joe script should be loaded within blender along with the track, and executed.<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Creating_tracks&diff=1257Creating tracks2012-09-01T10:40:26Z<p>Timo 6: Update categories</p>
<hr />
<div>==Video Tutorial==<br />
NaN has produced this nifty video tutorial (Windows, but mostly applicable to Linux too): http://www.youtube.com/watch?v=oju-vKVVaho<br />
<br />
==What you need==<br />
* VDrift<br />
* VDrift level editor<br />
* Blender 2.33 or higher. Tested on 2.45 with Python 2.5.1<br />
* Blender JOE export script. Get that here: https://github.com/VDrift/blender-scripts<br />
Get the "export-all-joe-0.3.py" script. The difference in the files is that one exports all the object in the scene and the other only exports the one that is selected.<br />
<br />
==Getting the level editor==<br />
In the Linux console, copy ''everything'' below:<br />
git clone https://github.com/VDrift/trackeditor vdrift-trackeditor<br />
<br />
==Directions for creating tracks==<br />
* Model the scene. See the [[track modeling tutorial]] for help with this step.<br />
* If you use a 3d editor other than blender, import the track into blender.<br />
* Use the export-all-joe-0.3.py blender export script to export all objects. This script can be found in the VDrift art repository under the tools folder. The export script creates a number of .joe files and a list.txt file. The list.txt file may be named somename-list.txt, in which case you should rename it to list.txt. At least one .joe file should get created for the curve track. Also verify that list.txt is mentioning all the .joe files. An empty list.txt will not load anything in the editor.<br />
* Create new folder for track in track editor folder TRACKEDITOR_TP (if your track is called parkinglot, the path could be /home/joe/VDrift-trackeditor/data/tracks/parkinglot).<br />
* Make folder TRACKEDITOR_TP/objects/<br />
* Copy all of the .joe files and the list.txt file to TRACKEDITOR_TP/objects/<br />
* Open track editor data/tracks/editor.config and set active track to TRACKEDITOR_TP.<br />
* Create a TRACKEDITOR_TP/track.txt file with at least a line "cull faces = on". track.txt is modified by track editor to add all starting positions and lap sequence points. Read the track editor inhelp for more information.<br />
* Run the track editor. Trace the roadways and mark the starting position (press H for help). A track may not always appear on the screen. Move the mouse around and you could see it in the black space. The first time, check the console output of track editor for any warnings.<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''Why trace roadways?'''<br />
[[Image:Track-smoothing.png]]<br />
This is a visual depiction of the track smoothing that occurs when tracing a roadway. Imagine this image is showing the track surface from a side view. The black lines represent the track mesh, and the red lines represent the bezier patches. Once the track has been traced in the track editor, VDrift will use the red lines to do collision instead of the black lines. On the top, this represents a dip in the road. You can see how collision using the red line will behave properly. On the bottom, this represents a bump road. You can see that the red line doesn't change the magnitude of the bumps, it just makes them realistically smooth instead of unrealistically pointy.<br />
|}<br />
* CD to the VDrift-trackeditor/joepack folder. Compile the joepack tool by running<br />
scons<br />
* CD to the TRACKEDITOR_TP/objects folder (this is important, the packfile stores relative paths) and run<br />
/path/to/VDrift-trackeditor/joepack/joepack -c objects.jpk *.joe<br />
* If you want, this command will show you the files in the joepack to allow you to verify the previous step worked correctly:<br />
/path/to/VDrift-trackeditor/joepack/joepack -l objects.jpk<br />
* Copy TRACKEDITOR_TP into the main VDrift tracks folder VDRIFT_TP (for example /home/joe/VDrift/data/tracks/parkinglot). Erase VDRIFT_TP/objects/*.joe since they are all in the pack file now.<br />
* Add VDRIFT_TP/about.txt and ensure that the first line is the name of the track. You should put information about the track author, where the track came from, etc in the second line and on.<br />
* Run VDrift and check out what the track looks like in-game. Note that you will only be able to drive on the roadways you defined in the track editor since no other surfaces have been flagged as collideable. Also take a screenshot for the track selection screen.<br />
* Create a track selection image (a 512x512 png file works best) and save it to VDRIFT_TP/trackshot.png<br />
* Open up all of the texture files in TRACKEDITOR_TP/objects and review which textures belong to objects that should be collide-able (roads and walls), have full brightness (trees), be mipmapped (fences and fine transparent objects sometimes look better when not mipmapped), or be skyboxes.<br />
* Set the correct object properties using the VDrift-tracked/listedit tool (more documentation to come).<br />
* Done!<br />
<br />
==Other Notes==<br />
* A track should be of a minimum size for loading within vdrift game. If the editor is not allowing to adjust the camera poistions correctly, probably the track is very small. Scale everything in the blender twice or more and try again. <br />
* Starting points are set within the track editor. After the track is loaded, position the track like you were in the car on the track i.e. first person view. Press L to save the position as a starting position. Continue to add positions depending on your track. Also add a lap sequence i.e. lap starting/ending point track.<br />
* Track editor does not paint or mark the starting points or lap sequence numbers on the track. These are only saved in track.txt. Also, the editor will always continue adding more starting positions if track.txt had some already. Therefore, consider deleting everything in track.txt if you wish to reedit the positions.<br />
* A .joe file gets created when the track has a texture.<br />
* The export-joe script should be loaded within blender along with the track, and executed.<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Track_files_and_formats&diff=1256Track files and formats2012-09-01T10:39:14Z<p>Timo 6: Add category</p>
<hr />
<div>VDrift's tracks are composed of 3D-modeled objects in .JOE format, PNG graphic files for textures, and text files describing the objects and track.<br />
<br />
==Files==<br />
The files that define each track are within the '''data/tracks/''trackname''/''' directory, where ''trackname'' is the "short name" of the track.<br />
<br />
===about.txt===<br />
Simple text file with the track's full name as the first line. Credits may be on following lines.<br />
<br />
===roads.trk===<br />
This file defines the road surface for the track. It is generated by the [[Creating tracks|track editor]]. Following is the format of this file:<br />
<br />
<number_of_roads><br />
<number_of_Bezier_patches_for_the_1st_road><br />
Control point coordinates of Bezier patch 1 (total 16 points)<br />
Control point coordinates of Bezier patch 2 (total 16 points)<br />
.<br />
.<br />
.<br />
.<br />
<number_of_Bezier_patches_for_the_2nd_road><br />
Control point coordinates of Bezier patch 1 (total 16 points)<br />
Control point coordinates of Bezier patch 2 (total 16 points)<br />
.<br />
.<br />
.<br />
.<br />
<and so on><br />
<br />
===trackshot.png===<br />
This is a 512x512 PNG graphic file that is displayed in the menu when selecting the track to race on.<br />
<br />
===track.txt===<br />
This file defines various track parameters. This file is in VDrift's [[Configfile format]].<br />
<br />
===objects/*.png===<br />
The PNG files have names corresponding to the object they belong to. These are the textures for the 3D model objects that make up the track.<br />
<br />
===objects/list.txt===<br />
This is a plain text file that defines the relationship between objects and textures, and also sets object properties. It is generated and edited with the [[Listedit tool]] which is part of the [[Track editor]] tools.<br />
<br />
A description of each field in the list.txt file can be found at the following location: http://svn.vdrift.net/viewvc.cgi/trunk/listedit/format.txt?root=VDrift+Track+Editor&view=co<br />
<br />
===objects/objects.jpk===<br />
This file contains all the files that define the 3D models for the objects that make up the track. It is in the [[JOEPack format]], which contains many files in the [[JOE format]].<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Getting_tracks&diff=1255Getting tracks2012-09-01T10:37:48Z<p>Timo 6: Formatting style updates</p>
<hr />
<div>A small selection of tracks are distributed in the release VDrift packages. This page describes how to get some more. <br />
<br />
==List of tracks==<br />
The following cars are in the [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data data repository] of VDrift.<br />
<br />
<div style="column-count:3;-moz-column-count:3;-webkit-column-count:3"><br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/a1ring/ A1 Ring]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/bahrain/ Bahrain]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/barcelona/ Barcelona]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/brands/ Brands Hatch]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/charade70/ Charade 1970]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/detroit/ Detroit]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/dijon/ Dijon-Prenois]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/dirt-3/ Australian Countryside]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/estoril88/ Estoril 1988]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/fuji/ Fuji]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/hockenheim/ Hockenheim]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/hungaroring06/ Hungaroring 2006]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/imola2005/ Imola 2005]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/indianhill/ Indian Hill]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/interlagos/ Interlagos]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/jarama/ Jarama]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/jerez88/ Jerez 1988]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/kyalami/ Kyalami]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/laconca/ La Conca]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/lagunaseca/ Laguna Seca]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/lemans/ Le Mans]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/magny/ Magny]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/melbourne/ Melbourne]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/monaco/ Monaco]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/monaco88/ Monaco 1988]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/montreal/ Montreal]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/monza/ Monza]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/monza88/ Monza 1988]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/mosport/ Mosport]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/nuerburgring_nordschleife/ Nürburgring Nordschleife]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/parkinglot/ Parking Lot]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/parkinglot/ Pau]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/paulricard88/ Paul Ricard 1988]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/ring2007/ Nürburgring Nordschleife 2007]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/road_atlanta/ Road Atlanta]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/rouen/ Rouen]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/ruudskogen/ Ruudskogen]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/sepang/ Sepang]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/singapore/ Singapore]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/spa/ Spa-Francorchamps]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/spa2008/ Spa-Francorchamps 2008]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/suzuka2005/ Suzuka 2005]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/vir/ Virgina International]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/wackersdorf/ Wackersdorf]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/weekend/ Weekend Drive]<br />
* [http://vdrift.svn.sourceforge.net/viewvc/vdrift/vdrift-data/tracks/zandvoort/ Zandvoort]<br />
</div><br />
<br />
==Downloading==<br />
Click the links in the list above then click the "Download GNU Tarball" link near the bottom of the page.<br />
<br />
==Installing==<br />
Uncompress the .tar.gz file. This should create a folder with the name of the track containing files like '''about.txt''' and '''roads.trk'''. Move that folder to '''vdrift/data/tracks''' folder. Run VDrift and your new track will be ready for racing!<br />
<br />
==Updating==<br />
You can update tracks from within VDrift itself. Go to Updates -> Check for updates. If any are available go Back -> Manage Tracks, select the track to update and click "Download".<br />
<br />
==See also==<br />
* [[Getting cars]]<br />
<br />
[[Category:Tracks]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Menu_system&diff=1254Menu system2012-09-01T10:34:38Z<p>Timo 6: Update categories</p>
<hr />
<div>The menus are defined by text files in the '''data/skins/''skin_name''/menus/''' directories, where ''skin_name'' is the name of one of the skins [[Skin system]]. The menus are defined in text files in the [[Configfile format]]. Each of the menu "pages" contains a number of menu "widgets", which have a variety of functions.<br />
<br />
The menu system was designed to be used with any type of controller. Every action may be triggered by a simple button push, except things like text entry. Users should be able to choose if they wish to point and click with the mouse, use the keyboard's arrow keys, or joystick axes and buttons. Keep this in mind when designing or editing menu pages.<br />
<br />
Other guidelines for menu writing include:<br />
* Try to keep the layouts similar to other menus in the skin.<br />
* Keep the menus simple and break them up into subgroups where possible.<br />
* Put the most used functions closer to the main menu, and the lesser used things in deeper submenus.<br />
* Do not put too many widgets on any one page.<br />
* Always check to make sure navigating a menus with the keyboard works in the order expected.<br />
<br />
==Adding Menus==<br />
To add a new menu, simply create a new text file under '''data/skins/''skin_name''/menus/''' with the name of the file the same as the name of the menu in camelcase.<br />
<br />
===Writing a Menu===<br />
Now you need to define the new menu. Let's look at the Options menu. The game needs to know a little about the menu itself, so the first few lines of every menu look something like this:<br />
name = Options<br />
widgets = 5<br />
background = gui/box.png<br />
dialog = false<br />
The <code>name</code> field should be the same as the filename. The <code>widgets</code> field tells the game how many widgets to load from this menu file (it starts at 0, and stops at <code>widgets - 1</code>). The <code>background</code> field tells the game which graphic to use as the menu background. The <code>dialog</code> tells the game if this is a dialog box or not, but right now this option has no effect (dialog boxes are drawn as full size menus).<br />
<br />
===Adding Widgets===<br />
Next, you will need to add some widget definitions to your menu.<br />
<br />
Here's the format for a label widget, this example taken from the Options menu:<br />
[ widget-00 ]<br />
type = label<br />
name = OptionsLabel<br />
text = Options<br />
center = 0.5, 0.1<br />
width = auto<br />
height = auto<br />
fontsize = 9<br />
enabled = 0<br />
selected = 0<br />
default = 0<br />
cancel = 0<br />
<br />
The first line is the widget ID. This is the identification number of this widget on this menu page. The number also dictates the order in which the menu will be traversed if you use the arrow keys to move through it. The <code>type</code> field tells VDrift what kind of widget it is. <code>name</code> is a non-numeric identifier. <code>text</code> is the text that will appear on the label. <code>center</code> is the relative position of the widget on the screen. <code>width</code> and <code>height</code> are the relative width and height of the label (here we tell VDrift to figure it out automatically, this is generally a good idea). <code>fontsize</code> is the size to draw the text, the value 9 is pretty big, which is good because this label is the menu title.<br />
<br />
The next values, <code>enabled</code>, <code>selected</code>, <code>default</code>, and <code>cancel</code>, are boolean values. These are available in every widget and tell how the user can interact with it. <code>enabled</code> allows the user to use the widget. A label has no function so in this case it is turned off. <code>selected</code> indicates if this item should be the one selected when the menu is displayed for the first time. Since a user can't use a label, it shouldn't be selected, so this is off too. <code>default</code> is usually used for OK buttons, or buttons that need to trigger saving all the values on the page when they're pressed. <code>cancel</code> is for Cancel buttons and indicates if this is the button to be pressed when Escape is pressed on this menu, and discards any changes made on the menu.<br />
<br />
===Making the Menus Accessible from Other Menus===<br />
Navigation through the menu system is done using buttons. Let's say for example you are creating a menu called GameOptions which will allow users to change certain aspects of the gameplay (perhaps such as difficulty level). This menu would be accessed from the existing Options menu. So you'll need to add a button for GameOptions to the Options menu. Here's an example button widget that could do this.<br />
[ widget-01 ]<br />
type = button<br />
name = GameOptionsButton<br />
text = Game<br />
tip = Change game settings.<br />
action = GameOptions<br />
center = 0.5, 0.3<br />
color = 0.0, 0.0, 0.8<br />
width = auto<br />
height = auto<br />
fontsize = 7<br />
enabled = 1<br />
selected = 1<br />
default = 0<br />
cancel = 0<br />
The first thing you notice is all the properties it shares with the label widget. In this case let's say the button is now the first one on the Options menu. The <code>type</code> is now "button" appropriately. Some new options available to a button are: <code>tip</code>, which shows a description of the widget at the bottom of the screen; <code>action</code>, which dictates what happens when the button is pressed (in this case the name of the menu to go to, in other cases, a special function name that tells the game to do something); and finally <code>color</code>, which allows you to change the color of the text in %R, %G, %B format. This particular button has 80% blue text. <br />
<br />
Take a look at some of the existing menu entries for more examples.<br />
<br />
==Warning==<br />
The menu system is still a little light on the error checking. Therefore care must be taken when writing menus or editing them that you don't miss something, or the menu may not work at all, may be unreachable or inescapable, or may even cause the game to crash.<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Configfile_format&diff=1253Configfile format2012-09-01T10:34:13Z<p>Timo 6: Update categories</p>
<hr />
<div>Many of VDrift's text-based data and configuration files are written in a format native to the game. The format is designed to be simple and easy to read, while flexibly storing many different kinds of data. It allows settings to be categorized into sections.<br />
<br />
This format is defined by the ''CONFIG'' class in '''include/config.h''' and '''src/config.cpp'''.<br />
<br />
==Features==<br />
===Encoding===<br />
Files in this format are interpreted as plain ASCII text. UTF-8 is not yet supported.<br />
<br />
===Include directives===<br />
Lines that start with '''include''' will load sections and settings from another file written in the format. The file may be named using a relative path, which follows the '''include''' keyword and a single space. If the same section exists in both files, a union of the two sections will result in the file which had the include directive. Values from the including file override those in the included file. Circular includes are repressed.<br />
<br />
===Comments and Whitespace===<br />
Comments begin with '''#''' and can occur at any point in a line. Everything following the '''#''' is ignored until the end of the line.<br />
<br />
Whitespace before and after an identifier, name, or value is ignored; however, all spaces are preserved inside both section and setting identifiers. Line breaks are significant -- each line may contain only one section heading, '''include''' directive, or setting.<br />
<br />
===Sections===<br />
Sections (categories) are defined by a heading line with an identifier only. The section identifier may be placed between optional '''[''' and ''']''' brackets. Identifiers are case-sensitive.<br />
<br />
Sections are categorical (flat), not hierarchical (nested). It is possible to create a category hierarchy by carefully naming each section, but the format does not provide any mechanism for managing or traversing a hierarchy. <br />
<br />
Settings included in a section are all those on lines following the section heading, until the next section heading or the end of the file.<br />
<br />
===Settings===<br />
Settings (data items) are defined by a line with the form '''''name'' = ''value''''', where ''name'' is the identifier for the setting and ''value'' is the data for the setting. No restrictions are placed on the type, length, or formatting of the value stored in a setting. Setting identifiers are case-sensitive.<br />
<br />
Settings before the first section heading have no section. They are referenced by their identifiers preceded by a '''.''' character.<br />
<br />
====Value types====<br />
The format employs a somewhat loose typing scheme. Settings do not need to have their types explicitly defined. In the game code, an item can be queried as any type, and depending on the value of the item, certain values can be interpreted differently when requested as different types.<br />
<br />
Values can be requested as any of the following:<br />
* booleans<br />
* integer numbers<br />
* floating point numbers<br />
* strings<br />
* lists<br />
<br />
For instance, the item '''2nd.now''' from the example above would have the value ''1'' if interpreted as an integer. If interpreted as a boolean, its value would be ''true''; as a string, its value would be ''"1"''; as a floating-point number, its value would be ''1.0''.<br />
<br />
====Booleans====<br />
The following values will equal ''true'' and ''false'', respectively, when interpreted as boolean values:<br />
* '''true''', '''false'''<br />
* '''yes''', '''no'''<br />
* '''on''', '''off'''<br />
* '''1''', '''0'''<br />
<br />
====Lists====<br />
List settings may be defined by writing a list of values separated by commas instead of just a single value.<br />
<br />
==Example==<br />
A file in this format might look like this.<br />
name = Example<br />
<br />
[ first ]<br />
stuff = 567<br />
blah = hello<br />
radius = 0.555<br />
<br />
[ 2nd ]<br />
beans = on<br />
now = 1<br />
position = 5,6,7<br />
<br />
In the file, there are two categories, each with three data items. These items would be referenced by the following identifier strings, respectively:<br />
* '''.name'''<br />
* '''first.stuff'''<br />
* '''first.blah'''<br />
* '''first.radius'''<br />
* '''2nd.beans'''<br />
* '''2nd.now'''<br />
* '''2nd.position'''<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=JOEPack_format&diff=1252JOEPack format2012-09-01T10:33:47Z<p>Timo 6: Update categories</p>
<hr />
<div>This is a simple file format that just crams a bunch of files together, like a zip file, but without any compression.<br />
<br />
==Technical specification==<br />
"JoePack" is a binary file format in which multi-byte values are expressed with the little-endian byte order. This section details version 1 of the file format.<br />
<br />
{{note|This documentation was generated by reverse engineering the source code. So there may be errors in evaluation.}}<br />
<br />
===Data Type Map===<br />
The following table explicitly defines the various data types used in a JOE file.<br />
{| border="1"<br />
!Identifier!!Detailed Description<br />
|-<br />
|unsigned int||32-bit un-signed integer<br />
|-<br />
|unsigned short||16-bit un-signed integer <br />
|-<br />
|string[''x'']||Array of characters with length ''x''<br />
|}<br />
<br />
===File Header===<br />
This block of information initiates every file.<br />
<br />
{| border="1"<br />
!Data type!!Block offset!!Name!!Description<br />
|-<br />
|string[8]||0||versionstr<br />
|Report the file version that this file conforms to. This specification details version 1 of the format.<br />
|-<br />
|unsigned int||8||numobjs<br />
|This is the number of files contained in the pack<br />
|-<br />
|unsigned int||12||maxstrlen<br />
|The maximum file name length in this pack<br />
|}<br />
<br />
===File Allocation Table (FAT)===<br />
The FAT consists of ''numobjs'' entries of the following format:<br />
{| border="1"<br />
!Data type!!Block offset!!Name!!Description<br />
|-<br />
|unsigned int||0||offset<br />
|Offset into the file at which this file starts. This offset is in bytes from the beginning of the file.<br />
|-<br />
|unsigned int||4||length<br />
|The length of the file this entry corresponds to.<br />
|-<br />
|string[''maxstrlen'']||8||filename<br />
|The name of the file stored at this entry. Note that this is not necessarily null terminated - VDrift stores it in a string of length ''maxstrlen + 1'' and pads it with a null character at the end<br />
|}<br />
<br />
===File Data===<br />
Following the FAT, the JoePack file simply consists of all the data stored sequentially. Seeking to the offset specified in the FAT (from the beginning of the file) will allow you to read that file's data like normal.<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=JOE_format&diff=1251JOE format2012-09-01T10:33:21Z<p>Timo 6: Update categories</p>
<hr />
<div>This format is based on the md2 format but with a few enhanced features. It can be written to using a python export script for the Blender 3D modeling package.<br />
<br />
==Technical specification==<br />
"JOE" is a binary file format in which multi-byte values are expressed with the little-endian byte order. This section details version 3 of the file format.<br />
<br />
{{note|This documentation was generated by reverse engineering model.h and modle.cpp and inspecting the python blender export script. So there may be errors in evaluation.}}<br />
<br />
=== Data Type Map ===<br />
The following table explicitly defines the various data types used in a JOE file.<br />
{| border="1"<br />
!Identifier!!Detailed Description<br />
|-<br />
|int||32-bit signed integer<br />
|-<br />
|short||16-bit signed integer <br />
|-<br />
|short3||Three consecutive shorts forming an array<br />
|-<br />
|float||32-bit floating-point value.<br />
Unsure of the exact format... probably whatever is implemented by x86 machines.<br />
|-<br />
|float3||Three consecutive floats forming an array.<br />
|}<br />
<br />
=== File Header ===<br />
This block of information initiates every file.<br />
<br />
{| border="1"<br />
!data type!!block offset!!name!!description<br />
|-<br />
|int||0||magic<br />
|'''8441211611'''(0x1F722AADB): number used to identify the file as a JOE file. Currently unchecked by vdrift.<br />
|-<br />
|int||4||version<br />
|report the file version that this file conforms to. This specification details version 3 of the format.<br />
|-<br />
|int||8||num_faces<br />
|every frame is expected to contain the same number of faces (polygons) this value specifies how many. This is currently limited to 32000.<br />
|-<br />
|int||12||num_frames<br />
|Presumably, this details the number of frames used in an animation. Currently constrained to "1"<br />
|}<br />
<br />
=== Frame Format ===<br />
details a single configuration of a model. "File Header.num_frames" frames follow the file header.<br />
<br />
{| border="1"<br />
!data type!!block offset!!name!!description<br />
|-<br />
|int||0||num_verts<br />
|the number of vertices used in this frame<br />
|-<br />
|int||4||num_textcoords<br />
|the number of texture coordinates used in this frame.<br />
|-<br />
|int||8||num_normals<br />
|the number of vertex normals used in this frame.<br />
|}<br />
<br />
after each frame header, you will find<br />
* File Header.num_faces Face blocks<br />
* num_verts Vertex blocks<br />
* num_normals Vertex blocks<br />
* num_textcoords Texture Coordinate blocks<br />
<br />
===Face Format===<br />
Each frame as "File Header.num_faces" face records immediately following the Frame header (decribed above). A face is basically several lists of indices in to vertex, normal, and text coord arrays described in following sections.<br />
<br />
For this version, a face is always a triangle ( i.e. a three-vertex polygon ).<br />
<br />
{| border="1"<br />
!data type!!block offset!!name!!description<br />
|-<br />
|short3||0||vertexIndex<br />
|Indeces in to the vertex array. These two constructs together define the location of each corner of the face in 3d space.<br />
|-<br />
|short3||6||normalIndex<br />
|Indeces in to the normals array. These two constructs help define how light sources interact with the face at each corner. Normals also help define which side of a face is "front".<br />
|-<br />
|short3||12||textureIndex<br />
|Indeces in to the texture coordinate array. These two constructs together help define which portions of a texture image map to each corner of the face. Note that in the future there may be a multiple of 3 entries in this array to accomidate applying many textures to a single face. Which images are used as textures by a particular model are defined by convention and explained in [[Car files and formats]] and [[Track files and formats]]<br />
|}<br />
<br />
===Vertex Format===<br />
A vertex block simply contains a three-element float array. Vertex blocks may have a misleading name because they are used for both vertices and normals.<br />
<br />
{| border="1"<br />
!data type!!block offset!!name!!description<br />
|-<br />
|float3||0||vertex||A three-element float array defining the X, Y, and Z components of a vertex at offsets 0, 4, and 8 respectively<br />
|}<br />
<br />
===Texture Coordinate Format===<br />
A texture coordinate is a 2-dimensional coordinate used to map prtions of a texture to a model vertex.<br />
{| border="1"<br />
!data type!!block offset!!name!!description<br />
|-<br />
|float||0||u||a value between 0 and 1 indicating a position along the width of the texture<br />
|-<br />
|float||4||v||a value between 0 and 1 indicating a position along the height of the texture.<br />
|}<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Sound/graphics_formats&diff=1250Sound/graphics formats2012-09-01T10:32:46Z<p>Timo 6: Update categories</p>
<hr />
<div>==Textures==<br />
Textures are all in [http://www.libpng.org/pub/png/ Portable Network Graphic (PNG)] format. Graphics can be 24 or 32 bit color, but if you don't need the Alpha channel leave it out. We prefer to produce these graphics using [http://gimp.org/ The GIMP], and many of the originals in the [[Art repository]] are in GIMP's native format (XCF). Other originals are created in [http://inkscape.org/ Inkscape] using its native [http://www.w3.org/TR/SVG/ Scalable Vector Graphics (SVG)] format.<br />
<br />
==Models==<br />
Models used in the game are all [[JOE format]], which is produced by a Python script for [http://www.blender3d.org/ Blender3D]. Currently models are used for cars (glass, interiors, wheels, etc.) and track objects. Get the modeling tools from the '''tools''' directory of the [[Art repository]]. There are two [[JOE export scripts]], '''export-joe-0.3.py''' and '''export-all-joe-0.3.py'''.<br />
<br />
==Sounds==<br />
Sounds are in PCM Waveform (WAV) format which can be editing using any waveform audio editor such as [http://audacity.sourceforge.net/ Audacity].<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Options.config&diff=1249Options.config2012-09-01T10:32:07Z<p>Timo 6: Update categories</p>
<hr />
<div>VDrift has a set of options which can be added to menus, referenced by the game, and used as a template for a player's settings. These options are defined in '''data/settings/options.config''' in the [[Configfile format]] that VDrift uses for many of its other text files. Once defined, these options can be referred to by the menus to do several things, including: pick default values for options, to get names, descriptions, and lists of values for options, check the type of options, and much more.<br />
<br />
{{note|The options.config file is '''not''' the place where the user's settings are stored. Users should never need to edit this file. User options are set in [[VDrift.config]].}}<br />
<br />
The options tell what values are available to the user for a given setting. This may seem confusing. Here's an example definition of an option in the file:<br />
[ option-17 ]<br />
cat = display<br />
name = view_distance<br />
title = View Distance<br />
desc = Change the maximum view distance.<br />
type = float<br />
default = 500.0<br />
values = list<br />
num_vals = 5<br />
opt00 = Very Low (0.25 km)<br />
val00 = 250.0<br />
opt01 = Low (0.5 km)<br />
val01 = 500.0<br />
opt02 = Medium (1 km)<br />
val02 = 1000.0<br />
opt03 = High (2.5 km)<br />
val03 = 2500.0<br />
opt04 = Very High (10 km)<br />
val04 = 10000.0<br />
The first line has the option ID number. This must be in the format <code>[ option-## ]</code> and number must be less than num_options. No two widgets should have the same ID. The first field, <code>cat</code>, is just for categorization. This option is in the display category. Next comes the option's name, which combined with the category, makes up the name by which the option is referred to in the menu (here, "display.view_distance"). The <code>title</code> field tells the human-readable name for this option. <code>desc</code> tells a little more about the option, this usually goes in the tip for the option in the menu. <code>type</code> is very important because it tells the game how to interpret the values given to it for each option. This particular option is a floating point option, which means it has a decimal, so it is <code>type</code> float. <code>default</code> is, as you probably guessed, the default value for the option.<br />
<br />
The <code>values</code> needs a little extra explanation. In this case it is "list" which means that the possible values for the option will be listed along with this option definition. Sometimes <code>values</code> is given an alternate value which tells the game to get the list of values from some other special place. Since this option needs a list of values, we define the list: <code>num_vals</code> tells how many possible options there are; and the following <code>opt-##</code> and <code>val-##</code> fields describe the displayed name for the value, and the actual value, respectively. The <code>opt-##</code> fields are assumed to be strings, but the <code>val-##</code> fields must be of the same type as the type of the object, as must the <code>default</code> setting described earlier. Putting the wrong type of values here can cause very unexpected results.<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Adding_video_modes&diff=1248Adding video modes2012-09-01T10:31:44Z<p>Timo 6: Update categories</p>
<hr />
<div>You can add a new resolution to the list that gets displayed in the in-game display options by editing the '''data/lists/videomodes''' file.<br />
<br />
When VDrift is run, it reads this file for the base list of video modes. Then it gets a list of available graphics modes that your monitor supports using SDL. During this process it checks the provided modes to see if they are valid (invalid modes are removed from the list).<br />
<br />
The list of video modes which is then made available through the Display Options menu is all working modes from the videomodes file plus any other modes SDL reported as working.<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Data_directory&diff=1247Data directory2012-09-01T10:31:08Z<p>Timo 6: Update categories</p>
<hr />
<div>VDrift must be able to access its game data to run. This data is stored in the data directory.<br />
<br />
==Location==<br />
VDrift looks in several places to find its game data at startup. This is the order in which the different locations are checked.<br />
# The directory specified in the environment variable '''VDRIFT_DATA_DIRECTORY'''<br />
# The subdirectory "data" of the current working directory (the location from which VDrift was run)<br />
# A directory named at [[Compiling|compile]]-time via the environment variable '''DATA_DIR''' (usually set by the [[Using SCons|SCons]] build setup)<br />
{{note|On Windows, only locations 1 and 2 are checked.}}<br />
<br />
==Validation==<br />
To ensure that it has the correct location, VDrift checks for the file '''data/settings/[[options.config]]'''. If this file can't be found in any of the above locations, VDrift exits immediately.<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=User_settings_directory&diff=1246User settings directory2012-09-01T10:30:31Z<p>Timo 6: Update categories</p>
<hr />
<div>VDrift stores user settings (mostly in [[VDrift.config]]) and other information in a special directory on the computer's drive. Usually it is located within the user's personal assigned file space, to ensure that the user will have easy access to the files (for backup or other purposes), and that VDrift will be allowed write privileges to the directory.<br />
<br />
==Location==<br />
The location of the settings directory is chosen based on the best location for the user's operating system. In the following subsections, ''username'' represents the user's login name on the computer.<br />
<br />
{|<br />
|-<br />
|'''Operating System'''<br />
|'''Location'''<br />
|-<br />
|Windows XP<br />
|<code>C:\Documents and Settings\''username''\My Documents\My Games\VDrift</code><br />
|-<br />
|Windows Vista/7<br />
|<code>C:\Users\''username''\My Documents\My Games\VDrift</code><br />
|-<br />
|OS X<br />
|<code>/Users/''username''/Library/Preferences/VDrift</code><br />
|-<br />
|Linux<br />
|<code>/home/''username''/.vdrift</code><br />
|-<br />
|FreeBSD<br />
|<code>/home/''username''/.vdrift</code><br />
|}<br />
<br />
{{note|If VDrift is run as root on Linux/FreeBSD, the root user's home directory is used instead, which is usually '''/root'''. It is not recommended that VDrift is run as root.}}<br />
<br />
{{note|If VDrift is run as Administrator on Windows XP, the path will be '''C:\Documents and Settings\Administrator\My Documents\My Games\VDrift'''. It is not recommended that VDrift is run as Administrator.}}<br />
<br />
[[Category:Files]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Drifting_techniques&diff=1245Drifting techniques2012-09-01T10:29:26Z<p>Timo 6: Update categories</p>
<hr />
<div>Drifting can be a very tedious and difficult feat to achieve. Some consider it an art, while others consider it recklessness. This is just a game, so pick up your paintbrush!<br />
<br />
==About drifting==<br />
"Drifting refers to a driving technique and to a motorsport where the driver intentionally over steers, causing loss of traction in the rear wheels through turns, while maintaining vehicle control and a high exit speed. A car is drifting when the rear slip angle is greater than the front slip angle prior to the corner apex, and the front wheels are pointing in the opposite direction to the turn (e.g. car is turning left, wheels are pointed right or vice versa), and the driver is controlling these factors." (from [http://en.wikipedia.org/wiki/Drifting_%28motorsport%29 Wikipedia])<br />
Drifting is caused by a lack of traction to the rear tires. The spinning of the tires causes the vehicle's rear end to "swing" out causing oversteer. Different cars will behave differently due to differences in torque, tire tread, weight placement, and suspension recoil. The spinning of the tires also "pushes" the back end of the car forward, so once in oversteer, it will need to be controlled.<br />
<br />
==Initiating a drift==<br />
There are a number of ways to get yourself into a drift. As said before, weight placement and suspension recoil can affect your traction on the rear tires. Here are some techniques:<br />
<br />
===Handbrake===<br />
Probably the easiest thing to do, but, however, most cars in the game do not have strong enough braking to do this. Just activate the handbrake and it will cause your car to lose traction.<br />
<br />
===Steer + gas===<br />
Ride your gas at a moderate RPM and steer into the corner. Once your front end starts turning, give it some more gas and you will get into an oversteer.<br />
<br />
===Suspension recoil===<br />
Use your suspension to "jump" the car into a drift. Steer away from the corner quickly and steer back in. This will cause a bouncing effect from left to right (or vice versa). Apply the "steer + gas" technique to get into oversteer if not achieved already.<br />
<br />
===The dip===<br />
"Dip" your back tires in the dirt or grass or whatever off the track. This will cause your back end to swing a bit.<br />
<br />
==Controlling the drift==<br />
This is simple to do, but hard to perfect. Essentially, you will only need to steer to get your wheels pointed the direction you want to go. You will also need to control your throttle. The slower your tires spin, the more traction you will have. The opposite happens with faster spinning tires. Control your throttle and be careful not to give it too much juice or you will most likely spin out. Spinning out usually happens when the car is oversteered too much. The tires keep spinning and your car continues to rotate into the turn, but the front end will have too much traction and cause the car to rotate more.<br />
<br />
==Cars==<br />
Some cars are easier than others to drift in the game. Excessive oversteer can be a problem for beginners. Lots of torque and traction make initiation and recovery easy.<br />
*Z06<br />
*GT<br />
*G4<br />
<br />
[[Category:Playing]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Replays&diff=1244Replays2012-09-01T10:27:59Z<p>Timo 6: Update categories</p>
<hr />
<div>Replays are recorded while playing in any game mode, and can be viewed through the "Replays" menu.<br />
<br />
==Features==<br />
* Skip forward/backward controls (default "," and ".")<br />
* Replays can be recorded in any game mode<br />
<br />
==Settings==<br />
The current number of replays and the selected replay are stored in the file [[VDrift.config]], and are defined in [[options.config]]. Their option names are '''game.num_replays''' and '''game.selected_replay''', respectively.<br />
<br />
==Recording==<br />
To record a replay, simply set the "Record Session" option on the menu to start the game to "On". Then start the game.<br />
<br />
During gameplay you will see a message at the bottom of the screen telling you how much recording time is left. The recording system is currently limited to a fixed file size, and stops recording once this size is reached.<br />
<br />
To stop recording, simply leave the game or quit VDrift altogether. The replay is saved when it is stopped. This means if the game crashes, the replay is not saved.<br />
<br />
==Playback==<br />
To play back a replay, simply enter the Replays menu from the Main menu. Here you can select the replay by its ID number and play it back by pressing the "Start Replay" button.<br />
<br />
As new replays are recorded they are added to the available replays in this menu. The new replay's ID number is the one after the last current replay.<br />
<br />
[[Category:Playing]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Setting_up_force_feedback&diff=1243Setting up force feedback2012-09-01T10:26:31Z<p>Timo 6: Update categories</p>
<hr />
<div>Force feedback is currently only supported on Linux.<br />
<br />
==Prerequisites==<br />
* a steering wheel supporting constant force effects (like a Logitech Momo Racing force feedback steering wheel)<br />
* Linux<br />
* HID_FF is enabled in your kernel<br />
* your device's USB ID is in '''kernel-source/drivers/usb/input/hid-ff.c'''<br />
* the ff-utils test program ffcfstress works for you. Note the device name you use with this program (should be '''/dev/input/eventX''').<br />
* write permission to '''/dev/input/eventX'''<br />
* VDrift SVN r1547 or later<br />
<br />
If you need to recompile your kernel to enable force feedback, you can have a look here [[Enabling force feedback in kernel]]<br />
<br />
==Enabling force feedback in VDrift==<br />
Once you've met the prerequisites, recompile vdrift like this:<br />
scons force_feedback=1<br />
<br />
Now open your [[VDrift.config]]. Find the section <code>[ joystick ]</code> and add the following line to the joystick section somewhere:<br />
ff_device = /dev/input/event0<br />
Change event0 to whatever device you should use (the one that worked with ffcfstress).<br />
<br />
Start up VDrift. The console will print whether or not force feedback initialization succeeded. Start a practice game. You should feel a force effect on your steering wheel based on the aligning moment force from the front tires.<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Logitech_G25_support&diff=1242Logitech G25 support2012-09-01T10:26:11Z<p>Timo 6: Update categories</p>
<hr />
<div>==Windows==<br />
The G25 should be fully supported in Windows without any special steps.<br />
<br />
==Linux==<br />
When initially plugged in, the G25 will be in compatibility mode, which restricts the steering range and disables the clutch pedal and some of the gears on the H-shifter. VDrift includes two tools that can be used to change G25 modes. Either tool can be used; use whichever tool works the best for you.<br />
If you want to use force feedback, you'll need to patch your kernel because when set to native mode, the G25 change its product id, and this product id is not known yet by the kernel ( have a look here [[Enabling force feedback in kernel]])<br />
<br />
===usbtool===<br />
The tool can be found in '''tools/usbtool-0.1.tar.gz'''. The tool requires libusb development headers to be installed (package libusb-dev on ubuntu intrepid, for example) as well as the swig package. Run <code>./build.sh</code> and then run <code>./usbtool</code> to see the options available. To set the wheel to native mode and the range to 900 degrees, run:<br />
sudo ./usbtool g25-set-range-wheel-900<br />
and<br />
sudo ./usbtool g25-set-extended-mode<br />
This will likely disconnect the joystick driver. To reconnect it run:<br />
sudo rmmod joydev;sudo rmmod usbhid;sudo modprobe usbhid<br />
<br />
===G25manage===<br />
The tool can be found in '''tools/G25manage'''. The tool requires libusb development headers to be installed (package libusb-dev on ubuntu intrepid, for example). Run <code>make</code> to compile the tool, then run:<br />
sudo ./G25manage --nativemode<br />
and<br />
sudo ./G25manage --range 900<br />
The wheel should now support the entire turning radius as well as the clutch pedal.<br />
<br />
===LTWheelConf===<br />
LTWheelConf is a new tool based on G25manage: https://github.com/TripleSpeeder/LTWheelConf<br />
<br />
===Automatically enable native mode===<br />
If your distribution uses udev (such as Ubuntu), you can put this in '''/etc/udev/rules.d/90-g25-wheel.rules''' to automatically run G25manage when the wheel is plugged in:<br />
<br />
SUBSYSTEM!="usb", GOTO="g25_rules_end"<br />
ACTION!="add", GOTO="g25_rules_end"<br />
<br />
ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c294", RUN+="/usr/local/bin/G25manage --nativemode"<br />
#ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", RUN+="/usr/local/bin/G25manage --range 900"<br />
LABEL="g25_rules_end"<br />
<br />
# for a joystick detected by the kernel event interface, with a model name "G25_Racing_Wheel change the permissions on the device file<br />
# and add a symlink to the event device file<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", SYMLINK+="input/G25event"<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", MODE="0664", GROUP="games"<br />
<br />
# No deadzone for the wheel on the G25 in native mode<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", RUN+="/usr/local/bin/G25manage --evdev=/dev/input/G25event --deadzone=0 --axis=0"<br />
# No deadzone for the clutch pedal on the G25 in native mode<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", RUN+="/usr/local/bin/G25manage --evdev=/dev/input/G25event --deadzone=0 --axis=1"<br />
# No deadzone for the break pedal on the G25 in native mode<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", RUN+="/usr/local/bin/G25manage --evdev=/dev/input/G25event --deadzone=0 --axis=2"<br />
# No deadzone for the throttle pedal on the G25 in native mode<br />
KERNEL=="event[0-9]*", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="c299", RUN+="/usr/local/bin/G25manage --evdev=/dev/input/G25event --deadzone=0 --axis=5"<br />
<br />
After creating that file and copying the G25manage binary to '''/usr/local/bin''', run <code>/etc/init.d/udev reload</code> (or <code>service udev reload</code> on Ubuntu karmic) and you no longer have to manually run G25manage.<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Configuring_the_controls&diff=1241Configuring the controls2012-09-01T10:25:42Z<p>Timo 6: Remove update template</p>
<hr />
<div>VDrift aims to be very user input friendly, and thus there are many different ways to adjust the controls in the game to fit each user's needs. There are options which affect all the controls, options which affect only a certain type of controls, and options that affect each individual control assignment.<br />
<br />
==Features==<br />
* Any input method can be used to navigate the menu.<br />
* Joysticks can be used by calibrating them in the Options -> Controls -> Joystick -> Calibrate menu.<br />
* Any input can be assigned to any control.<br />
* Gas, brake, and steering controls only allow a single setting. All other controls can have any number of settings on any types of input devices.<br />
<br />
==Control options==<br />
Control options are defined in the text configuration file [[options.config]], set in the Options -> Controls menu and its submenus, and stored in the text configuration file [[VDrift.config]].<br />
===AutoClutch===<br />
* type: boolean<br />
* setting: control.autoclutch<br />
* values: on, off<br />
Enable/disable automatic clutching (prevents car from stalling). Simulates the driver pressing the clutch in using foot when RPM gets close to the stall point.<br />
<br />
===AutoShift===<br />
* type: boolean<br />
* setting: control.autotrans<br />
* values: on, off<br />
Enable/disable automatic transmission shifting.<br />
<br />
===Button Control Delay===<br />
* type: float<br />
* setting: control.button_ramp<br />
* values: off (0.0), long (5.0), medium (7.5), short (10.0)<br />
Slow down application of button inputs on analog controls.<br />
<br />
===Speed Affect on Steering===<br />
* type: float<br />
* setting: control.speed_sens_steering<br />
* values: range 0.0 to 1.0<br />
The higher the value on this setting, the more steering is limited as car speed increases.<br />
<br />
===Joystick Type===<br />
* type: string<br />
* setting: joystick.type<br />
* values: "joystick", "wheel"<br />
Change the type of joystick device.<br />
<br />
===Force Feedback Device===<br />
* type: string<br />
* setting: joystick.ff_device<br />
* values: something like "/dev/input/eventX"<br />
Device file for force feedback events. For more detail, see [[Setting up force feedback]].<br />
<br />
===Force Feedback Gain===<br />
* type: float<br />
* setting: joystick.ff_gain<br />
* values: range 0.5 to 5.0<br />
Multiplier to adjust strength of force feedback.<br />
<br />
===Invert Force===<br />
* type: boolean<br />
* setting: joystick.ff_invert<br />
* values: on, off<br />
Reverse the force feedback, if necessary for your wheel.<br />
<br />
===200 Degree Wheel===<br />
* type: boolean<br />
* setting: joystick.two_hundred<br />
* values: on, off<br />
Limit steering range to 200 degrees, gives a realistic feel to limited range wheels.<br />
<br />
==Assigning controls==<br />
Control assignments can be configured through the submenus of the Options -> Controls -> Assign Controls menu, and stored in the text configuration file [[controls]]. Control assignments can be edited after they are set.<br />
<br />
There are two basic types of control, analog and digital. Analog controls include joystick axes and mouse motion, while digital controls are keys, mouse buttons and joystick buttons. Any type of input can be assigned to any type of control.<br />
<br />
So, for example, a digital control - like a key - can be assigned to an analog control. If the "Button Control Delay" option is something other than 0.0, then the key will behave just like a true analog control.<br />
<br />
===Car Controls===<br />
=====Gas=====<br />
* control name: gas<br />
The gas control causes the car to speed up.<br />
<br />
=====Brake=====<br />
* control name: brake<br />
The brake control causes the car to slow down.<br />
<br />
=====Steer Left=====<br />
* control name: steer_left<br />
The steer left control causes the car to turn left.<br />
<br />
=====Steer Right=====<br />
* control name: steer_right<br />
The steer right control causes the car to turn right.<br />
<br />
=====Start Engine=====<br />
* control name: start_engine<br />
The start engine control will restart the engine if it stalls.<br />
{{note|The engine will not start unless the car's transmission is in neutral.}}<br />
<br />
=====Handbrake=====<br />
* control name: handbrake<br />
The handbrake brakes only on the back wheels.<br />
<br />
=====ABS Toggle=====<br />
* control name: abs_toggle<br />
The ABS Toggle turns anti-lock braking on or off while playing.<br />
<br />
=====TCS Toggle=====<br />
* control name: tcs_toggle<br />
The TCS Toggle turns traction control on or off while playing.<br />
<br />
====Transmission====<br />
=====Shift Up=====<br />
* control name: disengage_shift_up<br />
The shift up control changes the car's gear to the next one.<br />
<br />
=====Shift Down=====<br />
* control name: disengage_shift_down<br />
The shift down control changes the car's gear to the previous one.<br />
<br />
=====Engage Clutch=====<br />
* control name: engage<br />
The engage clutch control lets out the clutch. This must be done after every shift.<br />
<br />
=====Analog Clutch=====<br />
* control name: clutch<br />
The analog clutch control can allow you to use an external clutch pedal.<br />
<br />
====Gears====<br />
=====Neutral=====<br />
* control name: neutral<br />
The neutral control shifts the car into neutral.<br />
<br />
=====1st=====<br />
* control name: first_gear<br />
The first gear control shifts the car into first gear.<br />
<br />
=====2nd=====<br />
* control name: second_gear<br />
The second gear control shifts the car into second gear.<br />
<br />
=====3rd=====<br />
* control name: third_gear<br />
The third gear control shifts the car into third gear.<br />
<br />
=====4th=====<br />
* control name: fourth_gear<br />
The fourth gear control shifts the car into fourth gear.<br />
<br />
=====5th=====<br />
* control name: fifth_gear<br />
The fifth gear control shifts the car into fifth gear.<br />
<br />
=====6th=====<br />
* control name: sixth_gear<br />
The sixth gear control shifts the car into sixth gear.<br />
<br />
=====Reverse=====<br />
* control name: reverse<br />
The reverse control puts the car into reverse gear.<br />
<br />
===Game Controls===<br />
=====Pause=====<br />
* control name: pause<br />
The pause control freezes the game (except in multiplayer).<br />
<br />
====Camera Views====<br />
=====Previous Camera=====<br />
* control name: view_prev_camera<br />
This moves to the previous camera in the set (hood, in-car, chase rigid, chase loose).<br />
<br />
=====Next Camera=====<br />
* control name: view_next_camera<br />
This moves to the next camera in the set (hood, in-car, chase rigid, chase loose).<br />
<br />
=====Hood=====<br />
* control name: view_hood<br />
The hood camera control moves the camera to the car's hood.<br />
<br />
=====In-Car=====<br />
* control name: view_incar<br />
The in-car camera control moves the camera to driver's view.<br />
<br />
=====Chase (Rigid)=====<br />
* control name: view_chaserigid<br />
The rigid chase camera control moves the camera to a fixed distance behind the car.<br />
<br />
=====Chase (Loose)=====<br />
* control name: view_chase<br />
The loose chase camera control moves the camera to follow the car like a helicopter.<br />
<br />
=====Orbit=====<br />
* control name: view_orbit<br />
The orbit camera control swings around the car [[Configuring the controls#Camera_Movement|as the camera moves]].<br />
<br />
=====Free=====<br />
* control name: view_free<br />
The free camera control can be moved anywhere using the arrow keys.<br />
<br />
=====Focus Next=====<br />
* control name: focus_next_car<br />
Changes the camera to focus on the next car.<br />
<br />
=====Focus Previous=====<br />
* control name: focus_prev_car<br />
Changes the camera to focus on the previous car.<br />
<br />
====Camera Movement====<br />
=====Pan Left=====<br />
* control name: pan_left<br />
Turn the camera view to the left.<br />
<br />
=====Pan Right=====<br />
* control name: pan_right<br />
Turn the camera view to the right.<br />
<br />
=====Pan Up=====<br />
* control name: pan_up<br />
Turn the camera view upwards.<br />
<br />
=====Pan Down=====<br />
* control name: pan_down<br />
Turn the camera view downwards.<br />
<br />
=====Zoom In=====<br />
* control name: zoom_in<br />
Zoom camera in.<br />
<br />
=====Zoom Out=====<br />
* control name: zoom_out<br />
Zoom camera out.<br />
<br />
====Replays====<br />
=====Skip Forward=====<br />
* control name: replay_ff<br />
The skip forward control skips ahead ten seconds during a replay.<br />
<br />
=====Skip Backward=====<br />
* control name: replay_rw<br />
The skip backward control goes back ten seconds during a replay.<br />
<br />
====Tools====<br />
=====Screen Shot=====<br />
* control name: screen_shot<br />
The screen shot control saves a snapshot of the game while playing.<br />
<br />
=====Joystick Info=====<br />
* control name: joystick_info<br />
The joystick info control shows debugging info for available joysticks.<br />
<br />
==Editing Controls==<br />
After controls have been assigned they can be edited to change some properties of the control. To edit a control just click on it in one of the control assignment menus.<br />
===Analog control properties===<br />
Analog controls include joystick axes and mouse motion. These have options for deadzone, gain and exponent.<br />
<br />
====Deadzone====<br />
Deadzone allows motion under a certain threshold percentage to be ignored. This is useful if you use a joystick which "wobbles" around the center. You may see the brake lights come on when you let go of the gas, or the car is hard to keep going straight, deadzone will help to fix these things.<br />
<br />
====Gain====<br />
Gain multiplies the input value by a percentage. This will make the input value increase linearly.<br />
<br />
====Exponent====<br />
Exponent raises the input value on an exponential curve. This helps give more fine-tuning of controls such as steering around the center but still allows for making sharp turns if needed.<br />
<br />
===Digital control properties===<br />
====Up/Down====<br />
This controls whether the action will be triggered when the button/key is pressed (down), or released (up).<br />
<br />
====Held/Once====<br />
This should be set to "held" when they a digital input is mapped to an analog control, like when using keys for gas, brake or steering. This is set automatically when the control is assigned.<br />
<br />
==Deleting controls==<br />
There is a Delete button on each Control Editing screen, so to delete a control just click on it, then click Delete.<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Configuring_the_sound&diff=1240Configuring the sound2012-09-01T10:25:05Z<p>Timo 6: Remove update template</p>
<hr />
<div>Currently VDrift has 3D sound using OpenAL. In-game sounds include engine RPM sound and tire sounds. The game doesn't have any music yet.<br />
<br />
==Sound settings==<br />
Configuring the sound is done by editing [[VDrift.config]] manually, or by changing the settings in the Options -> Sounds menu. As there is no game music yet, the only option is the volume of game sounds:<br />
[sound]<br />
volume = 1<br />
<br />
{{note|The following sections refer mostly to the Linux version of VDrift.}}<br />
<br />
==Troubleshooting sound==<br />
If the engine sound is very broken or choppy sounding, and you hear some noise or crackling, you need to tell OpenAL to try to use a different sound backend. If you don't have an ~/.openalrc file, create it with these contents, or modify your current one to look like this:<br />
<br />
(define devices '(native alsa sdl arts esd null))<br />
(define alsa-device "dsp0")<br />
(define speaker-num 2)<br />
;(define sampling-rate 22050)<br />
<br />
The important line here is the "define devices" line, OpenAL attempts to use each of those sound output methods in order. It uses the first one that works; in some cases native will work best, in other cases perhaps alsa. If Gnome is running its sound daemon, esd would be the best choice, while KDE usually uses artsd.<br />
<br />
==Known bugs==<br />
If you don't hear lots of crackling and choppiness, but you still hear a 'click, click, click' sound as the engine sample loops, this is a bug in OpenAL for Linux (or a feature we haven't found a way around...). We've heard there is a fix in the works from the OpenAL project.<br />
<br />
Also, certain cars have engines that rev very high, and our engine sound system can't pitch shift high enough to play the sound at the correct frequency, after it hits the maximum pitch. This is currently only obvious on the F1 car.<br />
<br />
==OpenAL Utility Toolkit==<br />
On older versions of OpenAL, ALUT was part of the OpenAL library. At some point not easily markable with a version number, ALUT became a separate library. This changed the way VDrift must be built, as well as some of the sound code.<br />
<br />
To accomodate users of the old version of OpenAL with ALUT included, there is a switch in the SCons build system used on Linux and FreeBSD. To compile VDrift with "old OpenAL" support, simply add the option to the scons compile command:<br />
scons old_openal=1<br />
For more information on the build system see [[Using SCons]].<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Configuring_the_display&diff=1239Configuring the display2012-09-01T10:24:34Z<p>Timo 6: Remove update template</p>
<hr />
<div>Configuring the display is done by editing [[VDrift.config]] manually, or by changing the settings in the Options -> Display and Options -> Display -> Advanced menus.<br />
<br />
==Display Options==<br />
===Resolution===<br />
* type: integer pair<br />
* settings: display.width, display.height<br />
* values: depends on the file '''vdrift/data/lists/videomodes''' and the resolutions your video card makes available<br />
<br />
Change the resolution of the game display.<br />
<br />
See [[Adding video modes]] for how to make new video modes available to choose from.<br />
<br />
===Fullscreen===<br />
* type: boolean<br />
* setting: display.fullscreen<br />
* values: on, off<br />
<br />
Make the game take up the entire screen.<br />
<br />
===Speed Units===<br />
* type: boolean<br />
* setting: display.mph<br />
* values: on = "MPH", off = "km/h"<br />
<br />
Change the units that speed is displayed in.<br />
<br />
===Framerate Counter===<br />
* type: boolean<br />
* setting: display.show_fps<br />
* values: on, off<br />
<br />
Enable/disable the framerate counter.<br />
<br />
===Heads Up Display===<br />
* type: boolean<br />
* setting: display.show_hud<br />
* values: on, off<br />
<br />
Enable/disable the heads up display.<br />
<br />
===Menu Skin===<br />
* type: string<br />
* setting: display.skin<br />
* values: default "simple", the name of any directory in '''vdrift/data/skins/'''<br />
<br />
Change the graphics and layout of the VDrift menus.<br />
<br />
===Input Graph===<br />
* type: boolean<br />
* setting: display.input_graph<br />
* values: on, off<br />
<br />
Visualize the steering and acceleration/braking on screen.<br />
<br />
==Advanced Display Options==<br />
===Color Depth===<br />
* type: integer<br />
* setting: display.depth<br />
* values: 16, 32<br />
<br />
Adjust the amount of colors available.<br />
<br />
===Texture Size===<br />
* type: string<br />
* setting: display.texture_size<br />
* values: "small", "medium", "large"<br />
<br />
Change the size of the textures displayed.<br />
<br />
===View Distance===<br />
* type: floating-point<br />
* setting: display.view_distance<br />
* values: any positive decimal number of meters<br />
<br />
Change the maximum view distance.<br />
<br />
===Anisotropic Filtering===<br />
* type: integer<br />
* setting: display.anisotropic<br />
* values: depends on your video card<br />
<br />
Set anisotropic filtering level for textures.<br />
<br />
===Antialiasing===<br />
* type: integer<br />
* setting: display.antialiasing<br />
* values: depends on your video card<br />
<br />
Set the full scene antialiasing level.<br />
<br />
===Car Shadows===<br />
* type: boolean<br />
* setting: display.car_shadows<br />
* values: on, off<br />
<br />
Draw simple static shadows beneath the cars.<br />
<br />
===Field of View===<br />
* type: floating-point<br />
* setting: display.FOV<br />
* values: any positive decimal number<br />
<br />
Field of view angle in the vertical direction.<br />
<br />
===Lighting Quality===<br />
* type: integer<br />
* setting: display.lighting<br />
* values: 0, 1<br />
<br />
Set how good the lighting looks during gameplay. 0 is Low, which is totally static lighting. 1 is Medium, static cube-mapped lighting.<br />
<br />
===Reflection Quality===<br />
* type: integer<br />
* setting: display.reflections<br />
* values: 0, 1, 2<br />
<br />
Set how good the reflections look during gameplay. 0 is Low, static sphere-mapped reflections. 1 is Medium, static cube-mapped reflections, and 2 is High, dynamic cube-mapped reflections.<br />
<br />
[[Category:Configuration]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Main_Page&diff=1238Main Page2012-09-01T10:23:25Z<p>Timo 6: Fix link</p>
<hr />
<div>[[File:VDrift_logo.png]]<br />
<br />
='''VDrift Wiki'''=<br />
<br />
Welcome to the [[Project:About|VDrift Wiki]].<br />
<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''[[:Category:General|General]]'''<br />
*[[About the project]]<br />
*[[Authors and contributors]]<br />
*[[License]]<br />
*[[Reporting problems]]<br />
*[[Useful links]]<br />
|width="250px"|'''[[:Category:Installation|Installation]]'''<br />
*[[Requirements]]<br />
*[[Downloading]]<br />
*[[Installing]]<br />
|}<br />
<br />
<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''[[:Category:Configuration|Configuration]]'''<br />
*[[Configuring the display]]<br />
*[[Configuring the sound]]<br />
*[[Configuring the controls]]<br />
*[[Logitech G25 support]]<br />
*[[Setting up force feedback]]<br />
|width="250px"|'''[[:Category:Playing|Playing]]'''<br />
*[[Replays]]<br />
*[[Drifting techniques]]<br />
*[[Drift scoring]]<br />
|}<br />
<br />
<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''[[:Category:Files|Files]]'''<br />
*[[User settings directory]]<br />
*[[Data directory]]<br />
*[[VDrift.config]]<br />
*[[Adding video modes]]<br />
*[[options.config]]<br />
*[[Sound/graphics formats]]<br />
*[[JOE format]]<br />
*[[JOEPack format]]<br />
*[[Configfile format]]<br />
*[[Menu system|Menu file format]]<br />
|width="250px"|'''[[:Category:Development|Development]]'''<br />
*[[Getting the development version]]<br />
*[[Working with the development version]]<br />
*[[Compiling]]<br />
*[[Packaging]]<br />
*[[Testing]]<br />
*[[Debugging]]<br />
*[[Coding guidelines]]<br />
*[[Source code documentation]]<br />
*[[Numerical Integration]]<br />
|}<br />
<br />
<br />
{| style="border: solid 1px black; background-color: #e0e0e0"<br />
|- valign="top"<br />
|width="250px"|'''[[:Category:Cars|Cars]]'''<br />
*[[Getting cars]]<br />
*[[Car files and formats]]<br />
*[[Creating cars]]<br />
*[[Car parameters]]<br />
*[[3D modeling]]<br />
|width="250px"|'''[[:Category:Tracks|Tracks]]'''<br />
*[[Getting tracks]]<br />
*[[Track files and formats]]<br />
*[[Creating tracks]]<br />
*[[Importing Racer tracks]]<br />
|}</div>Timo 6http://wiki.vdrift.net/index.php?title=Category:General&diff=1237Category:General2012-09-01T10:21:39Z<p>Timo 6: General information</p>
<hr />
<div>These pages contain general information about the VDrift project.</div>Timo 6http://wiki.vdrift.net/index.php?title=Useful_links&diff=1236Useful links2012-09-01T10:20:45Z<p>Timo 6: Change category -> General</p>
<hr />
<div>The VDrift community is an always expanding world of open source game developers, gamers on all platforms, artists and designers, and car tuners. It is based totally on the internet. The following links might be useful for users and developers of VDrift.<br />
<br />
==VDrift==<br />
VDrift has several web sites devoted to the project and development. They are:<br />
* [http://vdrift.net/ Home] - The main project web site, includes news and forums, and general project information.<br />
* [http://cars.vdrift.net/ Cars] - VDrift cars database.<br />
* [http://vdrift.net/Forum/ Forum] - Discuss new features and development, report bugs and get help with problems in the forums.<br />
* [http://sourceforge.net/projects/vdrift SourceForge] - VDrift downloads are hosted on SourceForge, as well as the data repository.<br />
* [https://github.com/VDrift/vdrift GitHub] - This includes a public browser for the main VDrift Git tree, as well as HTTP access to the tree itself.<br />
* [http://wiki.vdrift.net/ Wiki] - The VDrift Wiki is the home of all the project's documentation.<br />
* [http://code.google.com/p/vdrift/issues/list Issue Tracker] - Tracks the fixing of bugs and implementing of new features.<br />
* [http://vdrift.net/staticpages/index.php?page=irc-chat Chat] - IRC channel used both for developer discussion and user support. If you have a problem or question feel free to stop by and ask.<br />
<br />
==Driving Simulation Information==<br />
These are some links to general driving simulation information and communities:<br />
* Wikipedia: [http://en.wikipedia.org/wiki/Sim_racing Sim racing], [http://en.wikipedia.org/wiki/Racing_video_game Racing video game] - General information about simulated racing games.<br />
* [http://www.miata.net/sport/Physics/ Physics of Racing] - A series of articles about the physics of racing cars.<br />
* [http://www.cescg.org/CESCG-2003/SDeak/index.html Dynamical Simulation in a Driving Simulator] - A paper that addresses some important aspects of building a graphical model and a dynamical model for a driving simulator.<br />
* [http://www.racesimcentral.com/ Race Sim Central] - Racing simulation news and forums.<br />
* [http://www.racedepartment.com/content/ RaceDepartment] - Racing simulation community.<br />
<br />
==Open Source Driving Simulators and Racing Games==<br />
Some more driving simulators:<br />
* [http://torcs.org/ The Open Race Car Simulator (TORCS)] - A car racing simulation focusing on AI racing and research. It can also be used as a ordinary car racing game too.<br />
* [http://sourceforge.net/projects/trigger-rally/ Trigger Rally] - A fast-paced open source rally racing game.<br />
* [http://vamos.sourceforge.net/ Vamos Automotive Simulator] - A automotive simulation framework with an emphasis on thorough physical modeling and good C++ design. It includes a real-time, first-person, 3D driving application.<br />
* [http://speed-dreams.sourceforge.net/ Speed Dreams] - A fork of the TORCS, aiming to implement exciting new features, cars, tracks and AI opponents to make a more enjoyable game for the player, as well as constantly improving visual and physics realism.<br />
* [http://supertuxkart.sourceforge.net/ Super TuxCart] - A free 3D kart racing game<br />
* [http://code.google.com/p/vdrift-ogre/ Stunt Rally] - A racing game that focuses on closed rally tracks with possible stunt elements (jumps, loops, pipes). It uses VDrift for car simulation.<br />
<br />
[[Category:General]]</div>Timo 6http://wiki.vdrift.net/index.php?title=Reporting_problems&diff=1235Reporting problems2012-09-01T10:20:26Z<p>Timo 6: Change category -> General</p>
<hr />
<div>This page will give you a good idea of how to report problems to the project in a useful way.<br />
<br />
==Before reporting==<br />
Here are some things you should do before reporting issues to us:<br />
* Make sure you've got the latest version of VDrift from the [http://vdrift.net/ VDrift homepage].<br />
* Read the release notes for the version of VDrift you are using, and the platform you are running it on. Be sure to check the Known Issues section.<br />
* Make sure you've got the latest drivers installed for your video card.<br />
* Find a way to reproduce the problem, if you can.<br />
* Search the forums and check the issue tracker for topics already containing your problem. At least read through the most recent posts in the [http://vdrift.net/Forum/forumdisplay.php?fid=5 Help] and [http://vdrift.net/Forum/forumdisplay.php?fid=7 Bugs] forums and the open issues on [https://github.com/VDrift/vdrift/issues GitHub] to make sure this it hasn't already been reported. If it's a big problem, the likelihood is that there's a topic about on the front page of the site.<br />
<br />
==Tips for reporting problems==<br />
If you've done everything above, and still have a problem, report the issue in the [http://vdrift.net/Forum/forumdisplay.php?fid=5 Help] or [http://vdrift.net/Forum/forumdisplay.php?fid=7 Bugs] forums, following these tips:<br />
* Put a meaningful title on your thread.<br />
** "Please help me" or "problem with game" do not tell us anything at all. You need not say that there's a problem, after all you are in the Help forum.<br />
** Here are examples of good topics: "Car won't shift gears", "lap is not triggered", "AI car turns wrong way", "HUD is not drawn". These topics are all short, but tell us what the topic is about before we read it. It is also much easier to search through topics when they have good titles.<br />
* Make sure you provide every bit of information you know, even if you think we might not need to know it. This will help us reproduce and fix the problem faster.<br />
** Always include details about your hardware, operating system and library versions. This helps us tell where the problem lies. We can't help or begin to debug a problem until we know where it is. There are many more things that cause problems besides the game code - problems can be caused by hardware (including CPU, memory, video card, sound card, video memory), operating system, drivers (for video and sound, mainly), or the libraries used on your system (this applies mainly to Linux and FreeBSD).<br />
** Give as many details about how to reproduce it as possible.<br />
** If you can, include a screenshot of your problem.<br />
* Use your very best English. It's the only language we all understand. The better you write, the easier and quicker it is for us to understand your problem. We understand if you make a few mistakes, but please do your best.<br />
** If you are not a native English speaker, we will do our very best to understand you.<br />
** If you are a native English speaker, we should not have to spend extra time trying to decipher your post, just because you are too lazy to spell correctly and use correct grammar and punctuation.<br />
** These things are sometimes hard to describe. Take your time and write as much as you need to tell us about your problem.<br />
* Check back regularly after reporting a problem. We may have questions or possible solutions, as well as tests we may need you to run so we can discover more about how the game runs on your system. Try to respond as quickly as possible, and we'll do the same.<br />
<br />
==Examples of reports==<br />
Here's a bad example of a bug report:<br />
Topic: HELP OH NO!!!!!!<br />
when i start up the game it shows some stuff and then goes away what do i do how do u fix it<br />
Here's a good example of a bug report:<br />
Topic: Crash in latest Windows release<br />
Hi, I downloaded the full version of VDrift for Windows (version 2007-03-23) and it crashes<br />
whenever I try to start a new game. The menus all function correctly. My system is Windows XP<br />
SP2, P4 2 GHz CPU, 1 GB RAM and GeForce 5600 video card with nVidia drivers 9.4.3.2.<br />
<br />
[[Category:General]]</div>Timo 6