Skip to content

Commit 6936c76

Browse files
authored
Merge pull request #954 from SteelFill/multi_track_profiles
Multiple Track Profiles & Superelevation Rewrite
2 parents e2338fd + 39721fe commit 6936c76

36 files changed

+2884
-1724
lines changed

Source/Documentation/Manual/appendices.rst

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,16 @@ Volumetric Flow m^3/s air flow m^3/s
6464
\ L/min
6565
\ L/s
6666
Speed m/s other m/s m/s meter per second
67+
\ cm/s centimeters per second
68+
\ mm/s millimeters per second
6769
\ km/h
6870
\ kph kph kilometer per hour
69-
\ kmh kmh misspelling accepted by MSTS
70-
\ kmph
71-
\ mph dynamic mph mph miles per hour
72-
brake
71+
\ kmh kmh, misspelling accepted by MSTS
72+
kmph
73+
\ mph dynamic mph mph miles per hour,
74+
brake legacy dynamic brake parameters use mph default
75+
\ ft/s feet per second
76+
\ in/s inches per second
7377
Frequency Hz Hz Hertz
7478
\ rps revolutions per second
7579
\ rpm

Source/Documentation/Manual/developing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Rolling Stock
2222
- 3D cabs add realism.
2323
- OR graphics renders the results of the rolling stock developers at higher
2424
resolution.
25-
- Rolling stock running on super-elevated track improves gaming experience.
25+
- Rolling stock running on superelevated track improves gaming experience.
2626

2727
Routes
2828
======

Source/Documentation/Manual/features-route.rst

Lines changed: 134 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -858,24 +858,147 @@ Defining Curve Superelevation
858858

859859
.. index::
860860
single: ORTSTrackSuperElevation
861+
single: ORTSSuperElevation
862+
single: MaxFreightUnderbalance
863+
single: MaxPassengerUnderbalance
864+
single: MinimumCant
865+
single: MaximumCant
866+
single: Precision
867+
single: MaxRunOffSlope
868+
single: MaxRunOffSpeed
869+
single: MinimumSpeed
870+
single: MaximumSpeed
871+
single: ORTSForceSuperElevation
872+
single: TrackGauge
861873

862874
This feature allows curves within the route to be assigned a value for superelevation. It
863-
is inserted either in the route's root .trk file or in the "Include" .trk file.
875+
is inserted either in the route's root .trk file or in the "Include" .trk file. Before
876+
starting, the predominant gauge of track on the route should be given using the legacy
877+
``TrackGauge`` token. The default units used are meters, though other units are supported
878+
as in other parts of the program. If ``TrackGauge`` is set to 0 (like most MSTS routes)
879+
or not present in the .trk file, then the default gauge given in the
880+
:ref:`Superelevation Options <options-superelevation>` will be used for superelevation calculations.
881+
882+
Defining a superelevation standard in the .trk file will control both the simulated level of
883+
superelevation on each track section on the entire route and the amount of visual
884+
superelevation generated by the dynamic track system. However, in some cases it may be desired
885+
to manually influence the use of visual superelevation due to (un)desired graphical effects.
886+
The token ``ORTSForceSuperElevation`` can be given a true/false value to force enable/disable
887+
visual superelevation effects regardless of user settings and other ORTS behaviors. Adding
888+
this token will have no impact on the physical simulation of superelevation, this only forces
889+
the graphical elements to be enabled or disabled.
890+
891+
To define a superelevation standard, add an ``ORTSSuperElevation`` block to the route's .trk
892+
file and add some (or all) of the following parameters inside the ``ORTSSuperElevation`` block:
893+
894+
- ``MaxFreightUnderbalance`` -- The maximum amount (using units of length) of cant deficiency/underbalance
895+
that should be allowed for trains travelling at the freight speed limit. Larger allowed underbalance
896+
results in less extreme superelevation. (Default 100 mm for metric routes, 2 in for imperial routes.)
897+
- ``MaxPassengerUnderbalance`` -- The maximum amount (using units of length) of cant deficiency/underbalance
898+
that should be allowed for trains travelling at the passenger speed limit. (Default 150 mm / 3 in.)
899+
For comfort reasons, the underbalance values should be equal to or less than the
900+
``ORTSUnbalancedSuperElevation`` value used by the rolling stock on the route. If the superelevation
901+
required to achieve the max passenger underbalance is different from that required for freight, the
902+
curve will use whichever superelevation is larger (the actual amount of underbalance may be lower).
903+
- ``MinimumCant`` -- If a curve needs superelevation, the amount of superelevation will be no lower than
904+
this value (given in units of length). (Default 10 mm / 0.5 in.)
905+
- ``MaximumCant`` -- Sets the maximum amount of superelevation (units of length) that any curve is allowed
906+
to have, regardless of other factors. Usually curves should be designed to avoid reaching this limit, as
907+
exceeding the limit could result in excessive curve force or even trains toppling over at low speeds.
908+
(Default 180 mm / 6 in.)
909+
- ``Precision`` -- Determines the accuracy (in length) to which the superelevation is maintained. If
910+
the superelevation required by a curve is not a nice number, it will be rounded up to the nearest
911+
multiple of ``Precision``. (Default 5 mm / 0.25 in.)
912+
- ``MaxRunOffSlope`` -- Sets a limit on the amount of change in superelevation per unit length along a curve
913+
(quantity is unitless). This allows for smooth transition between flat and superelevated track at low speeds.
914+
(Default 0.003.)
915+
- ``MaxRunOffSpeed`` -- Sets a limit on the amount of change in superelevation per second (units of speed) when
916+
travelling at the max speed for the curve. This allows for smooth transition between flat and superelevated
917+
track at high speeds. (Default 55 mm/sec / 1.5 in/sec.)
918+
- ``MinimumSpeed`` -- The minimum speed limit required for superelevation to be added to a curve. Useful for
919+
preventing superelevation from being generated in yards. (Default 25 kmh / 15 mph.)
920+
- ``MaximumSpeed`` -- The maximum speed limit allowed for superelevation to be added to a curve. This
921+
is only useful if a route needs multiple sets of superelevation settings. See section below for a
922+
description on use of multiple superelevation standards. (Default unlimited.)
923+
924+
Any parameters not specified will use the default values, which are suitable for most medium-speed routes.
925+
Upon route loading, the given parameters will be used to calculate the appropriate amount of superelevation
926+
for each curve based on the curve radius and speed limits. An example ``ORTSSuperElevation`` block which
927+
defines the superelevation standard used by Union Pacific is given below::
928+
929+
ORTSSuperElevation(
930+
MaxFreightUnderbalance ( 1in )
931+
MaxPassengerUnderbalance ( 3in )
932+
MinimumCant ( 0.25in )
933+
MaximumCant ( 5in )
934+
Precision ( 0.25in )
935+
MaxRunOffSlope ( 0.0019 )
936+
MaxRunOffSpeed ( 1.25in/s )
937+
MinimumSpeed ( 15mph )
938+
)
864939

865-
It should be noted that currently this information only applies to physics calculations
866-
for superelevation. The visual movement of the train due to superelevation is set within
867-
the option menu.
940+
Note that it is also possible to create a superelevation standard which entirely disables superelevation
941+
on the route, should the real railroad not use superelevation. This can be achieved by setting
942+
``MaximumCant ( 0 )`` and leaving all other values default. Note that this disables both physics and visual
943+
superelevation::
868944

869-
The values are assigned by inserting the following parameter::
945+
ORTSSuperElevation(
946+
MaximumCant ( 0 )
947+
)
870948

871-
ORTSTrackSuperElevation ( x y .......... )
949+
More than one ``ORTSSuperElevation`` block can be added to the .trk file to facilitate routes that require
950+
different superelevation standards for different track speeds (for example, a route with both standard speed
951+
160 kmh tracks and dedicated 300 kmh high speed tracks). If a track has a speed limit below ``MinimumSpeed``
952+
or above ``MaximumSpeed``, the track will skip the superelevation standard defined and check the next standard in
953+
the .trk file to see if the speed limit is in between the min and max of that standard. Only if the track
954+
speed is out of bounds for every superelevation standard will no superelevation be applied at all. For
955+
example, to have 3 different types of superelevation on one route, one from 25-60 kmh, another from 60-160 kmh,
956+
and a third standard for 160 kph and up, the required Minimum/MaximumSpeed settings would look like this::
957+
958+
ORTSSuperElevation(
959+
...
960+
MinimumSpeed ( 25km/h )
961+
MaximumSpeed ( 60km/h )
962+
)
963+
ORTSSuperElevation(
964+
...
965+
MinimumSpeed ( 60km/h )
966+
MaximumSpeed ( 160km/h )
967+
)
968+
ORTSSuperElevation(
969+
...
970+
MinimumSpeed ( 160km/h )
971+
)
972+
973+
Note that the order of the ``ORTSSuperElevation`` blocks is important; they are read from top down
974+
so the slowest superelevation standard should be on top of all faster superelevation standards.
975+
976+
Open Rails also supports a simpler way to define superelevation based on curve radius only, resulting
977+
in the same superelevation regardless of track speed. If a railroad uses this simplified method, they
978+
would provide a table of track curve radii and the superelevation used at that radius (usually also
979+
including a maximum speed for the curve). This table can then be provided to OR using the
980+
``ORTSTrackSuperElevation`` parameter in the .trk file::
981+
982+
ORTSTrackSuperElevation (
983+
x1 y1
984+
x2 y2
985+
........
986+
)
872987
873-
where x and y are a series of paired parameters specifying the curve radius in metres (x value),
874-
and the amount of superelevation in metres (y value). The statement will take as many paired
875-
values as desired. Each paired set of values must have an x and y value present. If it is desired
876-
to 'hold' a certain value of SuperElevation for a number of different radii curves, then the same
988+
Where x and y are a series of paired parameters specifying the curve radius (default meters)
989+
(x value), and the amount of superelevation (default meters) (y value). The statement will take
990+
as many paired values as desired, as long as the radius values are in increasing order.
991+
Each paired set of values must have an x and y value present. If it is desired
992+
to 'hold' a certain value of superelevation for a number of different radii curves, then the same
877993
y value needs to be used for succeeding values of curve radius. Where the y value changes between
878-
curve radii, then Open Rails will extrapolate the y value between the two points.
994+
curve radii, then Open Rails will interpolate the y value between the two points.
995+
996+
Superelevation calculated using ``ORTSSuperElevation`` will generally override any values
997+
entered in ``ORTSTrackSuperElevation`` unless the ``ORTSSuperElevation`` block did not specify
998+
a value for ``MaxFreightUnderbalance`` or ``MaxPassengerUnderbalance``. If neither is given,
999+
superelevation will be replaced with the value given by ``ORTSTrackSuperElevation``, but will
1000+
be adjusted to match the given values of minimum and maximum cant, precision, and runoff. This
1001+
way, it is possible to represent a wide variety of superelevation configurations.
8791002

8801003

8811004
Overhead (catenary) wire
Loading

Source/Documentation/Manual/news.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ What's been improved
4040
- controls for electric locos
4141
- air brake features for both European and American brake systems
4242
- accurate friction simulation for 4 types of brake shoes
43+
- superelevation system rewritten to be smoother and more configurable
4344

4445

4546
Other changes

Source/Documentation/Manual/options.rst

Lines changed: 47 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -736,16 +736,46 @@ Some experimental features being introduced in Open Rails may be turned on
736736
and off through the *Experimental* tab of the Options window, as
737737
described below.
738738

739-
Super-elevation
739+
.. _options-superelevation:
740+
741+
Superelevation
740742
---------------
741743

742-
If the value set for *Level* is greater than zero, ORTS supports super-elevation
743-
for long curved tracks. The value *Minimum Length* determines
744-
the length of the shortest curve to have super-elevation. You need to
745-
choose the correct gauge for your route, otherwise some tracks may not be
746-
properly shown.
744+
ORTS implements graphical superelevation (tilting) of tracks using Dynamic Tracks.
745+
For superelevation to appear, the route must have one (or more) ``<route folder>/TrackProfiles/
746+
TrProfile.stf`` files. A document describing the creation of track profiles, ``How to
747+
Provide Track Profiles for Open Rails Dynamic Track.pdf``, can be found in the
748+
*Menu > Documents* drop-down or the Open Rails ``/Source/Documentation/`` folder. Forum
749+
discussions about track profiles can also be found on `Elvas Tower
750+
<http://www.elvastower.com/forums/index.php?/topic/21119-superelevation/
751+
page__view__findpost__p__115247>`_.
747752

748-
When super-elevation is selected, two viewing effects occur at runtime:
753+
However, superelevation will also appear if the route has a superelevation standard
754+
``ORTSSuperElevation`` :ref:`defined within the route's .trk file <features-route-curve-superelevation>`
755+
regardless of the use of track profiles. *It is recommended to combine* **both** *track profiles
756+
and ``ORTSSuperElevation`` for best results*, as dynamic track (ie: superelevation) is rendered
757+
as Kuju track without any track profiles installed, which may not appear correct.
758+
759+
.. note::
760+
761+
This behavior can be overwritten if ``ORTSForceSuperElevation ( 0/1 )`` is present in the .trk file.
762+
A setting of 0 will always disable superelevation graphics, while 1 always enables it, regardless
763+
of the criteria described here.
764+
765+
To support routes without Track Profiles and without ``ORTSSuperElevation``, the
766+
"Legacy Superelevation" option can be enabled. This will activate superelevation visuals
767+
on routes regardless of missing data, which may be appropriate for original MSTS routes but
768+
will not be aesthetically pleasing for routes using more modern track shapes. Experimentation
769+
may be required to determine the correct setting, and *editing of routes* (to add data to the
770+
.trk file and/or to add track profiles) will be required for best results.
771+
772+
.. note::
773+
774+
The configuration described here only affects the visual depiction of superelevation.
775+
Superelevation is still considered by train physics regardless of the state of the visual system.
776+
777+
When visual superelevation is enabled (either through correct configuration of a route,
778+
or enabled with the "Legacy Superelevation" option), two viewing effects occur at runtime:
749779

750780
1. If an external camera view is selected, the tracks and the running
751781
train will be shown inclined towards the inside of the curve.
@@ -755,15 +785,16 @@ When super-elevation is selected, two viewing effects occur at runtime:
755785
.. image:: images/options-superelevation_1.png
756786
.. image:: images/options-superelevation_2.png
757787

758-
OR implements super-elevated tracks using Dynamic Tracks. You can change
759-
the appearance of tracks by creating a ``<route folder>/TrackProfiles/
760-
TrProfile.stf`` file. The document ``How to Provide Track Profiles for
761-
Open Rails Dynamic Track.pdf`` describing the creation of track profiles
762-
can be found in the *Menu > Documents* drop-down or the
763-
Open Rails ``/Source/Documentation/`` folder. Forum
764-
discussions about track profiles can also be found on `Elvas Tower
765-
<http://www.elvastower.com/forums/index.php?/topic/21119-superelevation/
766-
page__view__findpost__p__115247>`_.
788+
Note that superelevation usually won't be this distinct. The amount of superelevation
789+
depends on the track speed limit and curve radius, where higher speeds and tighter curves
790+
lead to more intense superelevation.
791+
792+
Additionally, the superelevation physics system requires knoweldge of the gauge of track used on
793+
the route. Normally, this should be defined with ``TrackGauge``
794+
:ref:`in the .trk file <features-route-curve-superelevation>`, but many routes have the gauge value
795+
set to 0, which is not useful. In such a case, the program must use the gauge (in millimeters)
796+
specified by the "Default Gauge" option. Note this assumes the entire route has the same gauge of track.
797+
Multi-gauge routes are not fully supported at the moment.
767798

768799

769800
.. _options-shape-warnings:

0 commit comments

Comments
 (0)