You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This page shows how to compile VDrift from source. It assumes you have downloaded the source code either by getting the source package from the [latest release](Downloading.md), or by [getting the development version](Getting_the_development_version.md).\_\_TOC\_\_
1
+
This page shows how to compile VDrift from source. It assumes you have downloaded the source code either by getting the source package from the [latest release](Downloading.md), or by [getting the development version](Getting_the_development_version.md).
2
2
3
3
Windows
4
4
-------
@@ -9,19 +9,19 @@ Windows
9
9
- Install [MSYS2](http://sourceforge.net/p/msys2/wiki/MSYS2%20installation/) and update local packages.
To compile VDrift just run SCons in the root directory of the sources.
96
93
97
-
`scons`
94
+
scons
98
95
99
96
#### Optional: Compile Options
100
97
101
98
You can use one or more compile options. To compile with optimization for a certain platform, you can use the arch flag:
102
99
103
-
`scons arch=a64`
100
+
scons arch=a64
104
101
105
102
Compiling VDrift in release mode will turn off debugging options, and enable more compiler optimizations. VDrift runs much more quickly in release mode:
106
103
107
-
`scons release=1`
104
+
scons release=1
108
105
109
106
To enable force feedback, use this flag:
110
107
111
-
`scons force_feedback=1`
108
+
scons force_feedback=1
112
109
113
110
You can get a list of all compile time options with:
114
111
115
-
`scons --help`
112
+
scons --help
116
113
117
114
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.
118
115
119
116
### Installing
120
117
121
118
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.
122
119
123
-
`sudo scons install`
120
+
sudo scons install
124
121
125
122
#### Optional: Installation Location
126
123
127
124
There are also some install options - to change where VDrift is installed, use the prefix flag:
128
125
129
-
`scons install prefix=/usr/local`
126
+
scons install prefix=/usr/local
130
127
131
128
### Cleaning
132
129
133
130
Building the project creates several artefacts that do not need to be stored, because they can be regenerated on demand. Cleaning them up can be done with SCons, too:
Copy file name to clipboardExpand all lines: docs/Configuring_the_sound.md
+7-7Lines changed: 7 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,18 +5,18 @@ Sound settings
5
5
6
6
Configuring the sound is done by editing [VDrift.config](VDrift_config.md) 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:
7
7
8
-
`[sound]`
9
-
`volume = 1`
8
+
[sound]
9
+
volume = 1
10
10
11
11
Troubleshooting sound
12
12
---------------------
13
13
14
14
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:
15
15
16
-
`(define devices '(native alsa sdl arts esd null))`
17
-
`(define alsa-device "dsp0")`
18
-
`(define speaker-num 2)`
19
-
`;(define sampling-rate 22050)`
16
+
(define devices '(native alsa sdl arts esd null))
17
+
(define alsa-device "dsp0")
18
+
(define speaker-num 2)
19
+
;(define sampling-rate 22050)
20
20
21
21
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.
22
22
@@ -34,7 +34,7 @@ On older versions of OpenAL, ALUT was part of the OpenAL library. At some point
34
34
35
35
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:
36
36
37
-
`scons old_openal=1`
37
+
scons old_openal=1
38
38
39
39
For more information on the build system see [Using SCons](Using_SCons.md).
- 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.
53
53
- 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.
Copy file name to clipboardExpand all lines: docs/Debugging.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ General
5
5
6
6
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:
7
7
8
-
`vdrift -verbose`
8
+
vdrift -verbose
9
9
10
10
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.
11
11
@@ -18,23 +18,23 @@ If the game crashes it is easiest to get information about the crash from GDB, t
18
18
19
19
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:
20
20
21
-
`scons release=0`
21
+
scons release=0
22
22
23
23
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**):
24
24
25
-
`gdb build/vdrift`
25
+
gdb build/vdrift
26
26
27
27
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.
28
28
29
-
`(gdb) run -verbose`
29
+
(gdb) run -verbose
30
30
31
31
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.
32
32
33
33
#### Obtaining a backtrace
34
34
35
35
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:
36
36
37
-
`(gdb) backtrace`
37
+
(gdb) backtrace
38
38
39
39
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.
Copy file name to clipboardExpand all lines: docs/Drift_scoring.md
+4-11Lines changed: 4 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,17 +31,10 @@ At the beginning of a drift, the game starts accumulating the score for this dri
31
31
-**Base score** - This is simply the length the car has travelled in this drift (in meters). A longer drift will earn higher base score.
32
32
-**Bonus score** - This contains 3 components:
33
33
-**drift length bonus** - same value as the base score, effectively giving double bonus to longer drifts.
34
-
-**maximum drift speed bonus** - the value is
35
-
36
-
`the maximum drift speed (in m/s) / 2`
37
-
38
-
e.g. a maximum drift speed of 20 m/s will earn a bonus of 10.
39
-
40
-
--**maximum drift angle bonus** - the value is
41
-
42
-
`the maximum drift angle (in radian) * 40 / PI`
43
-
44
-
e.g. a maximum drift angle of PI/4 (45 degrees) will earn a bonus of 10.
34
+
-**maximum drift speed bonus** - the value is the maximum drift speed (in m/s) / 2
35
+
- e.g. a maximum drift speed of 20 m/s will earn a bonus of 10.
36
+
-**maximum drift angle bonus** - the value is the maximum drift angle (in radian) * 40 / PI
37
+
- e.g. a maximum drift angle of PI/4 (45 degrees) will earn a bonus of 10.
45
38
46
39
If the car goes off track or spins out during a drift, the accumulated drift score is not added to the total score. An accumulated drift score of less than 5 is not added to the total either.
0 commit comments