Setting up UDP output for DiRT 4
June 6, 2017
Contents
1 Overv Overvie iew w
2
2 D-B D-BOX 2.1 2.1 Config Config Setup Setup
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3 3
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4 4
3 UDP 3.1 3.1 Config Config Setup Setup
4 Cust Custom om UD UDP P 4.1 4.1 Config Config Setup Setup . . . . 4.2 4.2 XML XML Layout Layout . . . . . 4.3 Availa Available ble Channel Channelss 5 Fana Fanattec 5.1 5.1 Config Config Setup Setup
. . . . . . . . . . . . . . . . . . . . . . . . . . .
5 5 6 6
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
13 13
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6 Append Appendix ix 1: Custom Custom UDP UDP for UDP mode mode 0
14
7 Append Appendix ix 1: Custom Custom UDP UDP for UDP mode mode 1
15
8 Append Appendix ix 1: Custom Custom UDP UDP for UDP mode mode 2
16
9 Append Appendix ix 1: Custom Custom UDP UDP for UDP mode mode 3
18
1
1
Overvi rview
Most of Codemasters Codemasters racing titles export telemet telemetry ry data from the player’s player’s vehicle in order to support 3rd party motion platforms, telemetry applications and steering devices. Over the years, the number of export formats has grown. This document aims to describe the legacy data formats exported from games such as DiRT Rally and Grid 2. There have also been additions for DiRT 4 which should open up the telemetry export for a wider range of 3rd party applications, which will be outlined later. The motion platform setup can be found in the %userprofile%\Documents\ %userprofile%\Documents\ which h My Games\DiRT 4\hardwaresetti 4\hardwaresettings\hardware_s ngs\hardware_settings_config. ettings_config.xml xml , whic will contain the XML extract below. deviceId="..."> . . > > . . >
2
2
2.1 2.1
D-BOX
Config Config Setup Setup
To enable exporting to D-BOX, simply set enabled to true in the dbox XML tag.
Ensure you have the latest motion codes from D-BOX. Motion codes and drivers can be downloaded at their website at http://www.d-box.com/corporate-page/downloads/
3
3
UDP
3.1 3.1
Config Config Setup Setup
UDP data is probably the primary way of getting telemetry data from the game, and almost certainly certainly the least understood. understood. It is possible to export to multiple devices by simply adding more instances of the udp tag, for example > >
The tag attributes are:
enabled Set to ”true” to enable the UDP export to this IP/port, ”false” otherwise.
extradata The network network packet type to export. 0 for LiveForSpe LiveForSpeed ed compatible packets, 1-3 for other other packets. packets. (Detailed (Detailed descriptions descriptions of all existing packet packet formats are included at the end of this document.)
ip The 32-bit numeric IP address to export the data to.
port The port number to export the data to.
delay The delay between network packets, measured in 1/100th of a second.
4
4
Custo stom UDP
To improve the flexibility of the system, custom UDP data packets can now be defined defined,, enabling enabling 3rd 3rd parties parties to be more more select selectiv ive e about about the telem telemet etry ry channels channels they they are are inter interest ested ed in. The behaviour behaviour is exact exactly ly the same as the legacy legacy UDP options, and examples of how to replicate the legacy UDP data packets with the new system can be found at the end of this document.
4.1 4.1
Config Config Setup Setup
As with UDP, multiple ports can be exported to by adding more custom udp tags to the settings. The tag attributes are:
enabled Set to ”true” to enable the UDP export to this IP/port, ”false” otherwise.
filename The The XML XML filenam filename e within within the the moti motionp onplat latfo form rmss fold folder er whic which h cont contain ainss the the netnetwork packet format.
ip The 32-bit numeric IP address to export the data to.
port The port number to export the data to.
delay The delay between network packets, measured in 1/100th of a second.
5
4.2 4.2
XML XML Lay Layout out
UDP packet packet definition files must be located in the %userprofile%\Documents\ %userprofile%\Documents\ My Games\Di Games\DiRT RT 4\motionpl 4\motionplatfor atforms\ ms\ folder, and contain the following structure > >
where the type tags uint32, int32, float, and fourcc are the only supported type types, s, whic which h repr repres esen entt 32 bit unsig unsigned ned integ integer ers, s, 32 bit signe signed d integ integer ers, s, 32 bit floatfloating point numbers, numbers, and 4 byte strings respective respectively ly.. All exported data types are currently 4 bytes in size, and up to 100 telemetry channels are supported per packet. Numeric types must specify a channel which must match one of the supported channels below. An option optional al scale modi modifie fierr can can be spec specifi ified ed,, and will will typic typicall ally y be used used for for chang chang-ing units or types. The fourcc data must define a 4-character string in the text attribute. Examples of use can be found at the end of this document.
4.3 Ava vaila ilable ble Channe Channels ls In alphabetical order, here is a list of all the available telemetry channels that can be exported from the game. Channels that are not supported by a game will return zero.
abs Not supported in DiRT4
acceleration x acceleration y acceleration z Returns the x, y or z component of the world space acceleration of the vehicle vehicle (in m/s2 )
6
angular velocity x angular velocity y angular velocity z Returns the x, y or z component of the world space angular velocity of the vehicle (in radians/s)
brake input Retur Returns ns the level level of brak brake e input applied applied through through the contr controlle ollerr. A va value lue between 0 and 1.
brake temp bl brake temp br brake temp fl brake temp fr Returns Returns the brake brake temperatur temperature e in Centigrade Centigrade of the specified wheel. (bl = Back Left Wheel, br = Back Right, fl = Front Left, fr = Front Right
clutch input Returns Returns the level of clutch input applied through the controller controller.. A value between 0 and 1.
drs Not supported in DiRT4
engine rate Returns the engine rotation rate in radians/second.
forward dir x forward dir y forward dir z Returns the x, y or z component of the forward direction of the car in world space (in metres).
fuel capacity Not supported in DiRT4
fuel in tank Not supported in DiRT4
7
gear Returns the current gear number. 0 for neutral, -1 for reverse.
gforce lateral gforce longitudinal gforce vertical Returns the G-Force in the lateral, longitudinal or vertical direction.
idle rpm Returns Returns the idle rate of the engine in radians/sec radians/second. ond.
in pits Not supported in DiRT4
kers level max Not supported in DiRT4
kers level Not supported in DiRT4
lap distance Returns the distance of the track, in metres.
lap time Returns Returns the current current lap time, in seconds. seconds.
lap Returns the current lap number.
last lap time Returns the time of the last lap, in seconds.
left dir x left dir y left dir z Returns the x, y or z component of the left direction of the car in world space (in metres).
8
local velocity x local velocity y local velocity z Returns the x, y or z component of the linear velocity of the car in car local space (in metres).
max gears Returns Returns the number of forward forward gears available in the vehicle.
max rpm Returns the maximum engine rate, in radians/second.
paused Returns 1 if the game is paused, 0 otherwise.
pitch Returns the pitch of the vehicle, in radians.
pitch velocity Returns the pitch velocity of the vehicle (in radians/second).
pitch acceleration Returns the pitch acceleration of the vehicle (in radians/second2 ).
position x position y position z Returns the x, y or z component of the world space position of the car (in metres).
race position Returns the current position within the race.
race sector Returns the number of splits in the lap.
9
roll Returns the roll of the vehicle, in radians.
roll velocity Returns the roll velocity of the vehicle (in radians/second).
roll acceleration Returns the roll acceleration of the vehicle (in radians/second2 ).
sector time 1 sector time 2 Returns the first or second split time, in seconds.
speed Returns the magnitude of the vehicles linear velocity, in m/s
steering input Returns Returns the level level of steering steering input applied through through the controller controller.. A value between -1 and 1.
suspension suspension suspension suspension
position position position position
bl br fl fr
Retu Return rnss the verti vertica call posit position ion of the the whee wheell from from rest rest (in car car spac space) e),, measu measure red d in metres.
suspension suspension suspension suspension
velocity velocity velocity velocity
bl br fl fr
Retu Return rnss the verti vertica call veloc velocity ity of the the whee wheell from from rest (in car car spac space) e),, measu measure red d in m/s.
suspension suspension suspension suspension
acceleration acceleration acceleration acceleration
bl br fl fr
Retu Return rnss the the verti vertica call acce accele lerration ation of the the whee wheell from from rest (in car car space space), ), meamea2 sured in m/s .
10
throttle input Returns Returns the level level of throttle throttle input applied through the controller. controller. A value between 0 and 1.
total distance Returns the race distance, in metres.
total laps Returns the number of laps in the race.
total time Returns the amount of time since the race session begun, in seconds.
track length Returns the length of the track, in metres.
traction control Not supported in DiRT4
tyre tyre tyre tyre
pressure pressure pressure pressure
bl br fl fr
Not supported in DiRT4
velocity x velocity y velocity z Returns the x, y or z component of the linear velocity of the car in world space (in metres).
wheel patch speed bl wheel patch speed br wheel patch speed fl wheel patch speed fr Returns the speed of the contact patch of the specified wheel, in metres/second.
11
yaw Returns the yaw of the vehicle (in radians).
yaw velocity Returns the yaw velocity of the vehicle (in radians/second).
yaw acceleration Returns the yaw acceleration of the vehicle (in radians/second2 ).
12
5
5.1 5.1
Fanatec
Config Config Setup Setup
Included in the motion platform system is the Fanatec wheel and pedal extensions, which allow you to control vibration to pedals and LED displays. The tag attributes are:
enabled Set to ”true” to enable the Fanatec specific extensions, ”false” otherwise.
pedalVibrationScale An optional scalar for the rumble motors in the pedals, currently set to rumble when anti-lock brakes kick in. A value between 0 and 1.
wheelVibrationScale An optional scalar for the rumble motors in the wheel (separate to regular force force feedback feedback motors). Currently Currently set to rumble at high RPM. A value between 0 and 1.
ledTrueForGearsFalseForSpeed Set Set to ”tru ”true” e” if you wish wish the the LED LED disp displa lay y on the the whee wheell to sho show you the the curr curren entt gear gear,, ”fals ”false” e” if you you would would pref prefer er to see see the the trans transmi miss ssion ion spee speed d of the vehic vehicle le.. The units of speed will be either km/h or mph, depending on the in-game setting setting for the OSD.
13
6
Appe Append ndix ix 1: 1: Cust Custom om UDP UDP for for UDP UDP mode mode 0
> >
/> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> />
14
7
Appe Append ndix ix 1: 1: Cust Custom om UDP UDP for for UDP UDP mode mode 1
> >
/> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> />
15
8
Appe Append ndix ix 1: 1: Cust Custom om UDP UDP for for UDP UDP mode mode 2
>
/> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> />
16
>
scale= scale ="1.0" scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale=
/> /> /> /> /> /> /> /> /> /> /> /> />
17
9
Appe Append ndix ix 1: 1: Cust Custom om UDP UDP for for UDP UDP mode mode 3
>
/> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> /> />
18
>
scale= scale ="1.0" scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale= scale="1.0" scale=
/> /> /> /> /> /> /> /> /> /> /> /> /> /> /> />
19