Route Building Parameters
Aim - this pages describes some of the special features that are available in Open Rails, and how to set them up within Open Rails.
If you wish to provide any feedback on this page, please use the contact page. It would be great to have some feedback as this helps to ensure the accuracy of the information and models.
Index
Pickup Points for Loads and Refueling
Key Open Rails Parameters for Route Building
Introduction
To enhance its realism and performance a number of new features and functions have been added to Open Rails. The features described on this page are those elements that are implemented or activated as part of the route design or specification. In some instances the features will also require parameters to be set in the
The following features are described here:
- Creating Operational Turntables
- Clearing Trees from tracks
- Tunnel Resistance Parameters
- Track SuperElevation
To implement these features additional information needs to be inserted into various files as described in the relevant section. However making changes directly to these files may be overrriden by MSTS when editing the route in MSTS Routre Editor (RE), or alternatively it may cause instability issues with MSTS, so a method to include the information has been devised that doesn't require the direct editing of these two files directly. Instead an 'include' file is created with the data to be read by Open Rails. These files are created and stored in a sub-folder placed directly under the root folder of the route.
The structure of these files for each feature will be described in more detail below, and a working example of these files can be found in the Coals to Newcastle test route.
Pickup Points for Loads and Refueling
Open Rails currently supports the following pickup points for loading/unloading and refueling:
- Null (Type = 0)
- Freight - Grain (Type = 1)
- Freight - Coal (Type = 2)
- Freight - Gravel (Type = 3)
- Freight - Sand (Type = 4)
- Fuel - Water (Type = 5)
- Fuel - Coal (Type = 6)
- Fuel - Diesel (Type = 7)
- Fuel - Wood (Type = 8) (NB - This is not an option in MSTS)
- Fuel - Sand (Type = 9) (NB - This is not an option in MSTS)
- Freight - General (Type = 10) (NB - This is not an option in MSTS)
- Freight - Livestock (Type = 11) (NB - This is not an option in MSTS)
- Freight - Fuel (Type = 12) (NB - This is not an option in MSTS)
- Freight - Milk (Type = 13) (NB - This is not an option in MSTS)
- Special - Mail (Type = 14) (NB - This is not an option in MSTS)
Pickup points can be animated so that they move into position to fill the wagon or locomotive.
To implement a pickup point use the RE to insert a pickup point, if the load type is not one of the standard load types, then the
Changing Pickup Point Type
The pickup point's type is defined in world files using the parameter
Changing Pickup Point Load or Unload
To distinguish between a loading or unloading point it is necessary to set the Fill Rate value as positive for a loading point, and negative for an unloading point. This number can either be edited using the MSTS Route Editor, or alternatively using a text editor in the relvant world file. For example, the second number in the
INCLUDE File to Overwrite Default MSTS code
As some of the above load types are not defined in MSTS, when using MSTS RE it is not possible to select any of the load types with a value greater then 7, instead they need to be manually edited in the
SIMISA@@@@@@@@@@JINX0w0t______
Tr_Worldfile (
Pickup (
UiD ( 70 )
SpeedRange ( 0 2 ) Comment ( Freight - Fuel Loading Point )
PickupType ( 12 0 )
PickupAnimData ( 3 0 )
PickupCapacity ( 1e+006 5000 )
)
Code Notes:
UiD ( x ) - must match the pickup point that is being overwritten by this code segment.SpeedRange ( x y ) - sets the speed range for the train when using the pickup point. x = minimum speed, y = maximum speed. Units m/s.PickupType ( x y ) - sets the pickup type. x = load type, a number from the above table. y = "never runs out", 0 = capacity specified in dialog box, 1 = infinitePickupCapacity ( x y ) - sets the capacity of the pickup point. x = capacity in lbs per quantity. y = fill rate in lbs/s. (+ve for loading point, -ve for unlaoding point).
These types of code segments are included in a file named the same as the file in which they will replace the default code in, ie
If the
Turntable Animation
Introduction
Open Rails supports animation of turntables under two different scenarios:
- TSection - If a turntable is defined within the
TSECTION file, such as the default turntablea1t27mturntable.s found within MSTS, then it can be automated to rotate. - Static - If a turntable has been created as a static object only, then it maybe possible to convert it to an animated one. In this scenario it is effectively converted to a trackpiece that can be imported into a route.
The steps to implement an animated turnatble are as described below. Both the TSection and Static model follow a similar set of basic steps, except where indicated:
- Step 1 - Modify the turntable
S file to support animation - Step 2 - In the case of the static scenario, TSection elements will need to be incorporated into it the route. The TSection type turntable should already be defined
- Step 3 - Place the turntable in the relevant location with the Route Editor tool. For the static turntable scenario, this will modify the
W file to change the turntable from a static object to a track object. - Step 4 - Create a turntables.dat file to provide details on the location of operational turntables within the route.
- Step 5 - Add sound effects to the turntable as appropriate.
A working example, using the default MSTS 27m turntable and a static 60ft model, has been provided in the Coals to Newcastle Test route. The working turntables can be found on tile 1493, 10308. The following description uses these as the basis for describing the setup of the two different types of turntables.
Step 1 - Turntable S File Animation
The turntable S file must contain an appropriate hierarchy structure separating the turntable bridge (part that rotates) from the turntable base (part that remains stationary). Shape Viewer can be used to confirm this hierarchy structure. For example, in the following screenshot from Shape Viewer, 'Deck' represent the model parts that will rotate when the turntable is animate, whilst 'Foundations' are all the remaining parts that are stationary.
To animate the turntable, uncompress the shape file, and insert the following code into the S file prior to the last parenthesis (or bracket) in the file. Note the use of the 'Deck' name as part of the anim_node, and the need to ensure that all parenthesis are included.
animations ( 1
animation ( 3599 30
anim_nodes ( 2
anim_node Foundations (
controllers ( 0 )
)
anim_node Deck (
controllers ( 1
tcb_rot ( 5
slerp_rot ( 0 0 0 0 1 )
slerp_rot ( 900 0 0.7071068 0 0.7071067 )
slerp_rot ( 1800 0 1 0 -1.629207E-07 )
slerp_rot ( 2700 0 -0.7071066 0 0.7071069 )
slerp_rot ( 3600 0 0 0 1 )
)
)
)
)
)
)
Once the modifications are complete, then the S file should be inserted into
Note the animation code must be modelled such that it causes the turntable to rotate in a counter clockwise direction.
Step 2 - Create TSection Entries
As the turntables are effectively tracksections, they will need to be already defined in the TSection file (in the case of existing turntables), or alternatively able to be imported into the trackdatabase at runtime of Open Rails (in the case of static turntables). For our example the 27m turntable is already defined in the TSection file, so we can skip this step for it. However the 60ft one is not defined in the TSection, so it will need to have the relevant
include ( "../../../Global/tsection.dat" )
_INFO ( Track section and shape addition for turntable BBS-NSWGR-60ft-TT-open2_animate.s )
TrackSections ( 40000
_SKIP ( Track section for turntable BBS-NSWGR-60ft-TT-open2_animate.s )
TrackSection ( 37298
SectionSize ( 1.5 18.6 )
)
)
TrackShapes ( 40000
_INFO(TrackShape for turntable BBS-NSWGR-60ft-TT-open2_animate.s)
TrackShape ( 37298
FileName ( BBS-NSWGR-60ft-TT-open2_animate.s )
NumPaths ( 3 )
SectionIdx ( 1 0 1.35 -9.300 0 37298 )
SectionIdx ( 1 -9.300 1.35 0 90 37298 )
SectionIdx ( 1 6.576, 1.35, -6.576 -45 37298 )
)
)
Code Notes:
- The first line must be blank
- The second line has an include statement to indicate which file that this information needs to be added to.
- TrackSections - is the number of track pieces defined in the TSection file. Typically this will not need to modified.
- TrackSection - is the reference number that we will allocate to our track piece (turntable). This will be used in the
W file as reference. Note this number should be unique, and not one that is already in use. - SectionSize - describes the gauge and length of the section that we are defining. Note MSTS default gauge is 1.5.
- TrackShape - the same number as the trackshape number.
- FileName - the name of the
S file. Note that as this is a track section now, it must be located in the Global shapes folder. - NumPaths - the number of possible paths on the shape.
- SectionIdx - ( n x y z d s1 s2 ... sn) : each SectionIdx describes a path within this TrackShape. n is the number of s-values to expect. x, y, z is where the path starts relative to the shapes origin. d is the initial direction of the path with 0 being straight on, minus values to the left and plus values to the right. s* is a reference to a TrackSection, the path is built by adding these TrackSections to each other in the order stated.
To ensure correct operation of the turntable, the
Drawing notes:
- The turntable is assumed to have an object reference point in the centre of the turntable, ie ( 0, 0, 0 ). In our case we have added a value of 1.35 to the YOffSet to lift the turntable up slightly so that it aligns with the track elements either side of it.
- The Entry Refrerence Point for the direction of travel is assumed to be 0 at the entry point. Minus direction values are to the left of this point, whilst positive direction values are to the right of it.
- Path points around the circumference of the turntable are referenced to the object reference point. With positive and negative axis offsets as shown on the diagram.
A tool to determine the relevant entries for the SectionIDX values is available for use. Simply enter the diameter of the turntable and the degree steps between the track sections to get the correct entries. Whilst this tool may generate multiple paths, depending upon the separation degrees choosen, any number of paths can be defined in the SectionIDX entries.
In the case of our turntable, in the tool, choose a value of 18.6 (approx 60m) for the diameter, and, as we want at least one path at 45 degrees, an Angle setting of 45 deg. It may be necessary to adjust the diameter value slightly as this will determine where the entry and exit tracks will attach to the turntable.
Description of paths used in the 60 ft turntable:
- Path 1 - runs vertically along the 'Z' axis. Typically we only have a single tracksection, so based upon the relevant locational co-ordinates and direction we get SectionIdx ( 1 0 1.35 -9.300 0 37298 ).
- Path 2 - runs horizontally along the 'X' axis. Based upon the relevant locational co-ordinates and direction we get
SectionIdx ( 1 -9.300 1.35 0 90 37298 ) . - Path 3 - runs diagonally across the turntable. Based upon the relevant locational co-ordinates and direction we get
SectionIdx ( 1 6.576, 1.35, -6.576 -45 37298 ) . Note carefully the sign of the co-ordinates and the direction in this instance.
For a static turntables, to use MSTS RE, it will be necessary to temporarily insert the TSection information defined above into the main MSTS TSection file. This will allow selection and editing as a track piece, and will also ensure that it is correctly defined in the
Once you have defined your TSection entries, then use the information to create the
Step 3 - Turntable Installation and World File Adjustment
By this stage you should be able to insert the animated turntable into the correct location in the world file using the Route Editor tool.
Once the turntable is correctly placed, it will usually appear as a TrackObject in the relevant world file, as shown below. Some of this information will be required to define the turntable location as described in the next step.
TrackObj (UiD ( 124 )
SectionIdx ( 37298 )
Elevation ( 0 )
CollideFlags ( 23 )
FileName ( BBS-NSWGR-60ft-TT-open2_animate.s )
StaticFlags ( 00200180 )
Position ( 172.979 -0.35 418.047 )
QDirection ( 0 -0.422616 0 0.906309 )
VDbId ( 4294967294 )
)
If the turntable is already defined in the TSection file, then placing the turntable in the route will merely be a case of using MSTS RE (OR route editor) to place the turntable and track around it.
Step 4 - Turntable Location
A special file called
2
Turntable(
WFile ( "w+001493+010308.w" )
UiD ( 86 )
XOffset ( 0 )
YOffset ( -1.92177 )
ZOffset ( 13.4 )
TrackShapeIndex ( 253 )
Animation ( "TRACKPIECE" )
Diameter ( 27 )
)
Turntable(
WFile ( "w+001493+010308.w" )
UiD ( 124 )
XOffset ( 0 )
YOffset ( 1.35 )
ZOffset ( 0 )
TrackShapeIndex ( 37298 )
Animation ( "Deck" )
Diameter ( 18.6 )
)
Code Notes:
- The first line must be blank
- The second line contains a number indicating the number of operational turntables in the route, and hence included in this file.
- Wfile - the name of the
W (world) file in which the turntable is located. - UID - the UID of the object within the
W (world) file. If there is more then one operational turnatble on a tile, then this number will differentiate between them. - XOffset, YOffset, ZOffset - are the offsets of the center of rotation of the turntable with respect to the zero of the turntable shape. These may need to be adjusted by trial and error, in particular the height (Y) offset may require adjusting to match track heights.
- TrackShapeIndex - the number of the SectionIdx from the
W (world) file, which should correspond to a Trackshape number in theTSection file. In the case of the defualt MSTS 27m turntable, it was already defined within the TSection file, wheras the static turntable doesn't have a TSection entry. - Animation - the name of the moving parts from the hierarchy structure of the S file.
- Diameter - the diameter of the turntable in metres.
Step 5 - Turntable Sounds
To add sounds to the turntable, add the following statement to the route TRK file in the Open Rails sub-folder.
Comment ( Adds sounds for turntables )ORTSDefaultTurntableSMS ( turntable.sms )
Turntable Operation
To test your turntable, run your train over it. If it is working correctly then messages should appear indicating the the train is moving onto the turntable. If you don't get these messages, then check your settings above.
Once you are successfully on the turntable, then ensure that the locomotive is in neutral, throttle is off, and speed is zero. Then press the
The above steps must be repeated for every route where you want to have operational turntables
Car Spawners
Multiple car spawners can now be used in Open Rails so that different traffic patterns can be used on different road sections.
The use of multiple car spawners is demonstrated in the Coals to Newcastle test route on tile 1493, 10307.
The steps to implement multiple carspawners are as described below:
- Step 1 - Insert carspawners in route using RE or Open Rails Route Editor.
- Step 2 - Create an addon
carspawn.dat file containg the additional car lists that are required. - Step 3 - Create an addon
W+xxxxxxx.dat file containg the references to all 'non-default' car spawners, in our example, it will bew+001493+010307.w .
Step 1 - Insert Car Spawners into Route
Using a n appropriate editing tool insert car spawners at the locations required. For the time being these will use the car spawner lists defined by default in the
Step 2 - Create Additional Car Spawner Lists
In this step we create the additional non-default lists of cars that we wish to use in our Route. These lists use the code format shown below and should be in saved in a file called,
SIMISA@@@@@@@@@@JINX0v1t______
2
CarSpawnerList(
ListName ( "List1" )
1
CarSpawnerItem( "Jp1Car01.s" 4 )
)
CarSpawnerList(
ListName ( "List2" )
1
CarSpawnerItem( "OL_Flatbed_Drums.s" 6 )
)
Code Notes:
- The third line contains a number indicating the number of different carspawner lists used in the route, and hence included in this file.
- ListName - is the name of the carspawner list.
- The sixth line contains a number indicating the number of different vehicles defined in the carspawner list.
- CarSpawnerList - defines each vehicle used in the list. The first item is the shape file of the vehicle, and the number indicates the spacing between the vehicles.
Step 3 - Create References to Additional Car Spawner Lists
In this step we create the references to the additional non-default lists of cars that we wish to use in our Route. These lists use the code format shown below and should be in saved in a file called,
SIMISA@@@@@@@@@@JINX0w0t______
Tr_Worldfile (
CarSpawner (
UiD ( 32 )
ORTSListName ( "List1" )
)
CarSpawner (
UiD ( 31 )
ORTSListName ( "List1" )
)
CarSpawner (
UiD ( 30 )
ORTSListName ( "List2" )
)
CarSpawner (
UiD ( 29 )
ORTSListName ( "List2" )
)
)
Code Notes:
- UID - is the number of the carspawner code that appears in the relevant W file.
- ORTSListName - defines which additional carspawner list defined above should be used for this carspawner.
After setting up the additional car spawners, it is possible that any further changes or editing of the
Tree Clearing
Typically within OR to create a forest, large numbers of trees are configured into a FOREST region. Sometimes trees within a FOREST region can inadvertantly be placed on the track or the road, with the result that the player train or road vehicles appears to run into them or through them. To overcome this issue a feature has been created to place trees a defined distance away from the tracks and roads.
This feature is implemented by inserting the following statement into the the route
The use of tree clearing is demonstrated in the Coals to Newcastle test route on tiles 1494, 10309 and 1493, 10309.
Comment ( Information to clear trees off tracks )
ORTSUserPreferenceForestClearDistance ( 5.0m )
ORTSUserPreferenceRemoveForestTreesFromRoads ( 5.0m )
Note: For the
Tunnel Resistance Parameters
To override the basic 'standard' default tunnel design parameters within a particular route, include the following code into the route
To see an example implementation refer to the test route.
Comment ( Information to overwrite default data for tunnel designs )
ORTSSingleTunnelArea ( 26.84m^2 )
ORTSSingleTunnelPerimeter ( 20.724m )
ORTSDoubleTunnelArea ( 49.536m^2 )
ORTSDoubleTunnelPerimeter ( 28.497m )
Code Notes:
ORTSSingleTunnelArea - Cross section area of single track tunnel - units areaORTSSingleTunnelPerimeter - Perimeter of single track tunnel - units distanceORTSDoubleTunnelArea - Cross section area of double track tunnel - units areaORTSDoubleTunnelPerimeter - Perimeter of double track tunnel - units distance
Track SuperElevation
The following code is inserted into the
To override the basic 'standard' track SuperElevation design parameters within a particular route, include the following code into the route
To see an example implementation refer to the test route.
Note: The inclusion of this parameter does not currently have any impact on the visual SuperElevation, but only on the SuperElevation 'physics', ie the curve speed, and overturning moments of the train.
Comment ( Information to set superelevation for tracks )
ORTSTrackSuperElevation ( 0.0 0.051 160.0 0.064 241.4 0.064 281.6 0.076 301.8 0.076 402.3 0.102 502.9 0.102 603.5 0.089 804.7 0.064 1005.8 0.051 1207.0 0.038 1609.3 0.025 3218.7 0.013 10000.0 0.0.013 )
Code Notes:
ORTSTrackSuperElevation - allows a series of paired x and y parameters to be inserted specifying the curve radius in metres (x value), and the amount of superelevation in metres (y value). The statement will take as many paired values as desired. Each paired set of values must have an x and y value present. If it is desired to 'hold' a certain value of SuperElevation for a number of different radii curves, then the same y value needs to be used for succeeding values of curve radius. Where the y value changes between curve radii, then Open Rails will extrapolate the y value between the two points.
Route Sounds
A number of "global sound features can be added to the route by using the following parameters. These parameters can be added to the
To see an example implementation refer to the test route.
Key Open Rails Parameters for Route Building
The key parameters that impact upon the performance of a diesel locomotive are described on the following web page.