racer home

Tracks - splines

 

Home Use your favorite 3D editor to create tracks, then import the pieces into TrackEd and drive your own track.


Dolphinity Organiser - free planning, project management and organizing software for all your action lists

Introduction

Splines are used in Racer to smooth out the polygonal surface of the track. It is a method to avoid jerky behavior as you move from one polygon to the other.

Racer uses full 3D spline patches to make tracks a lot smoother (indispensable for ovals for example). Try moving the Oval's spline.ini out of the way and then see if you can still drive the track... Ok, now you're convinced. Even for other tracks, the splines give some extra benefits; the program can see your progress (the length along the track for example) and this enables a future position indicator for example.

Splines are important for AI to know their way for example, and for race positions. So they should always be present. However, for some tracks you may just want to drive on the mesh, if it is defined finely enough. This is especially true for rally tracks for example, or tracks where you want specific potholes/bumps.

The technical background of splines (how they work internally) can be found here. Splines are also used when generating track normals; more information on that can be found here.

Files involved

The spline is stored in a track's spline.ini file (i.e. c:\sims\racer\data\tracks\YourTrack\spline.ini).

Creation

You create splines using TrackEd, which came with your Racer installation.

To add splines, you have a spline mode. In that mode, your selections will snap to existing vertices. Select a line, from LEFT to RIGHT (this is important for the program to be able to decypher your driving direction), and click 'Add longitudinal spline' (or press A). The program will try to find the next best suitable location, so sometimes it will be possible to press 'A' multiple times.

Note that you should start your first line AT START/FINISH! This is because of internal reasons where the first spline is seen as the starting point of the track. Racer actually forces the first spline to match the start/finish line, by recalculating the first loaded spline. If not, this would affect crossing the start/finish line timing.

A tip to create splines more easily is to remove all geometry for a second (clear the track's geometry.ini file), then create a big single track object, with just the road, import that into TrackEd (import only the road DOF files using the import file pattern, for example 'road*'), and add your splines with only that object or those objects loaded. This will make it a LOT easier, and you may only need 'A' to get the job done.

Usage in Racer

Some parameters in spline.ini that influence the spline usage.

The image below displays a spline track with lines.lateral_divisions set to 10 (in Racer v0.9.0RC6).

racer spline lateral divisions

Useful parameters

Some additional useful information/parameters on splines:

 


Dolphinity Organiser - free planning, project management and organizing software for all your action lists

(last updated February 27, 2013 )