laying out a gradient for a section of track

jbanetman

New member
Hi all, I've been experimenting with doing some gradients for a route . I was getting frustrated
that when I tried to apply a gradient to a track section, it would only apply to that one section,
and result in a roller coaster like track, instead of the smooth slope I wanted. I was able to do the
gradient with some trial and error and maybe this explanation will help some fellow Trainzers.
Lay out the track sections along the whole length of the track you want to apply the gradient to.
Set the gradient desired like 1.3 (positive slope up) or -1.3 (negative slope down) by putting that value
into the gradient tool value box and press enter.

Now, select the gradient tool and click on the first vertex of the first section of track,
and that will set the gradient for that section of track.
To continue the gradient to subsequent track sections, click on the vertex you wish to continue the gradient
from(may need to click that vertex twice) (EG
the last vertex you clicked on before) and that will continue the gradient along the next segment of track. If done
properly , when looking at the track from the side, you will see a smooth, gradual slope (how gradual depending on the amount
of gradient you had selected).
You can easily add more track to a gradient section, by laying out a new track section and attaching it to the section of
track with the gradient, resulting in a downward slope along the new section. If thats what you want, fine. But to continue
the upward slope, click(perhaps twice if once doesn't do it) on the vertex of the new track where it joins the sloped track,
and the gradient will be continued through the new section.
 
When applying a gradient to a section of single track that is connected to a section of multitrack, will not raise the multitrack.

You can use the minimap as a tool to see what gradients you are laying. Although alot of the time the minimap lies and is not accurate.

I check each gradient, and keep going back and checking prior gradients, when laying a progressive gradient down the line.

You can even use math to figure out the gradients: by adding up the gradient numerals, then dividing by the number of gradients, an that will give you an average gradient.

Alot of RR were up and down to some minor extent, under 2% or less.

Also: When applying a gradient, don't click on the spline point circle ... as if you click on the circle it may apply the negitive reverse gradient to your slope.

Instead: click a few meters in front of the gradient, then it will apply an uphill gradient all the way.

Applying gradients to a DEM is an art, as roller coaster gradients are exhadurated on a DEM.
 
Last edited:
I found out, this didn't work on other gradients I tried. I ended up with a roller coaster track again. So I posted too soon. I'll have to read more posts and experiment. But when I tried the gradient on one long section of track, no splines except beginning and end, it did give the smooth gradient. And you are right, I was attempting this on DEM maps.
 
I found out, this didn't work on other gradients I tried. I ended up with a roller coaster track again. So I posted too soon. I'll have to read more posts and experiment. But when I tried the gradient on one long section of track, no splines except beginning and end, it did give the smooth gradient. And you are right, I was attempting this on DEM maps.

Your procedure is pretty much correct, just don't click on the spline vertex, click on the track just beyond it for foolproof first-click-every-time gradient application...

Andy ;)
 
Thanks, after some more experimenting I have been able to do an extended gradient from a straight lead-in, thru a curve, and out. I still had to re-click a few sections (a little past the spline, like you mentioned), to get the gradient to look right. But thats part of surveyor and Trainz. Keep working with it til it does what you want.:hehe:
 
another hint

Say you are laying track from A to B, which is at a higher elevation.

Lay out one temporary long straight track (no intermediate spline points) from point A to point B. Measure the gradient. This will give you the required maximum overall gradient if the track were straight. If it way high you know you will need some or many curves and use a much lower gradient to apply. If it is reasonable, say under 2%, and if the track is mostly straight with just a few curves, select a gradient value just slightly under the overall gradient, and begin at either the top or the bottom realizing that you may need some stretchs of track with 0 (or reduced) gradient somewhere along the way (assuming you want to always gain elevation and never lose elevation).
 
Last edited:
Say you are laying track from A to B, which is at a higher elevation.

Lay out one temporary long straight track (no intermediate spline points) from point A to point B. Measure the gradient. This will give you the required maximum overall gradient if the track were straight. If it way high you know you will need some or many curves and use a much lower gradient to apply. If it is reasonable, say under 2%, and if the track is mostly straight with just a few curves, select a gradient value just slightly under the overall gradient, and begin at either the top or the bottom realizing that you may need some stretchs of track with 0 (or reduced) gradient somewhere along the way (assuming you want to always gain elevation and never lose elevation).

Too long, too complicated, too prone to error.

Try it this way:

Lay the track from 'A' to 'B' exactly as you want it. Ignore the grade.

Use sforget's Track Scanner to establish the exact distance between 'A' and 'B'. For simplicity let's assume it is 1000 meters.

Use 'Get Height' on the track vertexes at 'A' and 'B' and calculate the elevation difference. For simplicity lets assume 'A' is elevation 0 (zero) and 'B' is elevation 20 m. The difference is (obviously) 20 m

Divide the elevation change by the distance:

20 divided by 1000 = 0.02

multiply by 100 to get a per cent result

0.02 * 100 = 2%

Apply 2% grade slightly uphill of every track vertex along the grade and the top will finish up exactly where it should irrespective of the relative distances between vertices, degree of curvature or any other variables...

Andy :)
 
Thank you, Andy. I will try that method too. I tried another way of doing a gradient, and while not exact worked out smooth enough that a test engine drove over the stretch of track pretty smoothly, except for a few spots I had to readjust. What I tried, was I laid out my complete run of track. Then I raised the end of the run to the vertex height I needed( to go over another track ala Tehachapi loop like). I then worked my way down, checking the current gradient between the current section and adjacent section of track, and adjusted the vertex height of each section, until I kept the gradient to around 0.8 to 1.5 . And kept working my way down the line, then used smooth spline tool, to lay out the ground under the track, resulting in a pretty smooth looking 'hill' up the line. This seemed to work out better for me, than clicking multiple times on the gradient tool on a section, and accidently applying a neg gradient there.
 
Thanks for the better idea Dermmy

The plus side of your idea is that it is mathematically-based and reduces the trial and error that most of go through to accomplish a reasonably consistent and realistic gradient. I was not aware of a way to measure a curved rail line, except by using kilometer long consists, which I do use to place kilometer posts as track objects.

I'll give it a try soon since one of my rail line extensions will be increasing in elevation.
 
Last edited:
When working on DEM I make gradients the same way the rail roads were actually built. I raise or lower the track bed gradually using .1m or .2m or .25 increments. lay the track then just touch the track with the raising/lowering tool and the gradients take care of themselves. I use the map to check the gradient are not over 3%. Using Fishlips Horseshoe Curve DEM I layed track from Summerhill, PA past Johnstown, PA about 17 miles with an elevation drop of 123 meters from high to low using this method.
 
Interesting, TS12 is out and touted as the best yet and if memory serves me right the user tools provided by Auran in Surveyor - to lay track and build terrain - are the same ones I 1st saw 9 years ago in Trainz 1.1. The keep it simple group won out in the begining and well I'll leave it at that.

But here is post #11 in this thread and we've had 5 suggestion on how to construct a track gradient in Surveyor. One of the basics of constructing a rr - real or model. In some respects Surveyor is too simple.

@Dermmy, thanks for pointing out Steve's track scanner for Surveyor. One question - does it work in TS12? I ask because for me I couldn't get it to find the 2nd marker. I rotated them so they pointed at each other but no luck. It only gives distance to next track discontinunity it finds not the 2nd marker even if place on the same section of track. Still works fine in TRS06. 8-)

Bob Pearson
 
I don't have 12 installed (yet) but no reason it shouldn't work - (unless you believe new version + scripted item = very possibly broken LOL)

There was always an issue with some mocrossing objects interrupting it's scan and iirc industry tracks also.

Back on the primary question: To be honest with grades I just 'suck it and see'. I've been doing this so long I have a fair idea what sort of grade is going to be required so I just guess and apply (say) 1.25 all the way bottom to top. If it gets to the stage where i am obviously going to finish up too high or too low I just go back over it at 1.20 or 1.30. I rarely need more than a couple of goes. Working on DEM maps helps and if you have an idea of the ruling grade on the prototype that makes it even easier...

Andy :)
 
Remember, Greg Lane's vision for Trainz iirc, was originally envisioned as a model railroad simulator( like a typical club layout). I got the original Trainz too ( I actually joined Auran's forums til much later), and there was some talk about whether Trainz could handle very long routes. And some members started doing so, and later DEM tools were made by the community. So, keeping in mind that it wasn't envisioned in the beginning to have DEM maps comprising hundreds of baseboards, with long gradients possible, the original surveyor tools probably seemed adequate. The gradient procedure seems pretty error-prone to me, but I have only recently played around with my own maps, mostly til now I played on pre-made routes on the DLS, so I don't have much experience with gradients yet.
 
I have figured out the exact method of applying a constant gradient between two control points A & B with a number of vertices inbetween. See my recent post on "Applying uniform track gradients".
You do not need to know the distance between the control points.
Note that if the vertices inbetween are not uniformly spaced, the average of the slopes of the individual segments is not equal to the overall average slope between A & B.
 
TrainZoom.jpg


On a DEM, I lay track so that the end spline points just about sink and the entire track almost disappears under the terrain. Most DEM's are off in the x-y-z locations by +/- 20 foot in all dirrections, and too, tall tree tops of forest and vegitation, throw off the actual terrain ground heights.

If I laid track through Altoona at a 0.00% gradient, it would be all wrong. In actuallity Tyrone to Altoona is an @ 0.41% gradient, with some leaps and dips in between. And from Alto to Brickyard there is a 1.00% grade, a 1.22% grade, a 0.12% , a 1.47% grade, a 1.85% grade and a 1.75% grade, with the Horseshoe being a 1.45% grade, and 1.75% all the way to Benningtion, then a 2.36% grade and 1.81% grade on the "Slide", and a 1.00% grade through the tunnels ... so the grade is full of leaps and dips.

The "Sag" just west of Alto tower, right after Slope yard

SlopeSag.jpg

Why it is there I am uncertain ?
Probably because it would have require 1.27 billion carloads of fill to grade it out ... or the "Sag" makes a convienient step so that downhill trains can come to a stop, slowing just before Altoona, and uphill trains can get a running start at the "East Slope" grade.
 
Last edited:
Back
Top