Track Creation 104 – Grades and Cambers
As I said previously, the trackeditor does not (yet) support grades or cambers in tracks, so every track created in the editor will be absolutely flat. Unless its an airport track, flat is both unrealistic and boring – you need some height and camber changes to spice things up and give your track character. This is especially the case if you want to make a rally track with lots of jumps and bumps, but equally true of smooth fast tracks like Forza, where the slopes are more subtle but present nonetheless.
Ok, so now its time to get to grips with the track’s XML, which I presume you have open in vim your favourite editor.
If you look closely you’ll see two lines appearing in each and every segment:-
<attnum name=”z start” unit=”m” val=”0.0″ />
<attnum name=”z end” unit=”m” val=”0.0″ />
Now there’s two ways of determining height changes in a SD track. One is to specifically set the height (the “z” value) for the start and end of each segment. The other is to use a gradient percentage. I prefer the latter, as its much easier to define a constant slope across multiple segments, so I’ll describe that method here.
First thing you need to do is remove all of the above lines, except for the “z start” on the first segment and the “z end” on the last. This ensures that those segments will meet properly, and your cars won’t be jumping off a cliff or running into a wall when they cross the start-finish line.
Next, let me introduce you to the two lines that go in their place:-
<attnum name=”grade” unit=”%” val=”0″/>
<attnum name=”profil end tangent” unit=”%” val=”0″/>
The “grade” value is the gradient of the segment, and the “profil end tangent” specifies the expected slope on the next segment, ensuring a smooth transition with minimal bumps. I usually keep the two values the same except for when there’s a significant change in gradient from one segment to the next, in which case I make the end tangent approximately halfway between the two segments’ gradient values.
Work your way through the XML adding gradients – it may help to still keep the trackeditor open so you can click on segments & see what their names are. Just don’t use the trackeditor to save anything, as you’ll lose all your gradients and cambers. Once you’re done, run trackgen to create the 3D model, then open the track’s .ac file in your favourite 3D editor. I should say at this point that I’m an avid AC3D user – I’ve never gotten the hang of Blender, so if you’re looking for advice on how to use it you’ll need to ask someone else. Anyway, once you’ve gotten the track open in your 3D editor, look at the part leading up to the start/finish line. The following screenshots show what I mean.
Now you can look at the track’s camber. Generally you want straight sections to be flat, and the camber to provide a nice bank on the corners that helps you take them at speed. If you’re making a Nascar-style oval where you turn left for hours on end, the whole track will have a fairly steep camber. Perhaps though you might have a cruel streak, and want to punish careless drivers with off-camber sweepers, sloping down towards the outside of the bend and sending cars into the dirt *cough*Brondehach*cough*. Anyway, here’s how you define the camber for each segment:-
<attnum name=”banking start” unit=”deg” val=”0″ />
<attnum name=”banking end” unit=”deg” val=”0″ />
Unless you’re making an off-camber corner, a left turn will want a negative value and a right turn, positive. Make absolutely sure that the end camber of one segment matches the start camber of the next, otherwise you’ll have unsightly gaps in your track. Also try to avoid making large camber changes across short segments, as they’ll translate into dangerous bumps (unless, of course, you’re trying to create dangerous bumps!).
Once you’re done, you have a very important task remaining before you can start making the track look good. You must test drive again. And again. Using both robots and driving yourself. Look closely for any parts of the track that don’t feel right, that aren’t fun to drive in the way you’ve envisaged. If changes in slope and camber don’t feel right, now is the time to change them until they’re perfect. Don’t skip over this, because it’ll be too late to implement fixes once you’ve spent days & weeks adding trackside objects and customising the trackside terrain.
Entry filed under: Tutorials.