Welcome to the Codemasters Forums! Be sure to check the FAQ and Forum Rules before you get started.

D-Box and UDP Telemetry Information

1356

Comments

  • baxbax Member Unleaded
    Please please please... can we have drivers positions in race (name + position) for live coverage streming? :'(

    I know... I already asked for this :# o:)
  • lordplordp Member New Car Smell
    edited October 2016
    Current tyre would be nice - US, SS, S, M, H, I, W

    Team ID values
    --------------
    Red Bull = 0
    Ferari = 1
    McLaren = 2
    Renault = 3
    Merc = 4
    Sauber = 5
    Force India = 6
    Williams = 7
    Toro Rosso = 8
    Haas = 11
    Manor = 12

    Track values ------------ Australia = 0
    Malaysia = 1
    China = 2
    Bahrain = 3
    Spain = 4
    Monaco = 5
    Canada = 6
    Britain = 7
    Germany = 8
    Hungary = 9
    Belgium = 10
    Italy = 11
    Singapore = 12
    Japan = 13
    Abu Dhabi = 14
    USA = 15
    Brazil = 16
    Austria = 17
    Russia = 18
    Mexico = 19
    Azerbaijan = 20

    Post edited by lordp on
  • lordplordp Member New Car Smell
    edited October 2016
    @Hoo - the session type isn't switching to 3 for the race, at least in quick race mode retiring from qualifying.

    Never mind, the session type changes when the lights go out.
  • cjorgens79cjorgens79 Member New Car Smell
    My RS-Dash telemetry application for F1 2016, RaceRoom and Assetto Corsa (based on pCars Dash) is now live on the Apple and Android app stores, see http://www.pocketplayground.net/ for links and setup information.
  • cjorgens79cjorgens79 Member New Car Smell
    @Hoo - in terms of the api, the following information (in no particular order) is missing compared to other sim racing interfaces ive linked with
    1. Tyre Temperature (everyone else has this, this is the most glaringly obvious missing field)
    2. Tyre Compound (R3E and AC have this, pCars and F1 2016 do not)
    3. Tyre Wear (pCars and AC have this)
    4. Brake bias (R3E has this, very useful to have available in app)
    5. Damage (the others all support this to some degree)
    6. Fuel Pressure, Water Pressure, Oil pressure (some have this as they simulate this)
    7. Water Temp, Oil Temp (some have this as they simulate this)
    8. Invalid lap (ie off track) indicator (very important for any app tracking lap times)
    9. AI player x/y/z positions (needed for displaying maps with position of all players)
    10. AI player race positions (1st, 2nd, 3rd etc) and lap times (needed for leaderboard and live streaming coverage)

    The UDP packet structure itself  could really use a revision number and packet size at the front so that interfaces can detect any changes to the api that may occur in future updates. A sequence number could also be helpful as UDP packet order arrival is not guaranteed.

    If the developers are going to add some of these things, they must take into account the MTU size to prevent UDP packet fragmentation from occuring, so the packet should not exceed 1500 bytes. The packet size at the moment (from memory) was about 280 bytes, so no problems, however if they add the telemetry from the other competitors then this grows quickly so needs to be considered carefully. F1 2016 has an advantage over the other games though in that the grid size is fixed to 22 cars and the AI opponents names are all known so can be encoded as an enum to save space. Ideally it would be great to have an array of an aiData structure something like the following added 
    {
    byte m_player_id                   // id of player, eg 0 = player, 1 = hamilton, 2 = rosberg, etc
    byte m_car_position             // race position of player, 1st, 2nd, 3rd, etc
    byte m_lap_invalid               // is current lap time is invalid (ie off track)
    byte m_sector                         // current sector player is in on this lap
    byte m_lap                              // current lap number player is on
    byte m_in_pits                       // is player in the pits?
    float m_lap_distance            // lap distance travelled
    float m_x                                 // world space position
    float m_y                                 // world space position
    float m_z                                 // world space position
    float m_lap_time                   // current lap time
    float m_last_lap_time          // last lap time
    float m_best_lap_time         // session best lap time (needed for qualifying leaderboards when app is started midway through session)
    float m_sector1_time           // current sector 1 time
    float m_sector2_time           // current sector 2 time
    }
    Structure packing would need to be considered so some of those byte fields could be combined into a single byte as the values wouldnt use all the available bits. eg m_lap_invalidated and m_in_pits only need 1 bit each. m_lap_distance could probably be reduced to 16 bit too if needed. 

    You could also technically drop the two sector times and the last lap time fields if  packet space was needed and instead just have a last sector time as the apps could still calculate what they need using just that. 

    Using my bloated example AI structure above for 22 opponents plus adding the other fields at the top of my list would result in a packet size of approx 1184 bytes, still reasonably well under the 1500 byte limit.

    The above is pretty much everything that i have available to me currently in my pCars Dash app from the Project Cars telemetry stream and it has proven to be very popular among the players, providing them with another dimension to the racing which has kept them engaged in the game longer. Hopefully you will consider adding the above to the api as companions apps do help the game retain its players for longer.

    Thanks
    Craig
    Pocket Playground
    www.pocketplayground.net
    Home of pCars Dash for Project CARS and RS-Dash for F1 2016, RaceRoom Racing Experience and Assetto Corsa.

  • dwin20dwin20 Member Wheel Nut
    edited October 2016
    @cjorgens79 - First - this is a terrific post! Helpful detail that can really help the Codemaster team to make the third party telemetry efforts significantly better - and as a result make F1 2016 better. 

    BTW - in your app is there a way in the telemetry section to see the track map as well as the graphs?

    Thanks 
    Post edited by dwin20 on
  • cjorgens79cjorgens79 Member New Car Smell
    dwin20 said:
    @cjorgens79 - First - this is a terrific post! Helpful detail that can really help the Codemaster team to make the third party telemetry efforts significantly better - and as a result make F1 2016 better. 

    BTW - in your app is there a way in the telemetry section to see the track map as well as the graphs?

    Thanks 
    Thanks. The track map is not currently available, but i am in the process of creating all the track maps so it wont be too far away to being added to the app. Keep in mind that the f1 2016 udp telemetry only has the current players positions so the track map will only be useful to see yourself one the track and upcoming corners, you wont be able to use it to see the position of other competitors until (hopefully) they add this information to the api.
  • JuanCarMRJuanCarMR Member Wheel Nut
    @cjorgens79 the problem is that if you download for iPhone, you must paid to use in an iPad as well.  :( 
  • cjorgens79cjorgens79 Member New Car Smell
    edited October 2016
    JuanCarMR said:
    @cjorgens79 the problem is that if you download for iPhone, you must paid to use in an iPad as well.  :( 
    No you shouldn't have to if you are logged into the app store with the same account. Click on the cog in the bottom left and then click the "Restore Purchases" button and it should unlock anything you have previously purchased.
  • JuanCarMRJuanCarMR Member Wheel Nut
    JuanCarMR said:
    @cjorgens79 the problem is that if you download for iPhone, you must paid to use in an iPad as well.  :( 
    No you shouldn't have to if you are logged into the app store with the same account. Click on the cog in the bottom left and then click the "Restore Purchases" button and it should unlock anything you have previously purchased.
    Ok, Thank you, it works!!!
  • HelmetSquadHelmetSquad Member Pit Crew
    @Lozzy UDP settings are not persistent across game launches - any chance we could get persistence including remembering the last IP entered?

    in addition, any chance of including UDP Telemtry in Pause menu?

    PS4 | v1.7.0
    PS4 | G29 | PlaySeat Evo [Black]
  • HelmetSquadHelmetSquad Member Pit Crew
    @Hoo @Lozzy

    could we have VSC delta and lap/sector delta added to output stream please?

    Also; the telemetry settings reset at game restart; can this be persistent ?
    PS4 | G29 | PlaySeat Evo [Black]
  • 1512marcel1512marcel Member, Drivers Team Principal
    dwin20 said:
    @cjorgens79 - First - this is a terrific post! Helpful detail that can really help the Codemaster team to make the third party telemetry efforts significantly better - and as a result make F1 2016 better. 

    BTW - in your app is there a way in the telemetry section to see the track map as well as the graphs?

    Thanks 
    Thanks. The track map is not currently available, but i am in the process of creating all the track maps so it wont be too far away to being added to the app. Keep in mind that the f1 2016 udp telemetry only has the current players positions so the track map will only be useful to see yourself one the track and upcoming corners, you wont be able to use it to see the position of other competitors until (hopefully) they add this information to the api.
    Would it be possible to stream the mirror images as well? Would be great to use my phone as rear view mirror. Two phones/mirrors, even better 

    If you use ABS or Traction Control, you are no longer a racing driver.

    1512Marcel

    And suddenly I realised that I was no longer driving the car consciously. I was driving it by a kind of instinct, only I was in a different dimension.

    Aryton Senna

  • JuanCarMRJuanCarMR Member Wheel Nut
    dwin20 said:
    @cjorgens79 - First - this is a terrific post! Helpful detail that can really help the Codemaster team to make the third party telemetry efforts significantly better - and as a result make F1 2016 better. 

    BTW - in your app is there a way in the telemetry section to see the track map as well as the graphs?

    Thanks 
    Thanks. The track map is not currently available, but i am in the process of creating all the track maps so it wont be too far away to being added to the app. Keep in mind that the f1 2016 udp telemetry only has the current players positions so the track map will only be useful to see yourself one the track and upcoming corners, you wont be able to use it to see the position of other competitors until (hopefully) they add this information to the api.
    Would it be possible to stream the mirror images as well? Would be great to use my phone as rear view mirror. Two phones/mirrors, even better 
    That could be awesome 
  • HelmetSquadHelmetSquad Member Pit Crew
    @Hoo @Lozzy

    could we have VSC delta and lap/sector delta added to output stream please?

    Also; the telemetry settings reset at game restart; can this be persistent ?
    @Lozzy @Hoo anything ? Even just patch the persistence? It's really annoying having to set this up every time.
    PS4 | G29 | PlaySeat Evo [Black]
  • transfixtransfix Member Unleaded
    @Hoo @Lozzy

    could we have VSC delta and lap/sector delta added to output stream please?

    Also; the telemetry settings reset at game restart; can this be persistent ?
    @Lozzy @Hoo anything ? Even just patch the persistence? It's really annoying having to set this up every time.
    I wish this would get patched asap. Pain in the butt to re enter each time.
  • HelmetSquadHelmetSquad Member Pit Crew
    edited November 2016
    Does anyone have any advice on how I could read this data using Python? So far I have this which apart from m_time isn't making a whole lot of sense to me.


    import socket

    UDP_IP = "0.0.0.0"
    UDP_PORT = 20777

    sock = socket.socket(socket.AF_INET, # Internet
    socket.SOCK_DGRAM) # UDP
    sock.bind((UDP_IP, UDP_PORT))

    while True:
    import struct
    x = 0
    y = 4
    i = 0

    params = (
    "m_time", "m_lapTime", "m_lapDistance", "m_totalDistance", "m_x", "m_y", "m_z", "m_speed", "m_xv", "m_yv", "m_zv",
    "m_xr", "m_yr", "m_zr", "m_xd", "m_yd", "m_zd", "m_susp_pos_bl", "m_susp_pos_br", "m_susp_pos_fl",
    "m_susp_pos_fr", "m_susp_vel_bl", "m_susp_vel_br", "m_susp_vel_fl", "m_susp_vel_fr", "m_wheel_speed_bl",
    "m_wheel_speed_br", "m_wheel_speed_fl", "m_wheel_speed_fr", "m_throttle", "m_steer", "m_brake",
    "m_clutch", "m_gear", "m_gforce_lat", "m_gforce_lon", "m_lap", "m_engineRate", "m_sli_pro_native_support",
    "m_car_position", "m_kers_level", "m_kers_max_level", "m_drs", "m_traction_control", "m_anti_lock_brakes",
    "m_fuel_in_tank", "m_fuel_capacity", "m_in_pits", "m_sector", "m_sector1_time", "m_sector2_time",
    "m_brakes_temp[4]", "m_wheels_pressure[4]", "m_tea", "m_info", "m_total_laps", "m_track_size",
    "m_last_lap_time", "m_max_rpm", "m_idle_rpm", "m_max_gears", "m_sessionType", "m_drsAllowed", "m_track_number",
    "m_vehicleFIAFlags")

    while (i <= 55):
    data, addr = sock.recvfrom(1024)
    output = struct.unpack('f', data[x:y]) # 4 bytes at a time
    print (i, params[i], output[0])
    i = i + 1
    if (i >= 55):
    x = 0
    y = 4
    i = 0
    else:
    x = y + 1
    y = x + 4
    Post edited by HelmetSquad on
    PS4 | G29 | PlaySeat Evo [Black]
  • HelmetSquadHelmetSquad Member Pit Crew
    edited November 2016
    I get;

    (0, 'm_time', 333.64877319335938)
    (1, 'm_lapTime', 1.6516445830286722e-19)
    (2, 'm_lapDistance', 205804640.0)
    (3, 'm_totalDistance', 4.5450436758462367e-26)
    (4, 'm_x', 4.4473748207092285)
    (5, 'm_y', -12683265.0)
    (6, 'm_z', -9.2415821695892811e+32)
    (7, 'm_speed', -3.9641573429107666)
    (8, 'm_xv', 32.9912109375)
    (9, 'm_yv', -8.4999424220053715e-14)
    (10, 'm_zv', -9.2785177855941442e-29)
    (11, 'm_xr', -21342580736.0)
    (12, 'm_yr', 0.002564004622399807)
    (13, 'm_zr', -765.69464111328125)
    (14, 'm_xd', -6296419958784.0)
    (15, 'm_yd', -29825302528.0)
    (16, 'm_zd', 3.1190316677093506)
    (17, 'm_susp_pos_bl', 6.5547745952899069e-19)
    (18, 'm_susp_pos_br', 0.28955948352813721)
    (19, 'm_susp_pos_fl', 3.9389992707583588e-06)
    (20, 'm_susp_pos_fr', 35.217830657958984)
    (21, 'm_susp_vel_bl', 3.6655337799123751e+24)
    (22, 'm_susp_vel_br', 2116.1279296875)
    (23, 'm_susp_vel_fl', 9.2485698645437927e-44)
    (24, 'm_susp_vel_fr', 1.0)
    (25, 'm_wheel_speed_bl', 0.0)
    (26, 'm_wheel_speed_br', 0.0)
    (27, 'm_wheel_speed_fl', 1.3770289162412519e-14)
    (28, 'm_wheel_speed_fr', -0.3972027599811554)
    (29, 'm_throttle', 3.8673117017554883e-26)
    (30, 'm_steer', 2.5036999662091507e-41)
    (31, 'm_brake', -1.0842021724855044e-19)
    (32, 'm_clutch', 400000.0)
    (33, 'm_gear', 6.6822206465916081e-39)
    (34, 'm_gforce_lat', 0.0)
    (35, 'm_gforce_lon', 0.0)
    (36, 'm_lap', 22.780544281005859)
    (37, 'm_engineRate', 6.1328892278008506e-39)
    (38, 'm_sli_pro_native_support', 0.0)
    (39, 'm_car_position', 15.306700706481934)
    (40, 'm_kers_level', 0.0)
    (41, 'm_kers_max_level', -1.4410973585814305e-37)
    (42, 'm_drs', 1.9862720367083779e-32)
    (43, 'm_traction_control', 2.6567976131272077e-15)
    (44, 'm_anti_lock_brakes', 18.0)
    (45, 'm_fuel_in_tank', 6.0209647168582988e-39)
    (46, 'm_fuel_capacity', 2.351939342522773e-41)
    (47, 'm_in_pits', -9.108440018111311e-44)
    (48, 'm_sector', 14.0)
    (49, 'm_sector1_time', 1.026398310071094e+36)
    (50, 'm_sector2_time', -2.4107938780244153e-41)
    (51, 'm_brakes_temp[4]', -4.212991842361863e-35)
    (52, 'm_wheels_pressure[4]', 9.0)
    (53, 'm_tea', 5.9004306281509353e-39)
    (54, 'm_info', 0.0)

    and then the previous 55 lines repeat - over and over - which is fine - but Im not sure how to make sense of the data.

    I have 0 development experience so i'm surprised i've got this far.
    PS4 | G29 | PlaySeat Evo [Black]
  • HelmetSquadHelmetSquad Member Pit Crew
    I can already see some issues with my code above (there are 65 vehicle parameters, not 55) - but that's by the by somewhat as I still have no idea how to make sense of the output I am getting.
    PS4 | G29 | PlaySeat Evo [Black]
  • cjacksonXBLcjacksonXBL Member New Car Smell
    I get;

    (0, 'm_time', 333.64877319335938)
    (1, 'm_lapTime', 1.6516445830286722e-19)
    (2, 'm_lapDistance', 205804640.0)
    (3, 'm_totalDistance', 4.5450436758462367e-26)
    (4, 'm_x', 4.4473748207092285)
    (5, 'm_y', -12683265.0)
    (6, 'm_z', -9.2415821695892811e+32)
    (7, 'm_speed', -3.9641573429107666)
    (8, 'm_xv', 32.9912109375)
    (9, 'm_yv', -8.4999424220053715e-14)
    (10, 'm_zv', -9.2785177855941442e-29)
    (11, 'm_xr', -21342580736.0)
    (12, 'm_yr', 0.002564004622399807)
    (13, 'm_zr', -765.69464111328125)
    (14, 'm_xd', -6296419958784.0)
    (15, 'm_yd', -29825302528.0)
    (16, 'm_zd', 3.1190316677093506)
    (17, 'm_susp_pos_bl', 6.5547745952899069e-19)
    (18, 'm_susp_pos_br', 0.28955948352813721)
    (19, 'm_susp_pos_fl', 3.9389992707583588e-06)
    (20, 'm_susp_pos_fr', 35.217830657958984)
    (21, 'm_susp_vel_bl', 3.6655337799123751e+24)
    (22, 'm_susp_vel_br', 2116.1279296875)
    (23, 'm_susp_vel_fl', 9.2485698645437927e-44)
    (24, 'm_susp_vel_fr', 1.0)
    (25, 'm_wheel_speed_bl', 0.0)
    (26, 'm_wheel_speed_br', 0.0)
    (27, 'm_wheel_speed_fl', 1.3770289162412519e-14)
    (28, 'm_wheel_speed_fr', -0.3972027599811554)
    (29, 'm_throttle', 3.8673117017554883e-26)
    (30, 'm_steer', 2.5036999662091507e-41)
    (31, 'm_brake', -1.0842021724855044e-19)
    (32, 'm_clutch', 400000.0)
    (33, 'm_gear', 6.6822206465916081e-39)
    (34, 'm_gforce_lat', 0.0)
    (35, 'm_gforce_lon', 0.0)
    (36, 'm_lap', 22.780544281005859)
    (37, 'm_engineRate', 6.1328892278008506e-39)
    (38, 'm_sli_pro_native_support', 0.0)
    (39, 'm_car_position', 15.306700706481934)
    (40, 'm_kers_level', 0.0)
    (41, 'm_kers_max_level', -1.4410973585814305e-37)
    (42, 'm_drs', 1.9862720367083779e-32)
    (43, 'm_traction_control', 2.6567976131272077e-15)
    (44, 'm_anti_lock_brakes', 18.0)
    (45, 'm_fuel_in_tank', 6.0209647168582988e-39)
    (46, 'm_fuel_capacity', 2.351939342522773e-41)
    (47, 'm_in_pits', -9.108440018111311e-44)
    (48, 'm_sector', 14.0)
    (49, 'm_sector1_time', 1.026398310071094e+36)
    (50, 'm_sector2_time', -2.4107938780244153e-41)
    (51, 'm_brakes_temp[4]', -4.212991842361863e-35)
    (52, 'm_wheels_pressure[4]', 9.0)
    (53, 'm_tea', 5.9004306281509353e-39)
    (54, 'm_info', 0.0)

    and then the previous 55 lines repeat - over and over - which is fine - but Im not sure how to make sense of the data.

    I have 0 development experience so i'm surprised i've got this far.
    Try little endian for values. getting 55 or 65 values doesn't effect anything. Doc says values comes as byte stream of floats. Floats are 4 byte so you should get 4 bytes as little endianed. There are probably python function for this. I'm sure you get correct result after that
Sign In or Register to comment.