The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register

TORCS Endurance World Championship 2008 Rules

0. About this Document

1. Introduction

2. Process Description

3. Ranking

4. Point System

5. Rule Changes

6. Technical TORCS Rules

7. Technical Robot Rules

8. Championship Rules

9. Gentlemen Agreement

10. Appendix

0. About this Document

0.1. License and Copyright

Copyright (c) 2004-2008 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.

0.2. Document Version

2008-03-02.

1. Introduction

Welcome to the "TORCS Endurance World Championship". The championship consists of races over approximately 500km on various suitable road tracks. The robots are rewarded with points for their rank in the races. Based on these results the standings of the driver and team championships are computed. To run the races TORCS-1.3.1 is used with the trb track package. There will be approximately one race every 3-4 Weeks. To avoid cheating every competitor is invited to run the races on his own system and submit the results to the TORCS Racing Board. To get as much results as possible the submission is rewarded with points for the team championship [1].

Due to missing interest there will be no preparation races. Signing in your team is extended, you can like in the former seasons sign in before the first race, or, newly, during the season in the robot upload phases.

"Gentlemen, start your processors."

2. Process Description

To attend the championship you have to follow the steps below.

  • Develop a robot which satisfies the rules.
  • Create an account on The TORCS Racing Board (you will be first a 'spectator').
  • Change your account into a 'racer' account. You can find a link in "Your Account", you have to solve a quiz [2].
  • Create a team which satisfies the rules (e.g. choose an allowed car).
  • Register your team for the championship (if the season is already in progress you can just register your team during robot upload phases).

The races have three phases.

  • Robot upload phase, all competitors can update their robots on the server.
  • A racing phase, where all competitors willing to run the race download and install all robots and run the race (type is "Endurance Race").
  • Result submission phase, where the competitors can submit their results. The submission itself is rewarded with two points. Obviously you can still run the race in this phase.

If you visit the event page you can get a detailed schedule. If you want to update your robot or to submit a result it is your duty to visit the site (at the moment there is no mail or SMS notification set up).

3. Ranking

The rank of a driver in a race is computed from the median of all potential [3] points for that driver in that race. If the number of submissions is even the points are defined by the arithmetic mean of the two elements in the middle.

4. Point System

The drivers get points depending on their rank in the race. The team gets the sum of its driver points plus two points for result submission (just one submission per race and user). If a user has more than one team in the championship, the two submission points go to the team with the fewest [4] points after the actual race or if all teams have the same amount of points to an arbitrary team of the user.

Rank 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
Points [5] 20 18 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

5. Rule Changes

  • 5.1. If problems with the rules are discovered they can become adjusted during the championship.
  • 5.2. The updated rules are just applied to the upcoming races, the former results are not affected.
  • 5.3. Changes are discussed in the TORCS Racing Board forum.
  • 5.4. Rule changes are accepted or rejected via voting, where every team owner has exactly one vote, independent how many teams it owns.
  • 5.5. A rule change must get more than the half of all votes (all users having teams in the championship) to become accepted.
  • 5.6. The process owner (the operator of the board) is allowed to change the form (not the meaning) of the rules without further notice or permission.
  • 5.7. The process owner is allowed to change the required TORCS version/patches if new versions/patches become available without permission.

6. Technical TORCS Rules

6.1. TORCS Installation and Setup

To be able install and compile the robots the following environment must be set up.

  • 6.1.1. Vanilla TORCS-1.3.1 on Linux plus the trb track package (required package list). If a competitor wants to run races on another platform this is allowed. Be aware that the submitted robots might not compile/run on anything different than Linux, so it is your responsibility to decide if you can warrant a fair race on your platform.
  • 6.1.2. If problems are discovered fixes might be applied during the championship.
  • 6.1.3. simuv2 is used as simulation engine, that is the default.
  • 6.1.4. The environment must be set up according to the robot tutorial ($TORCS_BASE, $MAKE_DEFAULT, permissions).
  • 6.1.5. The used skill level is the default (semi pro).
  • 6.1.6. Pit sharing must be enabled (edit ~/.torcs/config/raceman/endrace.xml, add <attnum name="cars per pit" val="2"/> in the section "First Race").

6.2. TORCS Runtime Problems

  • 6.2.1. If TORCS is not able to run a race because of a TORCS bug the race is repeated after the last race of the championship.
  • 6.2.2. For the new race it is allowed to submit an updated robot.
  • 6.2.3. Not able to run a race means that more than half of the competitors willing to run the race were no able to do so.
  • 6.2.4. If the problem becomes not fixed till the end of the championship the race is cancelled.
  • 6.2.5. If a robot is causing a runtime problem which prevents TORCS from finishing the race, the robot is removed and the race is restarted.

7. Technical Robot Rules

7.1. Robot Module

  • 7.1.1. The robot module name should consist of lowercase letters, followed by an underscore and the year of the championship (^[a-z]+_2007$), e. g. "damned_2007" [6].
  • 7.1.2. The robots names are free but must not match one of the stock robots of TORCS 1.3.1.
  • 7.1.3. The robots module must be licensed under the GPL and must not contain any precompiled object files.
  • 7.1.4. The robots code must not be obfuscated.
  • 7.1.5. The robots must compile on g++ > 3.0 (namespace prefix, using, header files etc).
  • 7.1.6. If you use a random number generator you have to make sure that it delivers everywhere and anytime the same results.
  • 7.1.7. Car textures size should be 512x512 or 1024x1024.
  • 7.1.8. Pit texture size should be 128x128 or 256x256.
  • 7.1.9. The compressed archive size must not exceed 500kb.
  • 7.1.10. The archive is submitted as "tar.bz2", e.g. damned_2007.tar.bz2.
  • 7.1.11. The driver names should contain the year of the championship, e.g "damned 2007 1" [6].
  • 7.1.12. The submitted robots are required to build/run in the Linux environment.
  • 7.1.13. Be aware of the shared pits, adopt your robot such that the code does not crash and still finds its pit.

7.2. Robot Code Rules

  • 7.2.1. The robots must behave nice on the host system, it is forbidden to take any actions which are not necessary for racing, e. g. forbidden is replacing trackgen with a custom shell script, connect to the network, deleting, creating and manipulating files. It is allowed to read data files shipped with your robot.
  • 7.2.2. The robots must not manipulate any data in the simulation explicitly, except the car->ctrl structure and its own (the robots module) data (e. g. it is forbidden to get somehow a pointer to "damned 4" data and to modify it).
  • 7.2.3. The robot must compile with a simple "make" in the environment specified above.
  • 7.2.4. If a robot module causes problems with TORCS it gets excluded from the current race.
  • 7.2.5. On a system with 256MB RAM, 1GHz CPU it should be possible to run 10 of your robots fluently (average > 40FPS).
  • 7.2.6. On a system with 256MB RAM, 2GHz CPU it should be possible to run 20 of your robots fluently (average > 40FPS).
  • 7.2.7. Writing data files is allowed below .torcs/drivers/drivername (Linux, FreeBSD) or driver/drivername (Windows).

8. Championship Rules

8.1. Team Rules

  • 8.1.1. A team consists of one owner, one robot module and two cars of equal type.
  • 8.1.2. Each car of the team is allowed to have its own setups and behaviour.
  • 8.1.3. Teams are not allowed to share data during the race or to cooperate.
  • 8.1.4. The two cars of one team are allowed to cooperate.
  • 8.1.5. A team must not treat any other specific team or car in a special way (e. g. it is not allowed to try to crash into "inferno 1" because it is "inferno 1").
  • 8.1.6. If we have enough space a team owner might have more than one team per race.

8.2. Car Rules

  • 8.2.1. The allowed cars for this championship are listed on the board.
  • 8.2.2. You must not change the car during the championship.

8.3. Setup Rules

Robot(s) are allowed to alter car settings during the "track initialisation" via

  • 8.3.1. *carParmHandle = GfParmReadFile(filename, GFPARM_RMODE_STD).
  • 8.3.2. GfParmSet* calls.

Robots are allowed to alter the following car settings:

  • 8.3.3. Initial fuel.
  • 8.3.4. Front and rear wing angle where available.
  • 8.3.5. The gear ratios.
  • 8.3.6. The differential type and ratio.
  • 8.3.7. Front-rear brake repartition and max pressure.
  • 8.3.8. Wheels:ride height, toe and camber.
  • 8.3.9. Anti rollbars: spring and bellcrank.
  • 8.3.10. Suspension: spring, suspension course, bellcrank, packers, slow/fast bump, slow/fast rebound.
  • 8.3.11. All other settings must not be modified!

8.4. Racing Rules

  • 8.4.1. Robots are not allowed to hinder overlapping opponents, it is required to let the overlapping opponent pass. As reference for good behaviour you can take the bt or berniw robots.
  • 8.4.2. The Robots must try to avoid collisions with opponents.
  • 8.4.3. The assigned racing numbers must be clearly visible on the cars.
  • 8.4.4. It is forbidden to "park" on the race track, in the pit lane or in the pit of an other team intentionally [8].
  • 8.4.5. The drivers must respect the pit speed limit.

8.5. Penalties, Cheating and Protest

  • 8.5.1. If someone cheats its points for the corresponding race are deleted, but the points of the other competitors are not altered.
  • 8.5.2. To conclude that someone has cheated (defendant), someone (accusant) must ask for an investigation, voting decides if there was cheating. The defendant and accusant are not allowed to vote. To apply the penalty more than the half of the cast votes must confirm cheating.
  • 8.5.3. The accusant must exactly specify what is wrong.
  • 8.5.4. If you found a cheat you must file the protest before the next race [9].

8.6. TORCS Racing Board Rules

  • 8.6.1. It is not allowed to submit tweaked result files.
  • 8.6.2. It is forbidden to publish or discuss race results before the result submission phase is over [7].

9. Gentlemen Agreement

Like the section title tells this are not hard rules.

  • Do not "steal" code of the other robots during the championship.
  • It is allowed to take the bt robots as base.
  • The robot should behave reasonable.
  • Do not cheat.
  • Register just one user.
  • Never forget that the competitors are human beings like you, so be very careful with protests etc.

10. Appendix

10.1. Definition of Terms

  • Team owner: A person which represents/owns one or more teams. It is responsible for the submission of the robot modules and for delivering its race result.
  • Team: A robot module which offers two robots which drive the same type of car.
  • Robot module: Shared library.
  • Robot: One "instance" of a driver.
  • Median: The element in the middle of a sorted list of values (odd number of values) or the arithmetic mean of the two elements in the middle (even number of values), e.g. for {3,3,3,4,5} the median is 3, for {3,3,3,4,5,9} the median is (3+4)/2 = 3.5.

10.2. Finding Runtime Problems

To find the cause of a runtime problem during a race you can attach with GDB (and optionally with a nice frontend like ddd) to the running torcs-bin process. Investigate the call stack to find out where the problem is located.

10.3. Reasoning

10.4. Required TORCS Packages

To attend this championship you need to install TORCS from the following packages. You can find them on the TORCS site. Of course it does not hurt if you install more.

  • TORCS-1.3.1-src.tgz
  • TORCS-1.3.1-data.tgz
  • TORCS-1.3.1-data-tracks-road.tgz
  • TORCS-1.3.1-data-cars-extra.tgz
  • TORCS-1.3.1-tracks-trb.tgz

10.5. TORCS Installation Recommendation

Because we will run foreign code of people we do not know, I strongly recommend to use a dedicated user and TORCS installation to run the races. I did the following:

  • Created a new user "racer".
  • Installed TORCS below its home directory ("./configure --prefix=/home/racer/torcs_bin").
  • Set up the required environment variables (have a look into the robot tutorial).

10.6. Reading and Writing Data Files

If you use custom data files for your robot you should follow these guidelines:

  • If you write non ASCII data files you must open it as binary file for reading and writing, otherwise it might fail on some platforms (e.g. with fopen use the "b" option).
  • Be aware that TORCS might run on a 32 or 64 bit platform, or on little or big endian machines. It is currently your responsibility to ensure that the data is correctly read and written.
  • You can find a check for #bits and endianness in bt_2006, learn.cpp
  • To write local data files you can use GfCreateDir(path):
    // create ".torcs/drivers/gaga/1", INDEX = 1
    #include <tgf.h> // in bt derivates already done in driver.h
    #include <portability.h>
    snprintf(path, SBSIZE, "%s%s%d", GetLocalDir(), "drivers/gaga/", INDEX);
    if (GfCreateDir(path) == GF_DIR_CREATED) {
    	...write file
    }