The TORCS Racing Board
Username: Password: Remember Me?
Lost Password Register
Author: 0laf | Created: 2017-12-12 20:42:22
Subject: Creating new track: Seeking work flow advice
Hi everyone,

I recently decided to create my first racing track :o .
I am able to create tracks and load them into torcs, no problemo.
But I was wondering if there is a more efficient approach.

My work flow at the moment is as follows:

1) Use the java track-editor to create a layout
2) Export the track from within the track-editor
3) Copy it to my torcs installation
4) Test drive it
5) Scratch my head
6) Back to the track-editor, adjust a specific road segment
7) Re-adjust the following segments to have a closed circuit again

Now the 6) and 7) is where I have trouble. I would only want to work on a specific segment,
but changing the parameters of one road segment in the track-editor influences all following segments.
Step 7) is always a rather tedious task.

Am I missing something?
Does the track-editor offer some additional feature to prevent this?

If not, are there better ways / tools to design a track for torcs?
And what has been your preferred work flow when designing a track layout so far?

Plus: How do you precisely match up the start and end segments of track?

Thank you so much,

Last Edited: 2017-12-12 20:42:22 by 0laf
    Author: firechief | Created: 2017-12-13 10:58:07
    Subject: Re: Creating new track: Seeking work flow advice
    Hi Olaf, welcome to the forum ...

    My general workflow is as follows:-

    1) Create a hi-res image of the track using Inkscape. You can find a tutorial for getting started in Inkscape at

    I spend as much time as I can honing the layout here, as its much easier to make adjustments at this stage than later on. I think about where I want runoff areas, where grandstands should be & so on.

    2) I use the image from Inkscape as the background in order to create the TORCS track using the java editor. I pay very careful attention to where I want changes of slope, and to where I want to start/end different trackside elements such as kerbs, grass/sand and fence/tire wall, as this will dictate where I start & stop segments.

    3) I match up the start & end of the track by selecting the most recent corner before the final straight, then zooming in as close as possible to the start/finish line. Then I edit the corner's values as needed in order to get it to match up. A bit tedious, but its not too bad really.

    4) Generate track, test drive in Torcs, rework in editor etc until I'm happy with it.

    5) In the editor I go through each segment, making sure the boundary, side and barrier for both left & right are set to the appropriate textures & types. Also making sure that kerbs are the height I'm looking for.

    6) Generate, test drive with a robot, looking carefully at the track for any mistakes.

    7) Generate, close Java editor, open track xml in a text editor. In this file I set the end height, grade and profile for each segment, along with cambers. It can't be done using the java editor as there's a bug that prevents changes being stored correctly.

    8) Generate track from commandline, test drive, etc etc. Got to go slowly at this stage in order to get the elevation changes how I want them.

    9) From here on its mostly artwork. Introducing my own textures, using a 3D editor (ac3d in my case) to set the old TORCS textures to the new ones, creating & placing 3D objects and editing the terrain around the track (this can be very time-consuming). More generation/test driving etc to ensure there's no bugs & things look how I want them.

    10) Creating a shadow image (I use povray, I'm sure there's other tools that could do it better). Obviously I need to work out where I want my sun to be & how low in the sky (which I need to position in the track xml as well). I save one copy of this image, resized to 1024x1024 and with only shadows that cross the track area, everything else is white. This file must be called trackname2.rgb where trackname is the name of your track, and TORCS uses it to make cars darker when they drive through shadows.

    Back in the higher-res version of my shadow file, I usually then draw a bunch of textures for the landscape & overlay it with the shadows using the multiply filter. See the shadow images in Hidden Valley or Dirt-3 for examples. Looks a lot more interesting than a repeating tiled texture all over the landscape. This then gets saved as a png file, again scaling the image so its dimensions are a power of 2.

    11) Creating a shadow 3D file. There's a commandline thing for that, but I usually do this by creating a copy of the base 3D file, deleting all the buildings & fences (anything upright in fact) as shadows should only be applied to the track and landscape - they look ugly on anything with a vertical surface. I then set the texture of all the 3D objects to my png shadow file & remap them from above.

    12) Running whatever the accc command is (can't remember the arguments off the top of my head) to produce the .acc file, which is needed in order for TORCS to display the shadows and also to boost graphics performance.

    13) Panic when accc crashes, or when the track in TORCS has horrible graphics glitches. Hack around until I find whatever's wrong and finally get it to work.

    In short, creating a track is a labour of love that will soak up a lot of time. Can be very satisfying though. Good luck in your endeavours!
    Last Edited: 2017-12-13 11:08:24 by firechief
      Author: phi | Created: 2017-12-13 11:52:50
      Subject: Re: Creating new track: Seeking work flow advice
      «creating a track is a labour of love», indeed...

      I've thought of exploring this area, but I never assumed it was so complex and it needed a lot of resources. Anyway, this is a good tutorial for anyone venturing into this field, and undoubtedly brings much light on the subject. Nice post.
      Last Edited: 2017-12-13 11:52:50 by phi
      Author: 0laf | Created: 2017-12-13 22:45:32
      Subject: Re: Creating new track: Seeking work flow advice
      Hi Andrew,

      Wow. Thank you for your detailed description (must have taken some time).
      This is tremendously helpful!
      I guess I underestimated the required effort to create a good track,
      but I will take it step by step :) .

      Btw, your Brondehatch track is one of my favorites
      and it will certainly serve as an inspiration.

      Thank you,
      Last Edited: 2017-12-13 22:45:32 by 0laf
        Author: firechief | Created: 2017-12-14 00:33:41
        Subject: Re: Creating new track: Seeking work flow advice
        You're welcome olaf - I did skip quite a few details in my post though, so if you get stuck at any stage please feel free to ask :)
        Last Edited: 2017-12-14 00:33:41 by firechief
          Author: 0laf | Created: 2018-01-01 20:46:26
          Subject: Re: Creating new track: Seeking work flow advice
          Hi Andrew,

          During my winter holidays I started working on a converter (svg path -> basic track xml).
          Do you eventually have some svg paths which I could use for testing?

          Thank you
          Last Edited: 2018-01-01 20:46:26 by 0laf
          Author: 0laf | Created: 2018-01-27 20:56:11
          Subject: Re: Creating new track: Seeking work flow advice
          Hey everyone,

          I did not have much time during the last weeks,
          but the svg path to torcs track xml util works quite ok already.
          I have uploaded a sample screenshot here:

          There are still a few things though that need improvement:
          * Code (restructuring)
          * Support straight segments xD
          * Command line options
          * Update existing XML (retain sides, barrier, height, etc. This should be useful, when you just would like to rework a certain part of the track, and already did lots of editing in the XML file via trackeditor or manually)
          * Start/end mismatch. The start and end segments are not well aligned (+-/ 0.05 m for the test track on the screenshot). Something I have to investigate further. Initially I thought this is down to torcs using float32. So I added a "second pass" where each turn endpoint is calculated with float32 precision and the final turn segment is fitted again to remove the accumulated float32 error. But the start/end error displayed by trackgen only decreased by 50%. Not yet satisfactory =D .
          * Probably more

          However if one of you would want to give it a try, I can hurry up :D and put a first version online.

          Thank you,
          Last Edited: 2018-01-27 20:56:11 by 0laf
            Author: phi | Created: 2018-01-30 15:48:58
            Subject: Re: Creating new track: Seeking work flow advice

            I'm not entirely aware of the problems that the track-building area brings, and I'm not thinking of shooting myself so fast for her. So, I am not the best person to realize the relevance and interest that your program has, but I believe it will be of some interest. Thank you for sharing your work, and I hope you can develop it effectively and take it to a productive way.
            Last Edited: 2018-01-30 15:48:58 by phi