#
GR_banner.gif - 51273 Bytes

Overview of GlobalRail simulator project

This software was designed to give the player a front view
and first-hand experience of driving a simulated locomotive.
The cab view and sounds try to present the actual events of
a typical rail vehicle operator at work.

In addition to simulating the cab environment, additional tools
have been provided to build rail infrastructure ie locomotives,
cars, time tables and routes. The input required to build these
objects can easily be obtained from books, magazines and maps.
Many sources of railway information, eg the local library or the
web, can be applied in this simulator package.

The simulator will assist the player in the following tasks:
- Building of loco cab items ie controls and gauges
- Building rail vehicles (car/wagon)
- Building routes with basic scenery
- Compiling working timetables on the route
- Swap these items with others so that a library of railway
rolling stock can grow.

SPike May, 2001

#

Background information

The enthusiasm for train simulations has grown immensely.
The intended aim of this project is to allow any rail enthusiast
the means to create a rail world using basic tools of the home
ie computer (+ scanner), calculator and books. The level of detail
required to build a route or loco is not great so that the task is
not too hard to complete.

We have seen in the last 5 years a fast evolution of the Train Sim
style of computer game. The early attempts had limited computer
power and poor developer tools. New software tools, better PCs,
cheaper scanners and the web have triggered an explosion of Train Sim
activity across the planet.

I started in 1984 on a Mac SE/30. My imagination has built a train sim
which I carry around all the time in my head. I add and modify the sim
using rail engineering principles and personal experiences. The key to a
creating a good train sim is to explore the fundamentals of a locomotive
(or power car) and construct a piece of computer science that will approximate
the behaviour closely as possible. If you try to match the system too
precisely then you could be at it for decades. I will try not to fall into that trap.

As well as time being a problem for the creator of the simulator, time could
be a problem for the game player who wants to get on with it. In light of
this, the GlobalRail simulator must be designed with easy tools built-in,
and the volume of information required to create a loco must be finite and
relatively simple. I will try to give tips and methods for those new to rail
engineering, eg "How to calculate approx. total tractive effort".

#

ToDo list

Near Future
- Add grades, ie up hill/down hill.
- Add route editor for easy track laying.
- Add custom tractive effort performance curve from loco INI file.
currently it is static for all locos. (see Figure1)
- Add sound data pairs in loco INI file so that custom sounds
can be assigned to the loco.
- Add key assignments to primary controls ie throttle, brake and reverser.

Figure 1.
image003.gif - 43060 Bytes

Future
- add new CIT type "Video/Digital panel"
- add grade profile plot in cab view, ie graph of track elevation
for the next 2000 meters.
- design signal system
- rocking motion for camera/eye
- curve resistance and derail code
- more weather parameters

#

Playing the Game (simulation)

Overview Before you can open the throttle the sim must be set up:
a route selected, a timetable selected, finally select a train.
All these elements can be saved as a situation file.

The order of the train vehicles (called the consist) can be altered
during the game. There are no rules set for loco/car combinations.
You can pull a coal hopper behind a subway power car.
Similarly there are no rules with the timetable. Currently
the sim will show the timetable and your milepost location.

Start up sequence
The first screen offers the player to load a saved situation or
"The Previous Situation". This situation was saved when you
quit your previous session of the sim. The text file has the following
lines:
line 1: route filename
line 2: track segment number
line 3: timetable filename
line 4: train filename
line 5: hour minute (current sim time)
line 6: DRY or WET (weather setting)

The text file can be edited outside the game or you can save the situation
within the game.

Note: the sim only has one route data file. Do not change line 1.
More routes will available when the route editor is released soon.

If you press the "New" button a second screen is displayed offering
the player to create a new situation. The pull down lists contain the
available routes (one for now), timetables or trains.
- route data (.dat) file (will contain the scenery and track layout info)
- timetable (.wrk) file contains a list of distance/location pairs
- train file (.trn) is a array file of rail vehicles (cannot edit this file)
Next to the train list, is the "Add Train" button. A new consist can be
built and saved to the "rail yard" directory where all trains are stored.

After you make the selections, enter a situation name and press
the "Save" button. Press 'OK' to return to the main window (cab view).

#

The Menus

File menu

New Situation - takes you to the situation selection window.

Load Situation - takes you to the first screen to open an existing situation file.

Save Situation - Displays a Save Dialogue box and then saves current
situation info to file.

Start Sim - a number of actions occur here.
- the track route is generated from the survey file (will be replaced
later with a route editor)
- random scenery is scattered around the track path
- the sound files are initialised
- 3D window is initialised and scenery drawn
- the simulation clock is started (the frames per second is set at 20 fps)

Quit - save the current situation and exit program.

Edit Menu

Train Consist - Displays train building window. Vehicles can be changed while
the sim running. Tick the save check box to save the new train to file.
(see Marshalling heading)

Loco Physics - allows the player to change loco parameters during the game.
Note:
the traction units already saved in a train file (.trn) will not have the new settings.
Please save the train to disk to keep your changes (see Train Consist menu).

Cab Layout - the sim program will switch to "loco editor mode". The cab layout
ie the type and position of cab item (.cit) is arranged by the player/designer.
A open dialogue box is displayed. After the designer selects a traction INI file
then the "Cab Items" menu is enabled so that you can edit the cab.

Cab Items Menu

Insert - displays a cab item (CIT) preview window. Existing CIT files are listed.
Click to preview appearance and its CIT type. Press "New" to create a new CIT
of the same type of the last item selected. Press "Insert" to add the current CIT
to your cab.

Edit - displays the CIT attributes window. Here you can change the min/max
model name, position, size etc. More information regarding cab layout under
the Building Locos heading.

Environment Menu

Jump To - allows the player to relocate the train to an arbitrary point on the
route. Each train segment has a unique number. It is not a milepost distance.
Warning: the scenery code redraws the world gradually as you move along
the route. This will be improved soon.

Options - displays the sim options window. Modify 3D window settings, sound
on/off, rail condition and weather (wet or dry). The 3D window settings are saved
to the traction INI file. The weather setting is saved to a situation file when you
save the current situation.

Help Menu

Help - displays this help document.
About - displays version information.

#

Marshalling (arranging your train vehicle sequence)

Select Edit/Train Consist menu to view your train.
- To change a vehicle, select a traction unit (loco) or car unit
from the pop down lists, then click the cell in the grid.
- To view a vehicle unit details, hold down the 'Alt' key and
click the cell in the grid.
- To delete a vehicle (not available yet, forgot to code this action)
- Moving a vehicle is also not available (soon).

Tick "save train" checkbox if you wish to save your new train to file (.trn).

#

Building Locos

Overview
Summary of building a loco follows:
- draw cab jpeg file in a paint/photo program
- draw/obtain a external image of your loco
- create new traction directory and copy INI file from template.
- add cab items over background image
- enter general info and physics data

The Traction INI File

First decide on a loco identifier (for this example - loco_id).
Create a new directory (loco_id) under the traction directory.
Copy the template INI file to this new directory. Rename template.ini to
loco_id.ini
Add cab background image to the loco_id directory. Name the image file,
loco_id-cab.jpg (recommend 795 wide by 525 pixels high)
Add the external image of the loco to the directory as loco_id-ext.bmp
[The image should be a Windows Bitmap approx 280 pixels wide and 100 pixels
high (minimum) at 150 dpi. This image will be displayed in the train grid.
Choose a side-on view with the forward direction to the left. ]

Estimating tractive effort (TE) for a locomotive


The maximum tractive effort on a locomotive driving wheels is based on a
standard velocity of 20 km/h. The primary influence of the maximum value is the
weight on the drivers. The other major factor is the adhesion limit ie the force of
pull just before slipping occurs. Creep is when the wheels slip but still apply
force to the rail head. gm is the acceleration due to gravity.

TE max = Weight x gm x coeffient of Adhesion x creep factor

Loco weighs 120tonnes. (all wheels are powered)
Adhesion is 30%, creep = 1.10 (ie 10% extra pull)

TE = 120 x 9.806 x 0.30 x 1.1 = 388 kN

If the power unit cannot provide the required horse power, the TEmax must be
scaled down.
HP = (TE1 x V) / 308

TE1 in lb force (lb = kN / 0.00445)
V in mph (20 km/h = 12 mph)

If TE = 388 kN then TE1 = 87 190 lb

HP = (87190 x 12) / 308 = 3400 HP

If the loco power unit is rated at 2800 HP then
the estimated TEmax = 388 x (2800 / 3400) = 320 kN

This number can be used in the maxTraction entry of the [loco physics] section
of the traction INI file.

#

Designing a Cab

Run the GlobalRail.exe program, select the Edit / Cab layout . . . menu.
Update the physics data if you have them ready.
Select the Cab Items / Insert . . . menu.
Choose a cab item and press "Insert" button.
If the CIT is new and you have created the bitmap images earlier, then
press the "New" button and enter the CIT parameters.
Right-Click the CIT and right-click at the new position with in the cab.
The modify an existing CIT, right-click the item, and
select Cab Items / Edit . . . menu.
The information is automatically saved to the traction INI file. To delete a CIT
item, remove its entry from the traction INI file.
Comment on CIT images
Most CIT types need at least one background image. (A 256 colour windows
bitmap at 150 dpi) The control CIT type will have a series of images assigned to
represent the motion of the handle. The BackBitmap image name field in the CIT
edit dialogue box will be base_name. When the 'OK' button is pressed the
program looks for image files in the cab items/images directory. If the throttle
has 9 notches then the images required to be prepared are:

base_name1.bmp	base_name4.bmp	base_name7.bmp

base_name2.bmp base_name5.bmp base_name8.bmp

base_name3.bmp base_name6.bmp base_name9.bmp

For this example, the Minimum value equals 1 and Maximum value equals 9.
After the CIT has been created and finalised, you may archive the images from
the GlobalRail game. The image array is encoded into the CIT file. The file size
is large but they compress well (90% savings). Sharing the CIT files allows us to
share locos amongst gamers.

The Universal Cab

To allow any cab to be simulated, the GlobalRail project uses the concept of the
Universal Cab. The system consists of 5 cab item types, 17 sim models and 6
traction types. The number of each of these may evolve over time to meet the
needs of the project.

CIT types

- control , a lever or handle
- gauge , any output device
- swtogg , a toggle switch either on or off, eg. head light switch
- swpush, momentary push button switch eg horn
- light , light bulb or LED indicator

sim models

- throttle air pressure gauges: - vigilance (not yet)
- autobrake - MRpres, BPpress, - sander
- indbrake BCpress, ERpress, BPflow - wheelslip
- reverser - dynbrake - lineVolt
- brakeAmp - motorAmp - horn
- speed - controller - throttle-brake

traction types

- ELE electric loco
- DEL diesel-electric loco
- EMU electric multiunit
- DMU diesel multiunit
- SUB subway power car
- STE steam loco
- HST high speed train

Each sim model can only be one CIT type. The gauge and light CIT type are
outputs, the other types are inputs to the simulator. As a designer you must
ensure that each sim model for your loco are mapped to a cab item in the cab.

Note: The official list of sim models which must be present in each traction type
will be finalised soon.

#

UpdateCab code example

The current UpdateCab routine is show here:

procedure UpdateCab;
var
    dummy: modelRec;
begin
    { COMMON CITs first }
    updateCIT(reverser_frame);>
    FrameToReverser(reverser_frame);
    updateCIT(trainBrkPos);
    updateCIT(airsys.brkpipe);
    updateCIT(vel);
    updateCIT(sander);
    updateCIT(horn);
    if horn.value = 1 then begin
        horn.value := 0;
        SoundHorn;
    end;
    case cab_type of   // 10 more types to add
    ttELE: begin
        updateCIT(throtpos);
        FrameToDynaThrottle(throtpos);
        updateCIT(indBrkPos);
        updateCIT(motorAmp);
        updateCIT(motorTemp);
        lineVolt.value := randG(25, 1);  // kilo volts
        updateCIT(lineVolt);
        updateCIT(wslip);
        updateCIT(airsys.flowrate);
        updateCIT(airsys.equalres);
        updateCIT(airsys.cylinder);
        end; {of ttELE}
    ttSUB: begin
        updateCIT(throtpos);
        FrameToController(throtpos);
        updateCIT(wslip);
        updateCIT(airsys.equalres);
        updateCIT(airsys.cylinder);
        motorAmp.value := motorAmp.value/6;
        updateCIT(motorAmp);
        updateCIT(brakeAmp);
        lineVolt.value := randG(25, 1);
        updateCIT(lineVolt);
        case Round(trainBrkPos.value) of
            0 : bMode := release;
            1 : begin bMode := service; airsys.BPreduction := 5; end;
            2 : begin bMode := service; airsys.BPreduction := 10; end;
            3 : begin bMode := service; airsys.BPreduction := 15; end;
            4 : begin bMode := service; airsys.BPreduction := maxreduct; end;
        end; {case}
    end; {ttSUB}
    ttHST: begin
        updateCIT(throtpos);
        throtpos.value := throtpos.value -1;
        updateCIT(wslip);
        updateCIT(airsys.brkpipe);
        updateCIT(airsys.cylinder);
        updateCIT(airsys.mainres);
        updateCIT(motorAmp);
        case Round(trainBrkPos.value - 1) of
            0 : bMode := release;
            1 : begin bMode := service; airsys.BPreduction := 3; end;
            2 : begin bMode := service; airsys.BPreduction := 6; end;
            3 : begin bMode := service; airsys.BPreduction := 10; end;
            4 : begin bMode := service; airsys.BPreduction := 14; end;
            5 : begin bMode := service; airsys.BPreduction := 18; end;
            6 : begin bMode := service; airsys.BPreduction := 22; end;
            7 : begin bMode := service; airsys.BPreduction := maxreduct; end;
        end; {case}
    end; {ttHST}
    end; {case traction_type}
    if not ep_mode then { auto brake INPUT}
    case Round(trainBrkPos.value) of
        1 : bMode := release;
        2 : bMode := running;
        3 : bMode := lap;
        // initial service
        4 : begin bMode := service; airsys.BPreduction := 10; end;
        // full service
        5 : begin bMode := service; airsys.BPreduction := maxreduct; end;
        6 : bMode := emerg;
    else
        //
    end; {case}
end; {updateCab}

#

Designing a Rail Car/Wagon

This easier than a loco. No cab to design, just the external image to draw and
the car INI file to create.

- First decide on a car identifier (for this example - car_id).
- Create a new directory (car_id) under the rolling stock directory.
- Copy the template INI file to this new directory.
- Rename car_template.ini to car_id.ini
- Add the external image of the loco to the directory as car_id-ext.bmp
[ The image should be a Windows Bitmap approx 280 pixels wide and
100 pixels high (minimum) at 150 dpi. This image will be displayed in the train
grid. Choose a side-on view.]

xArea is cross-sectional area in square meters. To calculate an approx. value
multiply the car height by the width in meters.

maxBrake is the maximum retarding brake force in kilo Newtons (kN).
If the maximum required deceleration is 0.75 m/s/s and the mass is 50 tonnes
then the braking effort is 37.5 kN. (F=ma) Freight cars typically decelerate at
0.75 m/s/s and a passenger coach car or subway unit at 1.30 m/s/s .

Most physical units are SI system.

#

Building a Route

Overview
This area of the project is currently being finalised. The scenery and track
geometry are generated from a file of X-Y land survey points. Unfortunately, no
Z values were available therefore it is a flat world. The route is approx 170 km in
length. The survey points are 1 to 2 km apart. The 100m track segments are
layed end-to-end to join these points. Some bad turns are encountered.

The trees and houses are randomly scattered over the route. Don't worry that
objects are on the track. I could not fine tune the code to keep the objects off the
track. When the route editor is available these undesirable effects will be
avoided.

To create a large scale route covering many miles on country-side a simple
model of scenery objects must applied. The current model is based on linked
track segments.

Track Segments

Each segment possessing a group of attributes:
- position x/y/z axis
- index number
- next track index
- previous track index
- location name
- landmark identifier
- scenery objects array

If the track segment is 100 meters long, then 170 km requires 1700 track
segments. If each segment has 8 scenery objects assigned to it, then that is
13600 objects. I don't wish to create each of these individually, that would take
forever.

The route editor will lay track in 4 to 8 segments for each click. The segments
will be aligned over a topological map (scanned in from the library photocopy)
then saved to disk. The curvature between segments will be limited to 5 to 8
degrees maximum.

Figure 2
image004.gif - 90638 Bytes

#

Track profile

Landmarks such as signal installation, station buildings, bridges, level crossings,
speed limit signs etc etc can be recorded in a track profile file. All positional
values are based on the milepost system. When the track segments are drawn
in the 3D world, the landmarks are loaded from file and drawn into the world.
The separation of track segment data from profile information will allow the
permanent way to be relatively fixed, and the infrastructure specified in the track
profile fully changeable eg switch from old era 1960 to modern era 1990.
Another issue is the way track profile information is obtained. Very few people
have access to full X/Y/Z data of railway routes, but some sources do distribute
milepost data showing the location of useful structures along the route and grade
changes at specified milepost positions.

If you combine the profile data (Z-axis) with topo map (X-Y axis) data then we
can see a full 3D railway world.

The track profile in GlobalRail can be found in routes/Gladston-Moura in a file
called track_profile.txt. The first value is the milepost position in Kilometers.
The second value is the landmark identifier. The spelling must be identical to the
name in the landmark file.

Landmark file

This file can be found in routes directory. All known landmark objects are listed
in this file. The first value is the offset distance (in meters) the object is placed
relative to the track center line. positive means place to the left, negative means
place to the right. Every object list here must present in the world file.

World file

This can be found in the world/architype.wld directory. The morfit file can be
loaded into the morfit world builder see The Morfit 3D web page. Every landmark
must be constructed and placed into generic 3D rail world. The position is not
important because the simulator moves them every 30 seconds during the game.

Remember I said, I did not want to build 13 600 objects. The eye will only see a
few trees or houses at any one time, so when the train passes a scene (ie 100
meters of track) then all objects are free to be moved ahead of the train, about
500 meters ahead. This gives us endless rolling scenery. The downside is that
the eye could get bored with the repeating objects.

The objects can be easily cloned in the morfit world builder. This is necessary
so that the current scene has sufficient objects. If you need 6 track segments
and few signals and track-side features near by, then the world file must have
signal1, signal2, signal3, signal4 so on and so on available to the simulator.

Main license cause reads:

LICENSE GRANT. MORFIT hereby grants to you, and you accept, a non-exclusive,
royalty-free license to use the Engine only for the purpose of developing
and running applications that do not, and are not intended to, generate
revenue of any kind, directly or indirectly (application/s developed using
the Engine are referred to hereinafter as "Application/s"). In the event
revenues do derive from the exploitation of your Application, you should
comply with the terms of MORFIT's Commercial License

Go back to the Home page