Building a new track

 

Home Building your own track gives the best results probably.


Dolphinity Organiser - free planning and organizing software for all your todo and action lists

CREATING A NEW TRACK

Racer is designed to allow you to create new tracks relatively easy. Still, a track is not too trivial to make. Normally, I'd use 3D Studio Max to generate the objects and convert the lot to Racer's DOF format using the ASE export format. Tracked (the tool to batch convert model files, add grid position etc) is mostly targeted around a 3D Studio Max workflow.

As for generic development of any content, a special page is dedicated to help you fix bugs faster and easier.

UTILITIES TO USE

TIPS

WHICH 3D MODELER TO USE

For tracks, I'd recommend using 3D Studio Max and export using ASE. Racer is geared for Max's workflow where you use multisub materials in combination with lofts to create full-track ASE's that get split with TrackEd. For an export-split-import cycle you then need a couple of minutes after the initial work is done (setting up a track directory, grid/pit positions etc). A detailed talk about 3D modeling packages for Racer is here.

The basics of track creation is certainly lofting. To help you loft, here's some links that explain lofting for 3D Studio Max:

If you (want to) use Blender, there were export filters in the past by Stephen Doughty, but I haven't seen those since April 2006.

Adding splines

Adding splines is necessary to create a smooth road surface. Actually creating splines is documented here. Without splines, the road will feel bumpy as you drive from polygon to polygon. Also, the splined surface is used for things like the minimap, lap distance calculation and AI lines.

Even though the spline is important for a number of things, you can choose to drive on polygons nevertheless. When tesselating to a maximum triangle size of around 0.5m, it seems reasonably ok to drive on the mesh directly instead of the (very smooth) spline. This may be useful; to use that, in spline.ini set lines.use_mesh_hits to 1.

Adding surface types

Differences between grass, road, kerbs etc. The surfaces are defined in the track's special.ini file. Detailed information can be found here.

Adding an environment map

Each track can have its own default environment map, which is reflected on the cars using a shader's special $trackenvmap. This map can be updated live (quite costly on the GPU) by setting racer.ini's envmap.live_track to 1. If set to 0, the 6 files data/tracks/<yourtrack>/track_<dir>.tga are loaded, where <dir> = lt, rt, up, dn, fw, bw.

It might be easiest to create a default environment map (which renders much faster than using live maps, although graphically it's not as interesting) by driving to a nice spot, and entering the 'trackmap save' command in the console. It will display a message stating it is going to save. Only after rendering the next frame (or really the next environment map update) will the maps be saved and a message indicating this happened will be printed. After the save, copy the track_*.tga files in data/dump to your track directory. Make sure also that there are shaders using the special $trackenvmap map, otherwise you won't be able to see it.

Adding 3D start light objects

Racer v0.5.8+ supports upto 3 light objects in 3D, to enhance the start sequence of the race. You add the light models in geometry.ini as usual, and Racer will selectively turn them on or off. In special.ini, you indicate the 3 objects by their name in gfx.lights. I.e. 'lights=start_lights_top start_lights_middle start_lights_bottom'. Then start Racer (with race.quickstart=0 in racer.ini) and test it. The sequence is: all off, object1 on, object1+2 on, object1+2+3 on, all off again (5 steps).

Adding AI and default AI driving lines

AI files are used to make cars drive on their own. The files live in the track's 'ai' directory. Normally it is good to have specific AI files for specific cars, but a default AI file can also be created, which will be used for cars that don't have specific AI files created for them (yet). The default AI file is data/tracks/<trackname>/ai/default.ini.

Note that AI requires a spline being present. If no spline is defined, the AI car will stand still.

The AI works by recording the car's velocity and lateral position at every spline line. When a car's AI is enabled, the car will try to match that velocity by accelerating, braking and turning. An AI car will always use an automatic gearbox, so make sure you car supports that.

To define an AI line: select a car and track for which you want to make an AI line. Start a race and press Ctrl-F6. Drive a good lap (actually the start/finish speed is the hardest part to match up nicely, so it's good to start quite far in front of start/finish so you have the right speed at start/finish, or just drive a lap first and before crossing the start/finish line press Ctrl-F6). You'll see progress being reported in the console (if not enabled, try pressing Ctrl-~ and Enter to get it enabled) as you drive along the track. After you cross start/finish agani (hopefully with about the same speed and lateral position as you started, to make a smooth connection between AI laps), press Ctrl-F7 to save the AI line in the track's ai/ directory.

The saved AI line will be in the ai directory of the track. Optionally rename or copy it to 'default.ini' and it will be used for cars that don't have a specific AI file.

Test the AI by turning AI on using Shift-A (which toggles AI for the current car, or use the console commands 'ai on' and 'ai off'). If the car spins off, you might need to tweak things a bit:

To explain how Racer uses the default AI line: if no car-specific AI line is found, the ai/default.ini file is loaded. After that, all velocities are normalized so the top speed becomes 1.0 (0.0 will still be velocity=0). Then, the car has an ai.max_velocity setting in its car.ini file, which is used to scale the AI velocities to match the capabilities of the car. So if ai.max_velocity=50 and the maximum velocity in the default.ini is 75, the car will scale all velocities in the ai/default.ini file so that it's maximum velocity is 50 again (all values are multiplied by 50/75).

Adding pacenotes

You might want to add rally-style pacenotes. You will need splines for pacenotes to work. Here's how:

While editing, you can also use the following:

Adding a pits

Pitstops are not really supported yet. However, you can define pit locations, and an entry to the pits (upon which the car doesn't really do anything). Racer requires at least 1 pit location to be defined. If not, Racer will refuse to load the track.

Debugging the track

While developing, regularly check the QLOG file (see the documentation on fixing warnings) to see if there are any warnings related to your track. Try to remove all warnings before you release the track to the public.

Adding rain

Rain can be added statically to a track. See the specific page on adding rain to tracks.

Adding snow

Snow can be added statically to a track. See the specific page on adding snow to tracks.

Adding waving flags

Often, tracks have flags on some parts of the track. v0.8.3+ has support for waving flags; see the waving flag tutorial.

Adding a sky

Skies are much more involved since v0.7.2. Previously you used skydomes that were textured regularly, but these days you can use Cg shaders to make a much nicer sky.. See the specific page on atmospherical scattering.

Distributing your track

Once you have your track working satisfactorally, you probably want to distribute your track on the internet. Normally you just have to zip up your entire track directory, but run by this checklist before distribution:


Organiser -planning, organiser and time billing software

(last updated June 28, 2010 )