In this third tutorial, we will add some curves to our route and make it twin track.
Additional objects used in this tutorial session may be found here:
http://vps.bvecornwall.co.uk/dennislance/DLTUTORIAL_1_3.zip
Unzip to the objects folder.
Time to open the route file and get coding…
The route file we created previously should look something like this (it does not matter if you have changed the timings, altered the stop markers or if double line spacing is used),
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
Route.Comment Route learning with Dennis, Route.Gauge 1435, Route.DeveloperID yourname123, Route.change 1, with train, Train.Folder cl170, With Structure .Rail(1) DLTUTORIAL_1\straight.b3d, .Ground(1) DLTUTORIAL_1\ground1.csv, .Freeobj(1) DLTUTORIAL_1\stop_500m.csv, .Freeobj(2) DLTUTORIAL_1\stop_here.csv, Texture.Background(0) DLTUTORIAL_1\background_1.bmp, With Track, 0,.Ground 1,.back 0,.railtype 0;1,.sta yourname1; 09.2720;09.2805;1;1;0;;;7;10;;0, 25,.stop 0, 2100,.freeobj 0;1, 2500,.sta yourname2; 09.3100;09.3200;;-1;;;;30;30;;0, 2600,.Stop 0;5;5,.freeobj 0;2, 4500,.freeobj 0;1, 4900,.sta yourname3; 09.3600;09.3700;;-1;;;;30;30;;0, 5000,.Stop 1;10;10,.freeobj 0;2, |
The route as it is at the moment is perfectly straight and therefore completely unrealistic. We can change this by using the .curve command:
.curve a;b,
Where a is the radius of the curve in metres (using negative values for left hand curves and positive values for right hand curves) and b is the amount of cant (tilt).
Cant is the name used to describe the tilt angle of track on a curve which is used to compensate for lateral (sideways) forces generated by the train as it passes through the curve. In effect, the sleepers are laid at an angle so that the outer rail on the curve is at a higher level than the inner rail. On standard gauge track, 150 mm is the normal maximum in the UK, the actual amount present will be a compromise based on the actual train speeds on the line. Higher maximum speeds and tighter curves demand higher levels of cant. However, consideration must be given to slower running passenger trains – overdoing the cant will result in drinks sliding off the tables when running over the curve at slow speed!
To add a moderately tight left hand curve after 100metres, add the following code at position 100:
1 |
100,.curve 500;15, |
This has resulted in a right hand curve of 500m radius starting at 100metres.
Obviously we don’t want to go round and round in circles so we must end the curve at some point. If we want to straighten up at 800metres, we need to add this code at position 800:
1 |
800,.curve 0;0, |
In our fictional route, we can meander about to our hearts content but before adding more curves we need to think a little about why they are present.
Considering why curves are present, early railway builders had several design constraints placed on them. One of the major reasons for curving the railway was because of the landscape – early locomotives had insufficient power to deal with steep gradients while constructing earthworks (embankments and cuttings) to overcome these could be very expensive. Tunnels were often prohibitively expensive (depending on the ground conditions) and were only really used where diverting around the obstructing hill was not an option.
The need to minimise gradients resulted in railways generally being built to follow the contours of the land, and this is the reason why features such as escarpments, rivers and canals are often followed by railways.
Another major reason for introducing curvature is to overcome man-made obstacles. Typical of these would be landowners not wishing to sell, Lord Snooty not wanting the view out of his bedroom window destroyed by a railway (NIMBYism!!) or the wish to preserve existing buildings.
To some extent, much more powerful traction has overcome the problem of gradients, with modern high speed lines being noticeably less flat than older lines.
The curves we add to our route should therefore be present for a reason – slowing down for a curve without reason is not desirable.
A further point to consider when constructing curves is that if a tight curve is entered at high speed, a noticeable jolt would result. To overcome this, the start and end of a curve should be graduated (smoothed out).
To graduate our curve, we can change our curve to read this:
1 2 3 4 5 6 |
50,.curve 2000;2, 75,.curve 1000;7, 100,.curve 500;15, 750,.curve 1000;7, 775,.curve 2000;2, 800,.curve 0;0, |
Notice how the radius of the curve tightens gradually after 50metres and the degree of cant increases. No doubt a competent railway engineer would not be too happy with this construction but at least it is a bit more realistic.
When we drive our route now (or view it in viewer mode), a major problem is revealed. The curve is not smooth but composed of a series of straight sections. This is because we have defined the rail type as being a straight section.
Before we can smooth our curves, we must index some track objects in the ‘with structure’ section of the route. Although the curve in our route only uses radii of 2000, 1000 and 500m, we may as well index a few others which may be of use at some point later in the route.
The curved track objects themselves are contained in the zip folder referenced in the introduction – these objects should be located in the \DLTUTORIAL_1 objects directory.
These objects were generated using SWITCH 1.5, available here http://www.ruedes-bve-seite.de/.
To index the smooth curved track objects, add the following code to our route,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
.Rail(1) DLTUTORIAL_1\straight.b3d, .Rail(2) DLTUTORIAL_1\250_l.b3d, .Rail(3) DLTUTORIAL_1\500_l.b3d, .Rail(4) DLTUTORIAL_1\750_l.b3d, .Rail(5) DLTUTORIAL_1\1000_l.b3d, .Rail(6) DLTUTORIAL_1\1250_l.b3d, .Rail(7) DLTUTORIAL_1\1500_l.b3d, .Rail(8) DLTUTORIAL_1\2000_l.b3d, .Rail(9) DLTUTORIAL_1\250_r.b3d, .Rail(10) DLTUTORIAL_1\500_r.b3d, .Rail(11) DLTUTORIAL_1\750_r.b3d, .Rail(12) DLTUTORIAL_1\1000_r.b3d, .Rail(13) DLTUTORIAL_1\1250_r.b3d, .Rail(14) DLTUTORIAL_1\1500_r.b3d, .Rail(15) DLTUTORIAL_1\2000_r.b3d, .Ground(1) DLTUTORIAL_1\ground1.csv, |
To smooth the curves in our route, we must use curved track objects of the appropriate radius using the rail type command,
Railtype x;y,
Where x is the index of the rail and y defines the track object.
So to modify our curves we must change the rail type of track 0 (which is always the running rail) to the appropriate curved track objects by using the following code:
1 2 3 4 5 6 |
50,.curve 2000;2,.railtype 0;15, 75,.curve 1000;7,.railtype 0;12, 100,.curve 500;15,.railtype 0;10, 750,.curve 1000;7,.railtype 0;12, 775,.curve 2000;2,.railtype 0;15, 800,.curve 0;0,.railtype 0;1, |
Go for a drive now and see the improvement!
It is also apparent that the curve is rather too sharp and long, turning through nearly 90° . For the scenic construction which will be demonstrated in later parts of this tutorial, it would be good to increase the length of the straight and ease the curve by changing our curve to this:
1 2 3 4 |
350,.curve 2000;2,.railtype 0;15, 375,.curve 1000;7,.railtype 0;12, 775,.curve 2000;2,.railtype 0;15, 800,.curve 0;0,.railtype 0;1, |
Notice that our curve now starts at 350m, and the sharpest part of the curve has been removed.
Suppose we want our route to be twin track, the second track can be added using the railstart command;
.railstart n;x;y;t,
Where n is the index of the running rail (between 1-16),
x is the distance, in metres, to the left (negative values) or right (positive values), y is the distance, in metres, below (negative values) or above (positive values) the running rail and t is the rail type as defined in the ‘with structure’ part of the route file.
We want the adjacent track to be 3.5 metres to the right of the running rail and at the same height and also, at the start of the route, to be straight. To achieve this, our first line of the routefile must be changed to this:
1 |
0,.Ground 1,.back 0,.railtype 0;1,.sta yourname1; 09.2720;09.2805;1;1;0;;;7;10;;0, .railstart 1;3.5;0;1, |
If we have a look at the route now, it is apparent that the adjacent track also needs smoothing as it goes around the curve. This can be performed using the same principle as was used for the running rail, so our code will now look like this:
1 2 3 4 |
350,.curve 2000;2,.railtype 0;15,.railtype 1;15, 375,.curve 1000;7,.railtype 0;12,.railtype 1;12, 775,.curve 2000;2,.railtype 0;15,.railtype 1;15, 800,.curve 0;0,.railtype 0;1,.railtype 1;1, |
Here, we are changing the track objects of the adjacent rail (1) to match the curve radius, a principle that should be maintained throughout the route.
We now have a 5km route with three ‘stations’, twin track and a smooth curve.
In the next tutorial, we will take a look changing the position of the adjacent track, change the appearance of the track and introduce run sounds.