BVE WORKS  >  Developer Guide
  BVE^ Investigations
Contents             Topics:   Test base | Track | Scenery | Route | Train        
MODIFY TRACK ELEMENTS

The following procedures assume you have prepared a test base, TestBase.RW (or whatever you chose to call it), as described in the test base procedure.

These procedures demonstrate track configuration. They add curves, grades, additional tracks, and switches to the simple single-line section in the test base. These procedures also discuss some important issues, such as turning loops. You may want to refer to the Track Formation statements in Reference 1, specifically @RailStart, @rail, @RailType, @RailEnd, @pitch, and @curve. Note that statements are case-insensitive.

Add an S-curve.

  1. Using Notepad, insert the following lines in their chronologically appropriate place. (Don't assume that BVE will properly process statements that are not chronologically consistent. In any case, keeping things properly placed will help you keep your sanity.)

    150@curve(-800,5) ; ab curve left, 800M radius, 5 diff
    225@curve(800,5) ; ab curve right, 800M radius, 5 diff
    300@curve(0,0) ; ab straight

    The curve statements takes two parameters. The first is the radius in meters, with a negative number indicating left and a positive number indicating right. The second parameter is the height in millimeters of the outer rail above the inner rail for the curve (i.e., superelevation). Higher numbers are more appropriate for smaller-radius and/or higher-speed curves.

    You can calculate superelevation (H) as follows:

    H (mm) = 1.37 x speed (KPH) x speed (KPH) / radius (M)

    In English units:

    H (in) = 4 x speed (MPH) x speed (MPH) / radius (Ft)

    The U.S. Federal Railway Agency sets a maximum superelevation of 6" (147mm).

    Notice that a statement such as @curve remains in place until it is countered. Thus the 200@curve(0,0) returns the track to straight. Without this statement the train would travel in a continuous circle. (This might be fun to try if you want to simulate your Lionel train set.)

  2. Fire up BVE and test you work. You may also want to vary the parameters to see their effects.

Add grades.

  1. Continuing, insert the following:

    350@pitch(20) ; ab rise 2%
    425@pitch(-20) ; ab fall 2%
    500@pitch(0) ; ab level

    The parameter is in units per thousand, thus 20 represents a 2% grade up and -20 represents a 2% grade down. Similar to the curve command, 300@pitch(0) levels the route.

  2. Again, test the results. Try different pitches. See how steep a grade your train can handle.

Add switches.

  1. Comment-out the curves and pitches you just put in and insert the following:

    125@RailStart(2,0,0,0) ; ab begin switch right
    150@rail(2,4,0,0) ; ab complete switch right

    RailStart defines the start of a new track. The first parameter in both statements (2) is the new track. (The running track is always 0.) The second parameter (0) and (4) is the lateral displacement, which is zero in the first statement and 4 meters to the right in the second statement and creates the divergence, thus the switch. The third and fourth parameters (0) and (0) are the same as for the running track.

    When you test the new addition, you'll notice that the new track follows alongside the running track. The new track is a graphic and takes its location in the form of lateral displacements from the running track.

    It's tempting to try to make the switch more gradual by expanding the distance between the RailStart and rail statements. The next step demonstrates something very important about the way BVE treats curves.

  2. Expand the distance between the RailStart and rail commands and add markers to show the exact location of the switch. (I borrowed the 15 MPH speed limit sign defined as freeobject 95 in the Object part of the route file. I omitted the @limit part of the code lines because it is irrelevant to our discussion here.)

    130@freeObj(0,95,1.70,1.0,0) ; marker - ab
    130@RailStart(2,0,0,0) ; ab begin switch right
    140@freeObj(0,95,1.70,1.0,0) ; marker - ab
    150@freeObj(0,95,1.70,1.0,0) ; marker - ab
    160@freeObj(0,95,1.70,1.0,0) ; marker - ab
    170@freeObj(0,95,1.70,1.0,0) ; marker - ab
    180@freeObj(0,95,1.70,1.0,0) ; marker - ab
    190@freeObj(0,95,1.70,1.0,0) ; marker - ab
    200@freeObj(0,95,1.70,1.0,0) ; marker - ab
    200@rail(2,4,0,0) ; ab complete switch right

    When you run this scenario you find that the switch begins at about the 5th marker and completes at the last marker. The distance is 25 meters for the 4-meter displacement. You can increase/decrease the displacement in the 200@rail command, but the starting and ending points of the switch remain the same. Neither the displacement nor the rate of displacement are factors. A lesson here is that any section of scenery track reverts to a parallel condition after 25 meters, measured along the running track. Also, BVE treats curves as 25-meter straight sections. You can demonstrate this for yourself by building an S-curve that changes direction every 5 meters. When run, you will find that BVE averages and straightens every section until it gets to 25 meters, then it averages and straightens the next 25 meters, and so forth.

    In order to get a gradual switch, you need to add intermediate points to the original switch, as in the following (but first remove or comment-out the previous 10 lines):

    125@RailStart(2,0,0,0) ; ab begin switch right
    150@rail(2,2,0,0) ; ab
    175@rail(2,4,0,0) ; ab complete switch right

  3. To create a crossover between two tracks, use a third track for a short section to connect the first two tracks. Add the following:

    220@railstart(3,0,0,0) ; ab start x-over
    245@railend(3,4,0,0) ; ab end x-over

    Track 3 begins with a displacement of (0), matching the running track, and ends with a displacement of (4), matching track 2.

    Bear in mind that this is a visual crossover. Your train remains on the running track.

  4. To create a breakaway track, add the following:

    300@RailStart(4,0,0,0) ; ab begin breakaway
    325@Rail(4,-6,0,0) ; ab
    350@Rail(4,-13,0,0) ; ab
    375@Rail(4,-36,0,0) ; ab
    400@RailEnd(4,-100,0,0) ; ab end breakaway

    The tendency of any track is to parallel the running track. Getting a breakaway track to continue diverging without returning to the parallel condition, even for a small section, takes some tinkering. It becomes more complicated when your running track is also curving. Again, the breakaway track is visual only.

  5. To have a track cross the running track from one side to the other, it takes a 25-meter section for track 4 in the next set of code to cross smoothly from a displacement of 4 meters to a displacement of -4 meters (total 8). You may want to comment-out the switch that begins at 125 and ends at 175, just to keep things tidy.

    75@RailStart(4,4,0,0) ; ab position track 4
    140@rail(4,0,0,0) ; ab begin cross at 115
    165@rail(4,-4,0,0) ; ab end cross

  6. To create the impression of moving through a switch to a "different" track, use the @turn statement. This statement became available with BVE2 and is not included in Reference 1. From the point of invocation, the @turn command turns the plane of view. If you use a large turn, you can see a split in the scenery. Comment-out the lines in step 5 and add the following:

    100@turn(0.8) ; ab

    Notice the split to the left when you run this scenario.

    Now try something more reasonable.

    100@turn(0.08) ; ab
    125@turn(-0.08) ; ab

    When you run this, the effect is similar to the @curve statement.

    The trick now is to combine the @turn with the cross in step 5 to let the train apparently switch from one track to the other. Let's start by simply having the running track move right to join the right-side track (but first remove or comment-out the previous two lines).

    75@RailStart(4,4,0,0) ; ab position track 4
    140@turn(.08) ; ab turn right
    140@rail(4,4,0,0) ; ab
    165@rail(4,2,0,0) ; ab keep track 4 straight
    190@turn(-.08) ; ab turn left
    190@rail(4,0,0,0) ; ab

    Now add track 5 (shown bold) to extend the line we were originally on.

    75@RailStart(4,4,0,0) ; ab position track 4
    75@RailStart(5,0,0,0) ; ab position track 5
    140@turn(.08) ; ab turn right
    140@rail(4,4,0,0) ; ab
    165@rail(4,2,0,0) ; ab keep track 4 straight
    165@rail(5,-2,0,0) ; ab keep track 5 straight
    190@turn(-.08) ; ab turn left
    190@rail(4,0,0,0) ; ab
    190@rail(5,-4,0,0) : ab position track 5
    300@RailEnd(5,-4,0,0) ; ab end track 5

    If the entries at position 165 are unclear, try removing them. Tracks 4 and 5 will try to follow the running track. Reducing the track lengths to 25 meters between positions keeps the lengths straight.

    The parameter in the @turn statement stands for slope, or inclination. It's the lateral displacement divided by the length of the section. In other words, if a 25-meter section turns so that its free end moves laterally 2 meters, the slope is 2/25, or 0.08.

Turning loops. Anyone modeling an urban trolley or light rail line will at some point wonder about modeling a turning loop. There are several things to bear in mind. First, BVE is able to handle the short radius turns that trolleys and light rail vehicles are accustomed to, but it does so with 25-meter lengths of straight track. The resulting curves are a bit clunky in appearance. That aside, there are more important considerations: BVE displays the track ahead in the route file, but does not display the track behind. Also, BVE does not display a running track on top of itself, even though the track has gone ahead, turned around, and is now coincident with its earlier section. It displays the two versions of itself side-by-side. Thus, to have any hope of modeling a turning loop, you will have to resort to devious methods.

The following code executes a turning loop in which the return track parallels the original track:

Comment-out your previous work and insert the following:

200@curve(-31.73,10) ; ab - begin loop
250@curve(0,0) ; ab - short straight section to separate return track from original
254@curve(-31.73,10) ; ab
354@curve(31.73,10) ; ab - reverse turn
404@curve(0,10) ; end loop

The radius of 31.73 meters was calculated to form a circle with 8 25-meter straight sections.

The return track is visible from the incoming track, but when you complete the loop the incoming track is no longer visible. You can try adding a dummy track alongside the return track to take the place of the incoming track, but when you approach the loop the dummy track displays as yet another track alongside the incoming track. The solution, it seems, lies in having a greater separation between incoming and return tracks - perhaps even having a divergence - and then visually separating them with barriers so you can add a dummy track in each of the incoming and outgoing views. This will be a good topic when we get into scenery.

Spiral curves. It is perfectly reasonable to spiral a curve, as the railroads do, so that the curve is more gradual at its ends than at its middle. For short-radius curves there is no point in attempting this since the 25-meter section limitations govern.

Highways and other scenery elements. You can use a dummy track to represent highways, rivers, embankments, etc. simply by selecting an appropriate texture. This is more properly a topic to be covered under scenery.

Top        


Contents             Topics:   Test base | Track | Scenery | Route | Train        
    BVE WORKS  >  Developer Guide
  

©2001 Alfred Barten. All rights reserved. Page created 21 July 2001. Last updated 29 March 2006




Web Counter by TrafficFile.com