RF2 Plugin Tv Wiki
Advertisement

rFactor2 Tv Plugin[]

This plugin enhance TV broadcast of rFactor2 race, by adding widget and behaviors. This wiki will describe the plugin capabilities and the way to fully customize it (UI fully described in "ini" files)

For now, the plugin is in alpha phase, so it is not available for anyone. It is only in test in my racing team (Gentlemen Racers )

This software contains two part :

The plugin[]

  • Description:
    • ​The main purpose of the plugin is to provide widgets to be displayed as rF2 overlay. Each widget provide its own information and is full customizable in term of UI.
  • Installation:
    • The "dll" must be copied into the rf2 core directory plugins
    • The "GRTvPlugin" directory containing all ini files and images must be copied into the rF2 data player profile directory

The Remote Console[]

  • Description:
    • This console is a two way console. This means it receive data from the plugin (drivers states, noticiable events), and can send command to the plugin (view a given driver, change camera, show/hide widget, replay noticeable event...)
  • Installation:
    • You can copy the "exe" and its ini file in any directory

Please visit the Remote Console page to see how it works.

Overview[]

Camera Control[]

This is not a widget, but this plugin allows you to jump directly to a driver at a given place.

With the default shortcut, using the Numpad of your keyboard you can reach any driver using its race place. Additionnaly you can select which camera to use to view the new driver, using key modifiers.

Key pressed Effect
[1] View the driver at the 1st position
[5] View the driver at the 5th position
[1] then [3] View the driver at the 13th position
Key modifier Camera Type
[Alt] Track camera
[Ctrl] Cockpit camera

Those shortcuts are defined in the "GRTvPlugin.ini" file, under the [Keyboard.CameraControl] section. Those "virtualCode" come from the list of constant that you can find here .

Display Profiles[]

If you want to have several display, you can use profile.

With a profile you can hide some widget and move others. A shortcut allows you to cycle around all profiles (example: Left CTRL + D or Left CTRL E).

The profiles are defined in the main "UI" file.

Plugin Control[]

There is some Keyboard shortcuts to manage some global parameter of the plugin

Those shortcuts are defined in the "GRTvPlugin.ini" file, under the [Keyboard] section. Each key binding is managed by a modifier code and a key code. Those two code come from the same list of constant that you can find at here .

For exemple, if you want to map Left Ctrl+T, you will set the modifier to 162 (decimal representation of 0xA2) and 84 for the key (decimal representation of 0x54).

Function Example Shortcut Description

Toggle plugin in monitor[]

Left Ctrl + Backspac

The shortcut allows you to show/hide the plugin UIs on the rF2 monitor. By default it is not displayed on monitor. 

ini key prefix: toggleDisplayOnMonitor

Cycle Categories[]

C

When there is several category, it allows you to cycle around All and each category.

This will change the display and behaviour of some widget, like the Scrolling Banner, the tower.

ini key prefix: cycleCategories

Cycle Tower Mode[]

F

Cycle around all tower mode.

ini key prefix: cycleTower

Reload UI[]

Right Alt + UP

Reload UI (read again all ini files), usefull when creating UI to avoid quit/launch RF2 after each INI update.

ini key prefix: reloadUI

Widgets description[]

This section lists all available widget, and for each of them you will find a screenshot and a link to the detailed page.


Driver Information[]

This widget show several information of the viewed driver.

DriverInfo








  • Please visit the description page to view all available information provided by this widget

Driver Timing[]

This widget show several timing information of the viewed driver.

DriverTiming









  • Please visit the description page to view all available information provided by this widget

Scrolling Banner[]

This widget show the realtime ranking using an horizontal scrolling panel

Here an example when showing all categories

ScrollingBanner



Here an example when showing only one category (using the keyboard mapping "cycleCategories")

ScrollingBanner-oneCat



  • Please visit the description page to view all available information provided by this widget

Weather Panel[]

This widget show some weather informations

WeatherInfo




...

Session Status[]

This widget display some information about the session/track status.

SessionStatus






  • Please visit the description page to view all available information provided by this widget

UI Information[]

This widget show an image and a version. You can use it to identify the version of your UI. For the UI provided with the plugin, this version match with the plugin version.

UIInfo




...

Overtake[]

This widget is displayed each time a pilot overtake another driver.

Overtake






...

Compare 3 Driver[]

This widget displayed the laptime gap between the current driver and two other one. (generally the one at higher place and the one at lower place). 

A specific font and font color can be used to identify the viewed driver.

Compare3Driver






...

Tower[]

This widget displayed the tower and have 5 data modes. A key/modifier can be definied to cycle around modes (ex: "F"). See "cycleTower" prefix in the [Keyboard] section.

  • No data
  • Gap
  • Number of pits
  • Number of laps
  • Max Speed (km/h)
Tower










By default, the driver name is the rF2 driver name.

If you want to override it, you can use the driver mapping ini file.

On the mapping file you can specify the name of a driver. 

Ini File Content
drivers.ini

[Gerald JACOBSON]

name=Amphi

If you use the three letter code instead of the driver name, you can override the auto-generated code by specifying yours.

Ini File Content
drivers.ini

[Gerald JACOBSON]

threeLetterCode=APH

Speed Trap[]

This widget show the terminal speed, at the faster point of the track.

After a configured number of lap made by the driver, the widget will be displayed, for 4s, when the driver reach its terminal speed at the speed trap point of the track (The best speed is specific for each category). 

SpeedTrap




Weather Full[]

Radar








This widget display weather condition. All data come from the Remote Console, so it is the only widget that need the remote console to run, as the console provide the data to display to the widget via UDP trames.

To define the parameters used to retreive weather data, please look the corresponding Remote Console paragraph

It is composed of :

  • A radar/satelitte images : Radar shows rain, satellite show clouds. The two images can be overlayed.

Replay[]

This widget is just an image displayed when the game is in replay mode. You can activate/desactivate the blinking effect, and configure it.


CuttingLineGap[]

This widget displayed the gap between a driver, that just cut the line with the leader. Each time a new car cut the line, an area is displayed (added cell) to the widget. This widget is an implementation of this real TV widget .

CuttingLineGap






By default, the driver name is the rF2 driver name.

If you want to override it, you can use the driver mapping ini file.

On the mapping file you can specify the name of a driver. 

Ini File Content
drivers.ini

[Gerald JACOBSON]

name=Amphi

If you use the three letter code instead of the driver name, you can override the auto-generated code by specifying yours.

Ini File Content
drivers.ini

[Gerald JACOBSON]

threeLetterCode=APH

Fastest Lap[]

This widget is displayed each time a driver beat the best lap of its category group. This widget have the same UI fields as the Driver Panel, plus a field to display the new best lap time.

Tv-fastestlap



...

Winner[]

This widget is displayed when the winner finish its session. This widget have the same UI fields as the Driver Panel, plus a three fields to display the session duration, the driven distance and the maximum reached speed.

Winner-widget






...

UI Customization[]

The plugin read, as root configuration file, the "GRTvPlugin.ini" file under the "<rF2-data>/UserData/<profile>/GRTvPlugin/" directory.

Here the description of each section:

  • [UI] section
Key Description
ini The UI ini file to use. The path must be relative to "GRTvPlugin.ini". This file contains all images, fonts, colors and path to each individual widget files.
  • [Mapping] section
Key Description
driver.ini The driver mapping file. This file is used to override some driver informations, like car number, team, name...
vehicleClass.ini The vehicule class mapping file. This file is used to provide category informations.
vehicleName.ini

This is used to override the vehicleClass (provided by rF2) and the car number.

  • ini section: "[rF2 vehicle name]" - must match the mVehicleName field provided by rF2 to the plugin.
  • ini key: "vehicleClass.section" - The vehicleClass is the ini key of the vehicleClass.ini
  • ini key: "vehicle.number" - The car number will be overrided if specified in the drivers.ini (drivers.ini is prioritary)

Here some general rules about UI:

  • All file path must be relative to the directory containing the root ini file ("<rF2-data>/UserData/<profile>/GRTvPlugin/")
  • The width and the height of an image is always optional (in this case, the width and/or height is the one of the image file)


UI file[]

This is the main ui file of an UI. This is the file referenced in the "GRTvPlugin.ini" in the section [UI] and "ini" key.

This files contains the list of all images, all fonts, all colors and all individual widget files.

Here the description of each section:

[Resolution] section[]

Key Description
width The width used as reference for all coordinates. It is used to scale the UI, if the rF2 client does not have the same screen width. 
height The height used as reference for all coordinates. It is used to scale the UI, if the rF2 client does not have the same screen height.

[Font List] section[]

Key Description
count The number of fonts defined in the file. Each font is identified by an ID <n>, where <n> is [1...count]
font.<n>.name The font name (it is the Windows name)
font.<n>.size The font size
font.<n>.weight

The font weight. (optional => 400)

400=Normal, 700=Bold (For all values, see FW_xxxx constant for D3DXCreateFont - 'c' language)

[Color List] section[]

  • As the image.color.id default value is 1, i recommand to set the color.1 to a white color. So you don't need to specify a "image.color.id" when you don't want to alter the original image colors.
Key Description
count The number of colors defined in the file. Each color is identified by an ID <n>, where <n> is [1...count]
color.<n>.r Red component [0...255] (optional = 255)
color.<n>.g Green component [0...255] (optional = 255)
color.<n>.b Blue component [0...255] (optional = 255)
color.<n>.a Alpha component [0...255] (optional = 255)

[Image List] section[]

Key Description
count The number of images defined in the file. Each image is identified by an ID <n>, where <n> is [1...count]
image.<n>.src The relative path to the image.

[Logo List] section[]

It is the same thing than the image list, but it allows you to isolate logo and ui images.

Key Description
count The number of logo defined in the file. Each logo is identified by an ID <n>, where <n> is [1...count]
logo.<n>.src The relative path to the image.

[Avatar List] section[]

It is the same thing than the image list, but it allows you to isolate avatars and ui images.

Key Description
count The number of avatar defined in the file. Each avatar is identified by an ID <n>, where <n> is [1...count]
avatar.<n>.src The relative path to the image.

[UI Widgets] section[]

Key Description
DriverPanel.ini The relative path to the ini file of the "Driver Information" widget
DriverTiming.ini The relative path to the ini file of the "Driver Timing" widget
ScrollingBanner.ini The relative path to the ini file of the "Scrolling Banner" widget
WeatherPanel.ini The relative path to the ini file of the "Weather Panel" widget
SessionStatus.ini The relative path to the ini file of the "Weather Panel" widget
UIInfo.ini The relative path to the ini file of the "UI Information" widget
Overtake.ini The relative path to the ini file of the "Overtake" widget
Compare3Driver.ini The relative path to the ini file of the "Compare 3 Driver" widget
Tower.ini The relative path to the ini file of the "Tower" widget
SpeedTrap.ini The relative path to the ini file of the "Speed Trap" widget
WeatherFull.ini The relative path to the ini file of the "Weather Full" widget
Replay.ini The relative path to the ini file of the "Replay" widget
CuttingLineGap.ini The relative path to the ini file of the "CuttingLineGap" widget
FastestLap.ini The relative path to the ini file of the "Fastest Lap" widget
Winner.ini The relative path to the ini file of the "Winner" widget

[Profiles] section[]

Key Description
count The number of profiles [0...10]
cycleProfiles.modifier.virtualCode The virtual key code modifier (optional => 0)
cycleProfiles.key.virtualCode The virtual key code
  • [Profile.<n>] section (<n> in [1...count])

​For each widget in the [UI Widgets] section, you can specify several properties prefixed by <widgetKey>.

Key Description
disable.camera.control "1" to disable Camera Control in this profile (optional => 0)
<widgetKey>.hide "1" to hide the widget (optional => 0)
<widgetKey>.offsetX The horizontal offset (optional => 0)
<widgetKey>.offsetY The vertical offset (optional => 0)

[ProfilePerCameraType] section[]

This allows to affect a profile ID to a camera type. As soon as the camera type is changed in rF2, the plugin will look if a profile ID is defined for it, if yes the plugin switch automatically to this profilethe display profile will be automatically choosen.

Here, the camera type values (same as the rF2 API)

  // Camera types (some of these may only be used for *setting* the camera type in WantsToViewVehicle())
  //    0  = TV cockpit
  //    1  = cockpit
  //    2  = nosecam
  //    3  = swingman
  //    4  = trackside (nearest)
  //    5  = onboard000
  //       :
  //       :
  // 1004  = onboard999
  // 1005+ = (currently unsupported, in the future may be able to set/get specific trackside camera)


Key Description
camera.<ct> The profile id [1...n] to use when the camera type is equals to [0...1004]
camera.other

The profile id [1...n] to use when there is not specification for the current camera type. (optional => no profile change if the current camera type have no profile associated)

 For example, you can specify to auto activate the profile ID=2 when in cockpit camera and the profile ID=1 for any other camera

[ProfilePerCameraType]
camera.0=2
camera.1=2

camera.other=1
Advertisement