The BVE5 Map route format

■ Contents

■ 1. Overview

This page describes the BVE5 / BVE6 map file format.

The file is a plain text file encoded in any arbitrary encoding as defined in the file header, however, UTF-8 with a byte order mark is the preferred choice.

■ 2. File Header

The first line of the Map file must be a header string in the following format:

BveTs Map 2.02:UTF-8

The header string consists of the file identifier BveTs Map, followed by the file format version- Versions up-to and including *2.02 * are supported.

Optionally, the header string may be followed by a colon and the textual name of the text-encoding necessary to read the file correctly.

⚠

BVE5 and BVE6 use the SHIFT_JIS encoding by default, but you should consider using UTF-8 for better compatability.

■ 3. Curves

Curve.SetGauge (ValueInMeters)
ValueInMeters: A floating-point number representing the rail gauge, measured in *mmeters. The default value is 1.435.

This command sets the gauge of the track, and is used when converting the Cant value to an absolute angle of rotation.

Curve.SetFunction (Function)
Function: The type of interpolation to perform. 0- Half sine wave, 1- Linear

This command sets the interpolation function used from this point onwards for the player’s track.

Legacy.Curve (Radius; CantInMeters)
Radius: A floating-point number representing the radius of the curve in meters. The default value is 0.
CantInMillimeters: A floating-point number which represents the superelevation of a banked curve, measured in meters. The default value is 0.

This command defines the radius of the curve for the player’s rail from this point on.

Negative values for Radius indicate a curve to the left, positive ones to the right- The value of 0 represents straight track.

The CantInMeters parameter defines the cant (superelevation) in meters.

⚠

Note that unlike the other Curve commands, no interpolation is performed.


Curve.BeginTransition ()

This command sets the distance for the curve transition to begin if required to be different to that of the preceeding Curve command.

Curve.Begin (Radius; CantInMeters) Curve.Change (Radius; CantInMeters)
Radius: A floating-point number representing the radius of the curve in meters. The default value is 0.
CantInMeters: A optional floating-point number which represents the superelevation of a banked curve, measured in meters. The default value is 0.

This command defines the radius of the curve for the player’s rail from this point on. If the CantInMillimeters value is set, the cant is interpolated using the interpolation function set by Curve.SetFunction from the distance of the preceeding Curve.BeginTransition command, or the preceeding Curve command.

Negative values for Radius indicate a curve to the left, positive ones to the right- The value of 0 represents straight track.

The CantInMeters parameter defines the cant (superelevation) in meters- If this parameter is used, a Curve.BeginTransition command must have been issued previously.

Curve.End ()

This command ends the current curve, and has the same effect as a Curve.Begin(0,0) command.

Curve.Interpolate (Radius; CantInMeters)
Radius: An optional floating-point number representing the radius of the curve in meters. The default value is 0.
CantInMillimeters: A oprional floating-point number which represents the superelevation of a banked curve, measured in meters. The default value is 0.

This command defines the radius of the curve for the player’s rail from this point on. The cant and radius are interpolated using the interpolation function set by Curve.SetFunction from the distance of any precceding Curve command.

Negative values for Radius indicate a curve to the left, positive ones to the right- The value of 0 represents straight track.

The CantInMeters parameter defines the cant (superelevation) in meters- If this parameter is used, a Curve.BeginTransition command must have been issued previously.

If no arguments are specified, interpolation is enabled from this point onwards, using the radius and cant specified by the preceeding command.

■ 3. Gradients

Gradient.Begin (PerMille) Gradient.BeginConst (*PerMille)
PerMille: A floating-point number representing the gradient in per mille (parts per thousand- ‰)

This command defines the base pitch of all rails from this point on. Negative values indicate a downward gradient, positive ones an upward gradient. The value of 0 represents a level track.

Gradient.End ()

This command ends the current gradient, and has the same effect as a Gradient.Begin(0) command.

Gradient.Interpolate (*PerMille)
PerMille: A floating-point number representing the gradient in per mille (parts per thousand- ‰)

This command defines the base gradient for all rails from this point on. The gradient is linearly interpolated from any preceeding Gradient command.

If no arguments are specified, interpolation is enabled from this point onwards, using the gradient specified by the preceeding command.

■ 3. Other Tracks

The Map format allows for an unlimited number of other tracks. Each track must be defined using a unique textual key, referred to here as trackKey

Please see the Key documentation for further details on validity rules for keys.

A track is implicitly started when a unique key is first used- If no position is defined, it will start at 0,0 relative to the player’s rail.

⚠

Where two co-ordinates exist for a track at the same position, the first will be used, and the second ignored.

Track[trackKey].Cant.SetGauge (ValueInMeters) Track[trackKey].Gauge (ValueInMeters)
ValueInMeters: A floating-point number representing the rail gauge, measured in *mmeters. The default value is 1.435.

This command sets the gauge of the track, and is used when converting the Cant value to an absolute angle of rotation.

Track[trackKey].Cant.SetCenter (X)
X: A floating-point number representing the rotational center offset of cant from the current distance.

This command sets the rotational center offset for placed objects, and is used when converting the Cant value to an absolute angle of rotation.

Track[trackKey].SetFunction (Function)
Function: The type of interpolation to perform. 0- Half sine wave, 1- Linear

This command sets the interpolation function used from this point onwards for the track.

Track[trackKey].Position (X, Y, Radius, Pitch)
X: An optional floating-point number, describing the track’s X-coordinate, relative to the player’s rail. The default value is 0. Y: An optional floating-point number, describing the track’s Y-coordinate, relative to the player’s rail. The default value is 0. RadiusH: An floating-point optional number, describing the track’s curve radius, relative to that of the player’s rail. The default value is 0. RadiusY: An floating-point optional number, describing the track’s pitch, relative to that of the player’s rail. The default value is 0.

This command sets the position, curve radius and pitch of the track at the current distance. Interpolation is performed to any preceeding Track command.

Track[trackKey].X.Interpolate (X, Radius)
X: An optional floating-point number, describing the track’s X-coordinate, relative to the player’s rail. The default value is 0. RadiusH: An floating-point optional number, describing the track’s curve radius, relative to that of the player’s rail. The default value is 0.

This command sets the X position and curve radius of the track at the current distance. Interpolation is performed to any preceeding Track command, retaining the current Y value.

Track[trackKey].Y.Interpolate (Y, Radius)
Y: An optional floating-point number, describing the track’s Y-coordinate, relative to the player’s rail. The default value is 0. RadiusH: An floating-point optional number, describing the track’s curve radius, relative to that of the player’s rail. The default value is 0.

This command sets the Y position and curve radius of the track at the current distance. Interpolation is performed to any preceeding Track command, retaining the current X value.

Track[trackKey].Cant.BeginTransition ()

This command sets the distance for the cant transition to begin, if required to be different to the preceeding Track[trackKey].Cant command.

Track[trackKey].Cant.Begin (ValueInMeters)
ValueInMeters: A optional floating-point number which represents the superelevation of a banked curve, measured in meters. The default value is 0.

This command defines the cant of the track from this point on, and is interpolated from the preceeding Track[trackKey].Cant command.

Track[trackKey].Cant.End ()

This command ends the current cant, and has the same effect as a Track[trackKey].Cant(0) command.

Track[trackKey].Cant.Interpolate (ValueInMeters) Track[trackKey].Cant (ValueInMeters)
ValueInMeters: A optional floating-point number which represents the superelevation of a banked curve, measured in meters. The default value is 0.

This command defines the cant of the track from this point on, and is interpolated from the preceeding Track[trackKey].Cant command.