Train Director - User's Manual

 English   -    Italiano   -    Magyar   -    Русский


Light rain in
Mountain View, California

 Main Page

 Territory Directory

 Icons directory

 FAQ

 User's manual

 Schedule File Generation

 Scripts

 Localizations

 Build Instructions

 Discussion Group

Although Train Director was inspired by Train Dispatcher, it now has many more functions. In this page are described all the features of Train Director. In particular, we describe:

This page is specific to version 3 of Train Director.

The screen

When Traindir starts, a screen similar to the following is shown:

The first time one runs Traindir, there won't be any file in the list of recent simulations.

Through the menu item "File+Open..." it is possible to load one of the scenarios present on the disk.

It is also possible to download from the Internet scenarios created by other people, or to create your own layouts with the Edit function.

Typically the scenarios found on the Internet are packed in ZIP files. Traindir is now able to read the content of compressed files directly, without the need to uncompress the files in their own directory. Obviously it is still possible to read uncompressed scenarios by loading the layout file (files .trk).

Once a scenario is loaded, you can see several areas of the screen which are dedicated to different functions:

  • the menu and the status area: the menu commands can be activated with the mouse or using Alt + the underlined letter, just the same as in every other application's menu:

    The status area is used to show the simulated time, the simulation speed and the alert messages. The numbers in the window's header, next to the time multiplier, show how many trains are running (R), how many are ready to enter the territory (r), how many are waiting at a signal (w), how many are stopped at a station (s), and how many have arrived at their destination.

  • the layout of the line(s):

    where the program shows the position of all the trains that have entered the territory at that particular moment, plus the state of each signal and switch.

  • the information panes, mainly the general schedule:

    In the general schedule pane is listed for each train the name, the entry point and the entry time, the intended exit point and exit time, the current speed (if present in the territory), the cumulative number of minutes the train has been late arriving at stations, and the number of minutes the train had to wait to enter the territory (for example because the entry point was occupied by another train).

    By clicking with the right button of the mouse in the general schedule pane, you can set some paramters: it is possible to show or hide those trains which don't run of the specified day, to make the schedule less crowded.

    By double-clicking on a train entry in the list, its time table will be shown in the lower-right pane:

    Since certain simulations require a lot of screen space, Train Director 3 allows to separate the general schedule pane, so that the maximum space can be reserved for the layout of the territory. Using the "View" menu, it is possible to select where one wants to show the general schedule. By default, the "Timetable in split window" is selected, where the general schedule is shown in a pane of the main window.

    Selecting the "Timetable in tabbed window", the general schedule is shown behind the layout window; to show it you need to select the "Schedule" tab, or use the "Ctrl+Tab" key combination, or use the "F4" key.
    When the item "Timetable in separate window" is selected, the general schedule is shown in its own window, as was the case in Traindir 1.x:

    Note that in these last 2 cases you lose the ability to see the Alerts list and a specific train's timetable.

Once loaded a territory, you can start the simulation.
 

The simulation

By using the menu command "Run+Start", or simply by clicking on the "Start" button, or with the keys Ctrl+S, you start/stop the timer, which will advance according to the time multiplier specified on the screen. If the standard simulation speed (10x) is too high, you can reduce it by clicking on the low arrow shown next to the time multiplier (or using the Ctrl+Z key), down to a 1x value, meaning one clock second = 1 simulation second.
If the simulation speed is too low, you can increase it by clicking on the up arrow shown next to the time multiplier (or using the Ctrl+X key), up to 300x, that is 1 clock second = 5 simulation minutes. This is useful to quickly skip hours when there are no trains in the territory.

Obviously the purpose of the simulation is to direct the trains to their correct destination. To do this, it is necessary to carry out the following tasks:

  • throw the switches to direct the trains. Every time you click on a switch, the switch will turn. You cannot throw a switch that is protected by a green signal.
  • allow the passage of the trains by turning the signals to green. When you click on a red signal with the left button, the signal will turn to green, provided that the path to the next signal (or to the end of the line) is not occupied by another train, and that all the switches allow the passage of the trains. Clicking on a green signal the signal will turn back to red.
  • in the scenarios that allow it, the two above actions can be combined by using the itinerary buttons, which automatically turn the switches and open the signals.
  • Enable the automatic block signals, so that it is not necessary to put these signals to green after a train has left the protected block. To do this, it is necessary to click with the right button on a double-light signal that has been previously put to green. The signal will turn from green+red to green+green. These signals normally are in a green+green state, and turn to a red+orange state while a train is occupying the track block protected by the signal. When the train has left the protected block, the signal automatically turns back to green+green.
  • To change the direction of a train when the train is stopped at a station or at a signal. This is useful when a train has been sent in the wrong direction or when the train arrived from a direction and moves on to a line branch in the same direction. To change the train direction, click with the left button on the train icon on the layout. You must wait for the train to stop at a station or signal before you can change its direction,
  • To shunt a train, thus at a reduced speed, until the train reaches the next station (or the train yard). To do this, click with the right button on the train image. The train status will change from "Arrived" to "Shunting" and its speed will be limited to 30 Km/h. This can be useful to free up a platform in a station to allow the arrival of another train.
  • Assign the rolling stock when a train has arrived at its destination station to another train. To assign the rolling stock, you must click on the train's icon with the right button, then you must select the train you want to assign the stock to from the list of trains departing from the station where the arrived train is at that moment:

    Note that you cannot change a train's direction which is arrived to its final destination before having assigned its rolling stock to another train.

During the simulation it's possible that penalty points will be assigned, for example because a train is late arriving at stations. You can show the accumulated penalties up to that point in the simulation by using the command "Run+Performance". The following summary page will be shown, listing the current number for each of the penalties, and the status of each train:

The penalties can be assigned for the following reasons:

  • "Wrong destination": a train has been sent to an exit point (or a final station) which is not in its time table.
  • "Late trains": a train arrived late at its destination.
  • "Wrong platform": a train has been directed to a station platform different from the one specified in its timetable.
  • "Commands denied": you tried to perform a command which would have created a dangerous situation (for example you tried to throw a switch while that switch was protected by a green signal, or you tried to clear a signal to green while the protected track block was occupied by a train).
  • "Trains stopped at signal": you didn't clear a signal to green in time, causing a train to stop at that signal. Sometimes this condition cannot be avoided; for this reason often there are no penalty points assigned for this case.
  • "Turned trains": you requested a train to change its direction twice (thus turning the train back towards its original direction).
  • "Thrown switched": you threw a switch twice, without a train crossing the switch.
  • "Cleared signals": you cleared a signal to green, then you turned the signal back to red, without a train crossing past the signal.
  • "Wrong stock assignments": you assigned the rolling stock of a train to a different train than specified by the timetable.

From this page it's also possible to show the time table of individual trains by clicking on the train's name.

From a train's time table page it's possible to show a station's schedule by clicking on the station's name:

When one of these 3 pages is shown, meaning "Performance", "Train time table" or "Station schedule", you can print the content of the page by using the menu "File+Print...". You can then refer to the printout for a future simulation.

Another way to show a train's time table and its properties is to click on the train's image on the territory while pressing the "Shift" key. You will see the following dialog:

On this dialog you can see additional information, such as the train's type (1, 2, 3 or 4), whether the train's rolling stock comes from another train ("Wait arrival of train"), whether this train will provide the rolling stock for another train ("Stock for train") and in which days the train runs ("Runs on...", 1 = Monday, 7 = Sunday).

Similarly, it's possible to show a station's schedule by clicking on the track element of the station while pressing the "Shift" key:


Other functions from the "Run" menu are:

  • "Run+Graph" shows a graphical representation of the time and space travelled by each train. To take advantage of this feature it is necessary that the distances between the stations be specified in the layout -- see the edit mode for more details.
  • "Run+Station schedule" shows a list of the trains arriving and departing from an individual station. This is useful to check for yielding trains, or to decide the order of arrival of trains in a station. This feature is also accessible by Shift+right-clicking on the station's track.
  • "Run+Set sig. to green" turns all the automatic block signals to green. Protection or departure signals are not affected. Note that the program checks that the path protected by each automatic block signal can legally be turned to green.

During the simulation it is possible to change some features of the simulator by using the menu "Edit+Preferences", which shows the preferences window:

By clicking on the check-box one can enable or disable the following features:

    • "Short train info" - Selects a shorter description on the status line of the train pointed by the mouse.
    • "Status line at top of window" - Shows the status line above or below the layout.
    • "Alert sound on" - Enables the use of a beep when there's a new alert (such as when a train stops at a signal).
    • "View speed limits" - Shows on the layout (with a small circle beside the track element) all the points where a new speed limit takes effect.
    • "Automatically link signals" - in Edit mode, automatically links the signals placed on the layout to the track element to the right (in the running direction) of the signal.
    • "Show grid" - shows a grid that identifies every single coordinate on the layout. This can be used to facilitate the placement of new track elements while in Edit mode.
    • "View long blocks" - show (using a small dash which crosses the track) the track elements that are longer than 100m. Obviously, a train will spend more time on those track elements, according to the track length.
    • "Show seconds on clock" - shows the seconds on the simulation clock. Normally, only hours and minutes are shown.
    • "Traditional signals" - use standard icons for the signals. In the future, individual scenarios will be able to specify icons that are specific to the railroad company that manages that line
    • "Strong performance checking" - changes the points assigned to certain penalties, so that it is more difficult to run a "clean" simulation.
    • "Show linked objects in editor" - draws a line between an object (a signal, entry/exit point, final tracks) and the corresponding linked track element (see the description of the editor).

The editor


Once the user has experienced how difficult it is to manage a line or a station when there is intense traffic, it is possible to start experimenting with the editor, both to modify one of the existing layouts (for example adding a platform to allow more trains to arrive on time), and to create your own layout.

Clicking on the "Edit+Edit" menu, the tool bar is shown in place of the general schedule pane. On this tool bar the program lists all possible track elements that can be placed on the layout. The following table shows the different track types:
  Horizontal tracks   Vertical tracks
Crossing tracks Diagonal tracks
  Horizontal switched Vertical switches
  Protection signals   Automatic block signals
To place a track element, select the desired track type (the current track type is indicated with a white border around the track type), and then click on the layout on the position where you want to put the element. It is advisable to draw the entire layout on paper, so that you leave enough space for all the tracks and signals.

The button  is used to remove a line element from the layout.
The button  represent a platform or a station's building. It is used only as a decoration, since it doesn't affect the train's behavior.

The button with the camera  is used to specify a user-created icon. These icons are contained in a file with the .xpm extension. To specify the file name, place the camera on the layout, then open the track properties dialog, by clicking with the right button on the camera, and enter the name of the file in the "Station" field. To create an .xpm file, one can use any graphic editing program, such as the excellent Icon Collector Graphics Editor, with which one can also convert icons from the .bmp format to the .xpm format, and viceversa.

The buttons  are used to place descriptions. To change the text of a description after having put it on the layout, click on the text with the right button and change the text in the dialog.

The "Link..." and "...to..." buttons require a more detailed description. These tools are used to link different points of the layout. First you have to select the tool, then click on the first object to be linked; this automatically selects the tool; then click on the second object to be linked; the "Link..." tool will be selected again to show that the link has been properly set up.
More precisely:

  • It is possible to link two switches so that, when simulating, clicking on a switch will automatically throw the linked switch.
  • It is also possible to link two terminal points of a line, so that a train that would exit the layout from the first point will re-enter the layout from the second point. This trick is used to break a long line.
  • Each signal placed on the layout must be linked to the track protected by that signal.
  • It is necessary to define every point of entry or exit from the layout with some text. This text can be a letter, number or a word. After you placed the text with the "Abc..." tool, you must link the text with the track by using the "Link...to..." tools, so that that track becomes an entry/exit point.

To speed up the creation of many layouts, it is possible to create your own standard elements and place them several times on the layout being created. These macros are simply mini-layouts that are created with the same editor and saved on disk in the same way as used for normal layouts. Obviously, there will not be any schedule file associated with a macro file.
To use a macro, one must first select the desired macro by clicking on . Traindir will ask the name of the file containing the macro. Once specified the file name, the program will automatically select the  button, to tell the user that he has to place the selected macro at the desired position on the layout. From now on, until the user selects a new tool, every time one clicks on the layout, the selected macro will be placed on the layout, including all the additional elements like signals, platforms, links etc.
A typical macro is used in the construction of several sections in a 2-tracks line, or of a number of stations with sidings on a 1-track line.
To create your own macro, just start with an empty layout, and place the track elements as if you were building a real layout. The only requirement is that you must place the elements as close as possible to the upper-left corner (e.g. at the 0,0 coordinate). As an excercise, try to modify the 2 macros provided with the program, called "2tracks" and "southst".

The button is used to place on the layout a button to select an itinerary. After you've placed the button on the layout, right-click on the button's icon, and enter the name of the itinerary. For the creation of an itinerary, see the specific chapter.

The buttons are used to move rectangular areas of the layout to a new position. They work as follows:

  • Click on the first button (with the arrow towards the upper left corner) and mark with the mouse the initial coordinate of the rectangle to move;
  • The second button (with the arrow towards the lower right corner) is automatically selected. Now mark with the mouse the final coordinate of the rectangle to move;
  • The area to move is highlighted on the layout, and the third button (with the two rectangles) is automatically selected. Now click on the new position of the upper-left corner of the rectangle. The program will move all elements (tracks, signals, icons etc.) to the new position, and will recompute all the links to the moved elements.

While the coordinates are shown on the layout it is also possible to delete/insert whole rows/columns. To do this, move the mouse on the coordinate of the row (or column) that you want to operate on, and click the right button of the mouse. A pop-up menu simular to the following will appear. Now select the command you want to perform.

After having placed and linked every track element, you must define the lengths and maximum speeds for each line block, so that trains can occupy that line block for an appropriate amount of time. To do this, click with the right mouse button on each line element where you want to define a length and/or a speed limit. A dialog will popup with the current properties of that track element. Just modify or enter new values for the properties.

If you enter a text in the "Station" field, that track element will be considered a station where trains can stop even when the next signal is green, and where the program will record the arrival and departure times, according to the train's timetable.
You can enter in the "Speed" field 4 speed limits, according to the train type. Type 1 trains (see the timetable description) will obey the first speed limit, type 2 trains will obey the second and so on. If you enter only one limit, that limit will be obeyed by all trains. Each limit is separated by a slash from the next. For example, 120/100/80/60.
The fields labeled "Linked to west" and "Linked to east" show whether that track element has been linked to other track elements by using the "Link...to..." buttons. Sometimes it is useful to enter the coordinates manually, or, if one wants to unlink the tracks, one can enter the value "0,0" in one of the fields.
 

After the layout has been created, all the entry/exit points have been defined, the signals and switches have been linked, the stations and the lengths and speed limits have been defined, it is possible to save the layout with the command "Edit+Save".

If you change your mind and you want to erase the layout completely and start afresh, use the command "Edit+News".
 

Itineraries

An itinerary is a sequence of tracks and switches delimited by two signals. When the itinerary is selected by clicking on the itinerary button which was put on the layout by the author of the scenario, Traindir will try to throw all the switches to the proper position, and then the signal at the start of the itinerary will be set to green. Of course, if there is another train that occupies any of the tracks defined by the itinerary, or if for some reason it is not possible to throw one of the switches, the signal will not be cleared.

To create a new itinerary one must enter in the itinerary editor, by using the menu "Edit+Itinerary".
The list of the itineraries will be shown in place of the edit tools.
The first step in defining the itinerary is to manually throw all the switches and to clear the signal at the start of the itinerary. Once Traindir has set the section to green, one must click with the right mouse button on the start signal, to show the following dialog:

One must then enter the name of the itinerary. This name is completely arbitrary, although it should remind the user of the end-points of the itinerary.
The second field in the dialog is used to link several itineraries in a sequence. Every single itinerary is always delimited by 2 signals. However, if one desires to control multiple sections of a line, one can first create the single itineraries, one per section, and then link them by entering in the second field of the dialog above the name of the next itinerary.
The final step in setting an itinerary is to place the activation button on the layout, possibly adding a label to it so that the user will know which itinerary will be activated by clicking on the button. Itinerary buttons are placed on the layout when Traindir is in "Edit+Edit" mode.

Triggers

In editing mode, if you click on the tool the program shows a subset of tools, among which you can see the trigger tools: . Triggers are linked - similarly to signals - to a track element. When a train (or multiple trains, according to the trigger's properties) crosses the track element, the trigger may execute a few functions to modify the train's or layout's state.
By right-clicking while in Edit mode on a trigger, you'll see the following dialog:

In the drop-menu on the left you can see all possible actions:

  • click x,y where 'x,y' are the coordinates of a signal (which will change its state), of a switch (which will be thrown), or of an itinerary button (which will become active);
  • rclick x,y where 'x,y' are the coordinates of an object; similar to the above, but simulates a right-click of the mouse on the object. For example, rclick-ing on a green automatic block signal will set the signal to green-green.
  • fast is used to increase the time multiplier;
  • slow is used to decrease the time multiplier;
  • shunt train (e.g. shunt R12345) will start shunting train R12345;
  • reverse train (e.g. reverse R12345) will flip train R12345's direction;
  • traininfo train (e.g. traininfo R12345) will show train R12345's properties dialog;
  • stationinfo station (e.g. stationinfo Piovarolo) will show Piovarolo station's property dialog;
  • decelerate speed train (e.g. decelerate 20 R12345) will slow down train R12345 by 20 km/h. This action is canceled the next time the train crosses a speed limit indicator: for example, if the train was running at 60 km/h and it was slowed down to 40 km/h, a subsequent 100 km/h speed limit signal will make the train speed up to 100 km/h (not to 80 km/h).
  • accelerate speed train has the effect of speeding up a train, by reversing the effect of a previous "decelerate" command. In any case, it's not possible for the train to run faster than the maximum speed limit for that line section.

One of the boxes in the "Trigger Properties" dialog is the "Probabilities" box. In this box you can enter how likely it will be for each train type to activate the trigger. Note that a "1" probability indicates the lowest probability (i.e. no train will ever activate the trigger), while a "100" value indicates the maximum probability (i.e. all trains will activate the trigger). If you don't enter a probability value, (i.e. the value is all "0"s), the program assumes the maximum probability (100%). For example, entering 1/1/0/0 in this box, will always activate the trigger for all trains of type 3 and 4; it will never activate the trigger for trains of types 1 and 2. This is equivalent to specifying a value of 1/1/100/100.

When a command accepts the name of a train on which the command applies, it's possible to specify the character "@" in place of the name of the train. This character is a substitute for the name of the train that activated the trigger. For example, writing "reverse @" will reverse the direction of all the trains that cross the trigger. This is very useful on terminus stations or to automatically revert the direction of shuttle trains.

It is also possible to specify one or more than one train that will activate the trigger. If you enter the name(s) of the train(s) between the characters "{" and "}", the trigger will be activated (according to the specified probabilities) only by the train(s) listed between the { } characters. For example, entering {ES9876} click x,y the trigger will be activated only by train ES9876. Similarly, the command {ES9876,IC45} click x,y will activate the trigger only when either train ES9876 or train IC45 will cross the trigger.

Finally, it's possible to assign more than one action to a trigger by using the following notation: click x1,y1; click x2,y2; click x3,y3;reverse R1234 that is by separating the various actions by a semicolon ";". Note however that it's only possible to specify the list of train between "{" and "}" once, even when the actions to be performed are more than one. For example, the command

{T1,T2,T3} shunt T4; shunt T5; {T6,T7} shunt T8

is illegal, because there are two train lists between { }. Only the first list will be considered, because when the program sees {T6,T7} it finds a contradiction, since it will have already executed some of the actions.

The schedule

Each scenario comes with a timetable of all the trains that run on that layout. The timetable is defined in a text file with the same name as the layout but with an extension .sch ("schedule").
Unfortunately at the moment it is not possible to enter the timetable from inside the program. Actually, it would be really cumbersome to have to open a dialog for each train and enter by hand the names of the stations and the arrival and departure times.

Such data can be downloaded from a few web sites and processed automatically to create the schedule file. A site that is particularly useful is the DB site (Deutsche Bahn), at the address http://reiseauskunft.bahn.de. The schedule files of the scenarios that I created and that are available from the download page, have been created by a program (gentt.exe) that automatically downloads the data and converts it in the format required by Traindir.
For more information about the use of gentt, please read the description of the program.
It is also possible to create your own schedule file with any text editor. If one uses Word, one must save the file in MS-DOS text format. Files saved in .doc format will not be recognized by Traindir.

Here's an example of the timetable of two trains that shows the syntax of a .sch file:

# Example from the Alessandria schedule file.

Start: 5:50

Type: 3 e646w.xpm e646e.xpm

Train: R20374

Length: 200
     0:00,  5:32,  Voghera
     5:38, 5:39,  Pontecurone
     5:46, 5:47,  Tortona
     5:53, 5:54,  S.Giuliano Piemonte
Enter: 5:59, F2
     6:00, 6:01,  Spinetta
     6:07, -,  Alessandria
Stock: R20377
When: 167
Notes: Note relative al treno...
.

Train: R20377
  Wait: R20374 240
  Enter: 6:31,  Alessandria@1
     6:36, 6:37,  Spinetta
     6:38, -, F1
     6:43, 6:44,  S.Giuliano Piemonte
     6:51, 6:52,  Tortona
     6:58, 6:59,  Pontecurone
     7:05, -,  Voghera
.

The lines that start with '#' are comments, and are ignored. Empty lines are also ignored.
Start: tells Train Director to set the clock of the simulation to the specified time. Normally the simulation would start at 0:00, but if the first train enters the scenario at 5:50, then there's no point in simulating the time between 0:00 and 5:50.
Type: specifies the type of the following trains. Train Director supports 4 train types. Normally type 1 trains are fast trains (IC, ES), type 2 for mid-range trains, type 3 for regional and commuter trains, and type 4 for freight or other slow trains. Each train type is identified on the layout by a different color. It is also possible to specify the name of 2 .xpm files which contain the definition of the icons to be used for that train type. The first file specifies the icon of west-bound trains, the second file specifies the icon of east-bound trains.
Train: defines the beginning of the data for a specific train. It must be at the start of the line in the file. It is followed by the name of the train.
Length: specifies the length of the train. Trains with a length may occupy more than one track element when they are running on the layout.
Wait: tells Train Director that the current train cannot enter the layout before the specified train has arrived to its final destination. This is useful for shuttle trains, where the same rolling stock is used for multiple trains. The number after the train name tells how many seconds must pass before Traindir alert the user that the train cannot depart because its rolling stock has not been assigned.
Stock: defines which train will receive the rolling stock of the current train after the current train arrives at its final destination.
Enter: defines the time and point of entry in the layout. Note that that point may not be a station. If the train enters from an open-ended track element, you mush specify a time that will allow the train to arrive at the next station, which of course will depend by the distance and speed limits between the open-track line and the station. All the entries preceding the Enter: line will be ignored.
When there is a dash in place of the departure time of a train it means that that line defines the final destination of the train. When the train reaches that point, it will either disappear from the screen, or become availabe to be assigned to another train or to be shunted to the depot.
A dash in place of the arrival time of a train means that that train will not stop at that station. Train Director will record the time at which the train will go through the station, but no penalty will be assigned for late trains.
When:, if present, specifies the days the trains runs on. Use the digit 1 for Monday, 2 for Tuesday, 7 for Sunday.
Notes:, if present, is used to add up to 5 descriptive lines to the train. The lines will be shown in various placed during the simulation.

Obviously the names of the stations in the schedule file must match the names of the stations defined during the creation of the layout. A @ character after a station name identifies a platform number. If the train arrives at a different platform than the one specified, it will still stop, but the program will add a penalty.

To see how the schedule files look like, just open the schedule file of one of the provided layouts.


This page is maintained by g_caprino@gmail.com (remove the _ before sending your message.)
Created on: August 6, 2000