Copyright (c) 2004-2026 Bernhard Wymann.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is available here.
2026-03-31.
TORCS, The Open Racing Car Simulator, is a car racing simulation, which allows you to drive in races against opponents simulated by the computer. You can also develop your own computer-controlled driver (also called a robot) in C or C++. TORCS is "Open Source" (GNU General Public License Version 2 or later).
The TORCS project has been created by Eric EspiƩ and Christophe Guionneau. Currently Bernhard Wymann, and other contributors continue to develop the project.
There are many different cars and tracks, and around 100 opponents to race against. You can steer with a joystick, gamepad or steering wheel, if it is supported by your platform. It is also possible to drive with the mouse or the keyboard. Graphic features lighting, smoke, skid marks and glowing brake disks. The simulation features a simple damage model, collisions, tire and wheel properties (springs, dampers, stiffness, ...), aerodynamics (ground effect, spoilers, ...) and much more. The gameplay allows different types of races from the simple practice session up to the championship. Enjoy racing against your friends in the split screen mode with up to four human players.
In TORCS a "robot" is a piece of program code that drives a car, so all the opponents you choose are robots.
We will switch sooner or later because of graphics context handling, portable threading, networking etc.
Currently there are none organized by the TORCS team, but if there is interest we could start doing them again. There might be championships organized by conferences, universities, or companies, so keep an eye out.
Probably not. Why? Do a search on SourceForge and common search engines, you will find between 15 and 40 open source car/driving/racing sim projects, and most of them have been "promising" and died. Instead of starting another dead project contribute to the few existing successful ones.
Believe it or not, but your project will very likely be a dead one as well. The reason is quite simple, people underestimate the required effort and the change of their lives during the project lifespan, think about it. Just that you get an idea, TORCS turns now 30 in 2027.
Linux (x86, AMD64 and ppc are known to work), Windows and FreeBSD.
By today's standards, almost any modern system is sufficient.
Minimum: 400MHz CPU, 128MB RAM, OpenGL 1.2 compatible graphics card with 16 MB RAM.
Recommended: 600MHz CPU, 256MB RAM, OpenGL 1.3 compatible graphics card with 64 MB RAM.
By today's standards, almost any modern system is sufficient.
Minimum: 550MHz CPU, 128MB RAM, OpenGL 1.3 compatible graphics card with 32 MB RAM.
Recommended: 800MHz CPU, 256MB RAM, OpenGL 1.3 compatible graphics card with 64 MB RAM.
You need recent, working and properly configured OpenGL/DRI drivers. You need also several libraries. To avoid problems you should prefer FreeGLUT over GLUT. Make sure that you use exactly plib version 1.8.5. For AMD64 you need to set the "-fPIC" compiler switch when compiling plib (export CFLAGS="-fPIC", export CPPFLAGS="-fPIC", export CXXFLAGS="-fPIC"). You need as well OpenAL.
You can find installation instructions in the README file.
You may encounter this kind of problems: system configuration problems, build problems and runtime problems. If you face a problem, follow these steps:
Download and install FreeGLUT or install GLUT which is probably included in your distribution (you need also the header files, which may be in a separate package like glut-devel). I suggest using FreeGLUT.
TORCS requires plib 1.8.5 and its header files. Download and install plib.
To compile TORCS in Windows you need Visual Studio 2022 (for the other versions you have to adapt the project files by yourself, but this is usually pretty easy and done quickly). Follow exactly the instructions in the README file to build a release.
You have some environment variables set like $TORCS_BASE and $MAKE_DEFAULT (to follow the robot tutorial), they are pointing now to the wrong directory. Unset or update the variables suitable for the new directories.
If the compiler stops with the above message you have probably OpenGL header files installed which do not define the GL_TEXTURE0_ARB and other symbols. To fix it for TORCS you need to install a gl.h which defines the missing symbols. You can get it e.g. from Mesa.
the command is incorrect. Error executing `c:\winnt\system32\cmd.exe`"
You have probably installed your sources in a path which contains blanks or other special characters, e.g. on the desktop. Move your torcs-1.3.9 folder to a location with a "clean" path, a drive is the best bet (e.g. D:\\torcs-1.3.9).
In several situations TORCS will crash at startup. The causes are often not bugs of TORCS, but a broken installation or buggy OpenGL/DRI drivers.
There are two known possibilities which cause such a crash:
You have probably two GLU libraries installed on your system and TORCS has been linked to the wrong one, which does not export the "gluBuild2DMipmaps" symbol. First find all your GLU libraries on the system (cd /usr; find . -name "*GLU*"). Then check which one exports the "gluBuild2DMipmaps" symbol (e.g. nm ./lib/libGLU.so | grep gluBuild2DMipmaps). Finally move or remove the GLU libraries which do not define the symbol, such that the linker can't see it. Now recompile and reinstall TORCS.
If you see such a message you have probably not cleaned up your old TORCS installation. Make sure that you have removed all old TORCS files, then recompile and reinstall TORCS.
You have build TORCS from sources and forgot to run make datainstall on Linux or setup_win32-data-from-CVS.bat on Windows.
You have a screen resolution which is not available in the selection menu of TORCS (e.g. 1152x864). Exit TORCS and edit the file .torcs/config/screen.xml, change the x, y, window width and height to your values.
If you switched TORCS to fullscreen you get a scrolling screen or the screen size is not fully utilized. If you use the original GLUT library you should choose the resolution of your screen in the display settings. To fix the problem you can also download and install FreeGLUT, then recompile and reinstall plib and TORCS.
First you have to configure the video capturing in config/raceengine.xml. The captured frames are stored in the output directory, so you need to have write permission and plenty of space (~ 1GB for one minute, depends on framerate and resolution).
During the simulation you can hit "c" to start and stop the capturing. The frames are stored in the output directory and named this way: torcs-ssss-ffffffff.png, ssss is the sequence number and ffffffff the frame number in the sequence.
Now you need a tool to compose the frames to a movie. If you use mencoder (of the mplayer 0.92) you have first to convert the images to jpg's with the png2jpg tool from src/misc/png2jpg. Now encode the video with mencoder -ovc lavc -lavcopts vcodec=mpeg4:vhq:vbitrate=1800 *.jpg -mf on:fps=25.
Yes, you can. Here is a rough guide:
If your operating system supports your device it will also work within TORCS. To learn how to setup your input device visit the TORCS site and read the "how to drive" section.
TORCS supports split screen multiplayer games with up to four players. Setup:
Before you start TORCS make sure that the joystick/wheel is correctly set up/calibrated for the system. You can use the "jscal" and "jstest" utilities for that, you should find them in your Linux distribution. If this works fine center your axis (e.g. if you have noncentering axis like sliders), then start TORCS and set up your players and controls. It is important to center the axis before you go to the calibration.
You should report a problem after you have carefully read the available documentation and did not find a solution for the problem.
First subscribe to the TORCS-users mailing list (otherwise your messages need to be approved, so it can take long till they become distributed). Send us as much information about the problem as you know. At least provide the following:
Please do not file a bug in the bug reporting section on SourceForge, it is not a support area for users (if you know for sure that you have found a bug in TORCS, then it is ok to report it in the bug tracking system).
Use a powerful IDE or IDE/editor plugins for navigating the source code (e.g. ctags, virtual assist x, etc.), AI assistants or integrations, and set breakpoints and explore the call stack. A good development environment can speed you up a lot, so invest some time initially for being much faster afterwards.
Navigate to src/modules/simu, then either simuv2 or simuv3 (simuv2 is the default simulation core for TORCS, simuv3 is outdated and will be removed at some point, but might be interesting for you).
It integrates differential equations with Euler steps, timestep is 0.002 seconds (500Hz, simulation time), look at src/interfaces/raceman.h (macro RCM_MAX_DT_SIMU). The raceengine runs as well with this rate, but the robots are just called all 0.02 seconds (50Hz).
There is no such (maintained) functionality in TORCS currently, but you can easily add it. If you are interested in simulation data you can add some code in the raceengine or in the simulation code, if you are interested in the actions of your robot you can add code there.
The simulation timestep is performed in src/libs/raceengineclient/raceengine.cpp, ReOneStep.
The robots are called all 0.02s (50Hz), do not confuse this with the physics/raceengine simulation timestep which is 0.002s (500Hz).
Yes, since version 1.3.3. This mode is useful for testing as well. All you need is a race configuration xml, the easiest way to create one is using TORCS. As example navigate in TORCS to the race configuration, select "Challenge Race", set up a grid without human players. Then exit TORCS and run from the command line (Linux and other POSIX-like systems):
Any valid race configuration file can be consumed, so you can either set it up by TORCS, edit it manually or generate it somehow. You can think of these XML files as command files for a state engine, have a look at src/libs/raceengineclient/racestate.cpp.
The solution presented here is based on a discussion started by Alessandro Ghidotti Piovan on the torcs-devel mailing list. To feed back commands to the race state engine (src/libs/raceengineclient/racestate.cpp) add a field in the tCarCtrl struct to allow the robot to command the race state engine:
If you use TORCS for your research, please cite it as follows:
B. Wymann, E. EspiƩ, C. Guionneau, C. Dimitrakakis, R. Coulom, A. Sumner. TORCS: The Open Racing Car Simulator, v1.3.6, 2014.