
Training Day plugin (Version 3.5) for RBR 1.02 SSE
=====================================================================

This plugin for Richard Burns Rally allows to configure and label a set of
stages along with weather, track, tyre, service and setup settings.  Cars,
weather and track settings, tyres and setup files may be selected individually
for each stage.

Furthermore all built-in stages, rally school lessons and, if present,
reversed tracks, are pre-configured as hotlap rally and may be run
with different weather, track and tyre settings.
Time statistics include rally, weather and overall best times and are based on
every rally/hotlap which have been driven.

Setups maybe loaded, edited and saved by accessing the standard dialogs
directly from the plugin's menu.

Progress made during a rally including the car damage may be saved to
respectively loaded from a file at any time.

Car data and appearance of in-game messages can be configured in a
configuration file.

Replays may be saved after running each stage. The name of the replay will be
generated automatically.
After running a stage the replay can be viewed.

Car damage including the tyre wear and wheel damage is being preserved between
the stages. The car may be repaired in the service park. The number of
mechanics and their skill level may be configured for rally stages or chosen
individually for each hotlap stage. 


Installation
---------------------------------------------------------------------

Prerequisites:
This plugin needs RBR patch 1.02 SSE to work properly.


Copy the contents of the installation archive into the RBR installation
folder, which is usually "C:\Program Files\SCi Games\Richard Burns Rally\".

Note:
If you have an existing installation of a previous version, you may want to
backup your TrainingDay.ini file in the 'Plugins\TrainingDay' folder in case
you have made any customizations, to be able to merge your changes back into
the newly installed file.

Installation of the FixUp plugin version 2.x and higher is strongly
recommended. This fixes some annoying bugs and makes useful enhancements.


Uninstallation
---------------------------------------------------------------------

Simply delete the TrackListing.exe and TrainingDay.dll files and the
TrainingDay folder.


Limitations
---------------------------------------------------------------------

This version does not support the NOSSE executable anymore. Processors not
supporting the SSE instruction set are now more than 10 years old, so only few
people, if any, might use such a machine for playing RBR.


Starting Rallies
---------------------------------------------------------------------

Start RBR as usual, select a profile, select 'Options', 'Plugins',
'Training Day' and finally the desired rally configuration or hotlap stage.


Configuring Rallies
---------------------------------------------------------------------

Each *.srp file in the TrainingDay folder will result in a selectable rally
entry in the plugin's main menu. These are text files containing a list of
stage IDs along with an optional label. The weather, track, tyre, service and
setup setting can be changed at any point of the file.
Stages of different countries can be composed into the same rally. Also the
same stage may appear more than once. Comments can be added after '#'
characters.
Stages may be labeled by specifying a name right after the stage number for
identification purposes.
A rally maybe tagged as hotlap "rally" containing only one stage to be driven
as hotlap.

The valid tags and keywords or magic numbers for the settings are:

All tags and keywords are case-insensitive.
All tags except 'stage' and 'service' are sticky, which means that once set
their values remain the same for the stages following.
Keywords may be specified only partially as long as they are unique.
For example, tyres may be specified as 'gr dr' for Gravel Dry or 'dr gr' or
'd g'.
You may use the numbers but these are much more harder to remember.


Tag           Partial             Full                    Number
--------------------------------------------------------------------------
weather       g                   Good                    0
              r                   Random                  1
              b                   Bad                     2


tyres         t d                 Tarmac Dry              0
              d t                 Tarmac Dry              0

              t i                 Tarmac Intermediate     1
              i t                 Tarmac Intermediate     1

              t w                 Tarmac Wet              2
              w t                 Tarmac Wet              2

              g d                 Gravel Dry              3
              d g                 Gravel Dry              3

              g i                 Gravel Intermediate     4
              i g                 Gravel Intermediate     4

              g w                 Gravel Wet              5
              w g                 Gravel Wet              5

              s                   Snow                    6



conditions    -1=Reset previously defined value, use default.
              c                   crisp                   0
              ha                  hazy                    1
              nor                 norain                  2
              lightr              lightrain               3
              heavyr              heavyrain               4
              nos                 nosnow                  5
              lights              lightsnow               6
              heavys              heavysnow               7
              lightf              lightfog                8
              heavyf              heavyfog                9


sky           -1=Reset previously defined value, use default.
              c                   clear                   0
              p                   partcloud               1
              l                   lightcloud              2
              h                   heavycloud              3


timeOfDay     -1=Reset previously defined value, use default.
              m                   morning                 0
              n                   noon                    1
              e                   evening                 2


surface       -1=Reset previously defined value, use default.
              dr                  dry                     0
              da                  damp                    1
              w                   wet                     2


track         -1=Reset previously defined value, use default.
              ne                  new                     0
              no                  normal                  1
              w                   worn                    2


setup        -3=Use last setup chosen by user (menu-choice)
             -2=Default Setup
             -1=Current Setup
              0=Use setup in slot 0
              1=Use setup in slot 1
              2=Use setup in slot 2
              n=Use setup in slot <n>


hotlap        0=No hotlap
              1=special hotlap "rally" stage
              If set to "1", the rally definition is being treated as a
              hotlap. This means that only one stage is included in the
              stage list and can be run as a hotlap.
              All other stage definitions in the rally config file, if
              present, are ignored.


service nn    nn=service park time in minutes after the stage
              Service park settings are ignored for hotlap rallies.


mechanics n   n=number of mechanics in the service park in the range 1..6


skill         skill level of the mechanics in the service park
              i                   inexperienced           1
              p                   proficient              2
              c                   competent               3
              s                   skilled                 4
              e                   expert                  5
              


stage nn label
        nn=Number of the stage.
        label=Optional label used as stage name for identification purposes.
        Everything after the stage number up to the end-of-line or a comment
        character (#) is treated as the label.
        The comparison used in computing the best time diffs based on this
        label is case-insensitive.
        Anyway the label is displayed as specified.
        If no label is specified (the default) the built-in stage name is
        being used as the label.



Example for a four stage rally, first two ones good, rain for the rest:

weather g   # Good
stage 41    # Cote D'Arbroz

mechanics 2 # 2 mechanics in service park
skill com   # mechanics have competent skill level
service 20  # 20 minutes service park after stage 42
stage 42    # Joux Verte

weather b   # Bad
mechanics 4 # 4 mechanics in service park (skill remains competent)
service 40  # 40 minutes service after stage 43
stage 43    # Bisanne

stage 44    # Joux Plane




Example adding an additional track as hotlap:
weather g       # Good
tyres   g d     # dry gravel tyres
hotlap 1        # only 1 stage driven as hotlap
stage 158 Sweet Lamb    # track number and name


See 'Mixed.srp' for tyres and setup settings.

See 'Wet - GB Easy.srp', 'Wet - GB Medium.srp', 'Wet - GB Hard.srp'
and 'Compare Setups.srp' for examples of using the label feature.

See 'Hokkaido I.srp' for an example of how to specify weather and track
conditions.

The mapping between stage names and IDs can be read from the default
rally configurations coming with the plugin.

See also the following section on how to obtain the valid stage IDs and valid
values for the weather and track settings for each stage.


Weather and Track Settings
---------------------------------------------------------------------

Weather and track settings may be set by selecting the menu
'Weather: xxx [Options...]' and choosing one of the entries from the presented
list.
For configuring weather and track settings in the rally definition (srp) files
you have to know the valid values for each setting.

To aid you in this task, I have supplied a little helper application
'TrackListing.exe' in the RBR installation folder.
Simply double-click or start it from the command line to generate a
'TrackListing.csv' file containing all valid stages along with their weather
and track settings. This tool extracts the information from the
TrackSettings.ini, Tracks.ini and the respective textures.rbz files to gather
the data.  You may generate the track listing for only some of the stages by
supplying the list of stage numbers on the command line.
You may open the generated 'TrackListing.csv' with your favourite spreadsheet
application, the table columns are separated by semicolons.

To speed up the loading of hotlap and rally definitions you may execute
the "TrackListing.exe" after installing a new track, as the valid track
settings (e.g. "dry/normal") are being cached in the file
"Maps/TrackValidation.ini" which is read by the TrainingDay plugin while
building the list of available weather and track settings.


Rally and Hotlap Records
---------------------------------------------------------------------

Rally and Hotlap records are based on the total time and saved along with all
stage and checkpoint times of a single rally into *.tm2 files in the
TrainingDay folder. Weather, track, tyres, car, user, date and setup settings
are also saved along with the times.
If there is no *.tm2 file, times are being read from the (Version 1.0) *.tim
file if present. In the latter case only time and weather data is available.

Note, that changing the configuration of a rally in an *.srp file will make
the plugin delete the records saved in the corresponding best time file.
Stored records are only updated when selecting 'Save Rally Record' or 'Save
Hotlap Record' respectivly in the menu after the last stage has been driven
and the total rally time has been improved.

Hotlap Records are being saved separately for each weather, track setting and
tyre combination. This makes up a total of 7 tyre * 3 weather * 3 surface * 3
track values equals 189 different hotlap records for each stage. In theory at
last.


Progress saving and loading
---------------------------------------------------------------------

You may save your progress made in driving a rally by selecting the menu
'Edit: Save Progress' at any time. Everything you have changed or
configured (weather and track settings, tyres, car, setup, stage times driven)
is then saved to a *.tds file with the same name as the rally being driven.
Car damage is being saved separately in a *.dmg file.
Note, that this does not affect the rally best times which are saved
separately in the *.tm2 file!

At any time you may load the progress made by selecting the menu
'Edit: Load Progress'. Then all settings made and times achieved are being
restored from the saved state including the car damage if present.
Note, that there is no confirmation if you select these menu entries, the
action is taken immediately!

Note, that this feature is not available for hotlap rallies as there is only
one stage and hence no progress to be saved.


Loading, editing and saving of car setups
---------------------------------------------------------------------

To select a car setup you can scroll through the list in the menu item 'Setup'
with the right and left arrow keys. To edit a setup in the standard RBR setup
settings dialog you simply press ENTER after selecting a setup, which may be
the "Default", "Current" or a named setup slot. In this dialog you may load
another setup or save the changes made to another slot.

I recommend the FixUp plugin to use more setup slots and longer setup names.



Saving and viewing of replays
---------------------------------------------------------------------

You may save the replay to the "Replays" folder after driving a stage by
selecting the menu item 'Edit: Save Replay'.

The name of the replay file is generated automatically and contains the stage
name, the car name and slot, driver name, stage time and date driven.

To view the replay you simply select the menu item 'Edit: Replay'.


Service Park / Repair Car
---------------------------------------------------------------------

As the damage to the car including the tyre wear is being kept between the
stages you may configure the service park settings in the rally configuration
(srp) files.
The service park is always available for hotlap rally stages.

You get to the service park by navigating to the 'Car' menu and pressing the
ENTER key.
In the 'Repair Car' dialog you may choose the service time, number of
mechanics and their skills for hotlap rallies only before moving on to the
service park for actually repairing the car.

In hotlap rallies you may reset all car damages by selecting the corresponding
menu item.

In the stage times list in the rally dialog an asterisk '*' next to the
surface tag marks a stage where service is being available after the stage has
been driven (e.g. "wet*" for a wet surface stage). A tilde '~' marks a stage
for which the service already has been done.


Reversed / New Tracks
---------------------------------------------------------------------

All reversed tracks may be run with this plugin without having installed other
plugins (e.g. RBRTM). The same goes with some other new tracks.
Of course you have to download and install them separately.

Tracks tested include:
    16      Sikakama II
    17      Autiovaara II
    26      Falstone II
    27      Shepherds Shield II
    30      Greenhills II
    37      Mineshaft II
    47      Bisanne II
    48      Joux Plane II
    50      Sipirkakim II
    57      Pirka Menoko II
    60      Fraizer Wells II
    67      Hualapai Nation II
    90      Rally School II
    94      Stryckovy okruh
    107     PTD Rallysprint
    158     Sweet Lamb (with fixed textures)
    125     Bergheim

There are some issues with the standard installation of the tracks

    26      Falstone II
    94      Stryckovy okruh

Some entries in the TrackSettings.ini file are missing, so the tracks can't be
run by this plugin withour modifying that ini file.

To fix such issues you may copy the settings from the stock Falstone (21)
track respectively from Osli-Stryckovy (108) or get a modified and
corrected TrackSettings.ini from one of the supporting communities on the
net (e.g. GVRC).


Configuration
---------------------------------------------------------------------

In the Plugins\TrainingDay folder there is located a configuration file
'TrainingDay.ini' in which you may configure car data and other settings.

_______
Options

You may configure the interval of the automatic scrolling of the list of
stages if the number of stages exceeds the maximum number of stages to be
displayed at once.


____
Cars

For each car slot there is a corresponding section in the configuration file.
The car slots are the standard slots used by the game, for example the section
[Car5] is for the "Impreza 2003".
In these sections you may specify the car data for your favorite cars if you
have replaced the original ones with add-on cars such as Ford Focus, Citroen
C4 etc.
The car data is being used for display purposes only and stored in the time
and progress files.
The plugin first tries to read the name of the car from the Cars.ini file with
the key "CarName". If such a value is present, it supersedes the value in the
plugins config.


________
Messages

In the section [Messages] you may configure the appearance of the in-game
split and finish time message.
You can configure which diffs should be displayed (best stage time, best
overall stage time, stage record) and also the labels to be used.
Furthermore you may configure the position and the duration of the message or
turn it off completely if you are bothered by this message.

_______
Service

In the section [Service] you may configure some default settings for the
service park being used in hotlap rallies.
This includes the allowed service time, the number of mechanics and their
skill level.


See the comments in the configuration file for details.


Notes
---------------------------------------------------------------------

- This plugin does not modify any files of your RBR installation.

- Bad weather (wet surface) is not supported for all stages (these are all
  australian stages and the rally school, see also TrackListing.csv). This is
  not handled by the plugin. Weather setting is simply ignored then by the
  game.

- Even though stage records are loaded from SavedGames\pfresult.rst
  for reference purposes, they are not saved in case of improvement.
  You may want to save your profile manually when having achieved a new
  personal or stage best after viewing a replay or via the profiles menu.

- Damage level and gearbox settings can be selected directly from
  the plugin menu.

- A filter is used for setup files, that depends on the selected car.
  If you want to "cross-select" setups between different cars, you
  need to make a copy and change the preceeding car identifier in the
  file name accordingly. So, for example, 6slot0_LongGears.lsp is
  considered a Corolla file due to the leading 6.
  There is no limit on the setup slots.

- Some of the new add-on maps/stages can't be run with this plugin.
  Sosnova (96), Stryckovy - Zadni Porici (106), Osli - Stryckovy (108) won't
  run with this plugin. Same goes with Hradek and similar "only online"
  tracks.
  Some of the RSRBR stages may be run after modifying the Tracks.ini and
  TrackSettings.ini files. Just a hint.
  Results may vary.
  You may want to use other plugins to run add-on maps.


Disclaimer of Warranty
---------------------------------------------------------------------

This software and the accompanying files are supplied "as is" and
without warranties as to performance or merchantibility or any other
warranties whether expressed or implied. No warranty of fitness for
a particular purpose is offered.


Version History
---------------------------------------------------------------------

3.5     2021-03-15
    Bugfixes:
    * service park not working in some rare cases depending on when you left a
      previously attended season
    * fixed setting of damage level
    * documented use of g(ood) instead of d(ry) in weather settings

3.4     2016-12-24
    Bugfix:
    * caching of valid track settings per tint set

3.3     2014-11-01
    New features:
    * caching of valid track settings
    Bugfix:
    * fixed loading of progress file

3.2     2014-10-23
    New features:
    * validate existance of all textures, using RBR's loading algorithm
    * TrackListing.exe for building a list of valid stage settings

3.1     2014-09-21
    New features:
    * added support for online plugins
    Bugfix:
    * fixed handling of setup options

3.0     2014-07-04
    New features:
    * stage records based on surface (dry/damp/wet)

2.8.5
    New features:
    * key 'B' to get back to previous dialog (from hotlaps or rallies)
    * read the car's name from the Cars.ini file if present (key CarName)
    Bugfix:
    * fixed damage handling after pausing the game

2.8.4
    New feature:
    * load appropriate particles data for add-on tracks instead of low quality

2.8.0
    New features:
    * new initial plugin dialog
    * use separate dialogs for hotlaps and rallies
    * car damage level and transmission selectable (which were previously
      taken from the quickrace settings)
    * use physics according to Surface entry from tracks.ini file if present
    
2.7.1
    Bugfix:
    * do not write log file

2.7
    New features:
    * car service works now for car slot 2 (MG)
    * car service regardless of season being started
    * show service availability in results dialog
    * improved tyre choice in deployed rally definition files

2.6
    New features:
    * show stage details (conditions, service) in status bar
    * show service availability and driven state in the stage times list
    * prevent changing of weather and tyre settings of already driven stages
    
2.5
    New features:
    * preserve car damage, tyre wear, wheel damage
    * repair car in service park
    * save and restore car damage

2.4
    New features:
    * viewing of replays
    * access to the setup editor
    * fixed loading of setup options
    * use all available setup slots
    * hotlap feature

2.3
    New features:
    * use configured gearbox settings (manual/automatic)
    * dialog for choosing weather settings now shows best time if present

2.2
    New features:
    * Run all reversed, rally school and some add-on tracks.
    * Easier configuration of rallies due to recognition of keywords.
    * Access to all available weather and track settings (conditions, sky,
      surface, time of day, track).
    * Hotlap records based on weather, tyre, surface and track setting.

2.1
    New feature:
    * Save replays.

2.0
    Complete rewrite.
    New features:
    * Save all available data: tyres, car, setup, user, date.
    * Statistics: weather and overall best times along with stage records.
    * Save and load progress.
    * Configurable cars and in-game message.
    * Status bar to give at least some feedback to the user.
    Internal screen cache as the drawing function is called every frame so
    times and time diffs are only calculated once and not 30+ per second.

1.0
    Initial version.



And finally...
---------------------------------------------------------------------

...thanks to Warthog for developing such a great Rally Sim and for
providing the plugin interface.

WorkerBee

mail to guenter.schlupf at gmx.net

vim: set nocindent :
