{"id":20940952,"url":"https://github.com/timhanewich/codemasters.f1_2020","last_synced_at":"2025-05-13T23:30:56.599Z","repository":{"id":38148180,"uuid":"279163070","full_name":"TimHanewich/Codemasters.F1_2020","owner":"TimHanewich","description":"A package of resources for deserializing and analyzing UDP telemetry data from the F1 2020 video game by Codemasters.","archived":false,"fork":false,"pushed_at":"2022-12-08T12:40:00.000Z","size":21706,"stargazers_count":15,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-02T09:44:57.775Z","etag":null,"topics":["analysis","codemasters","f1","formula","games","hamilton","lewis","racing","telemetry","udp","video"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TimHanewich.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-12T23:08:40.000Z","updated_at":"2024-08-12T19:11:12.000Z","dependencies_parsed_at":"2023-01-25T13:45:16.755Z","dependency_job_id":null,"html_url":"https://github.com/TimHanewich/Codemasters.F1_2020","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimHanewich%2FCodemasters.F1_2020","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimHanewich%2FCodemasters.F1_2020/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimHanewich%2FCodemasters.F1_2020/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TimHanewich%2FCodemasters.F1_2020/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TimHanewich","download_url":"https://codeload.github.com/TimHanewich/Codemasters.F1_2020/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254043215,"owners_count":22004911,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["analysis","codemasters","f1","formula","games","hamilton","lewis","racing","telemetry","udp","video"],"created_at":"2024-11-18T23:12:26.985Z","updated_at":"2025-05-13T23:30:51.569Z","avatar_url":"https://github.com/TimHanewich.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Codemasters.F1_2020\n===================\nA package of resources for deserializing and analyzing UDP telemetry data from the F1 2020 video game by Codemasters.\n------\n\nThe F1 2020 video game will provide to you a UDP data package in the form of a byte array (`byte[]`). There are several different types of data packets that the game will broadcast. Import the following namespace to use the basic resources for reading data:\n\n    using Codemasters.F1_2020;\n\nEvery packet type derives from the same base class, `Packet`. The `Packet` class contains the following properties:  \n\n`PacketFormat` - Describes the game the packet is from (F1 2020)  \n`GameMajorVersion` - The major version of the game at the time of broadcast  \n`GameMinorVersion` - The minor version of the game at the time of broadcast  \n`PacketVersion`  \n`PacketType` - The type of packet this data is (i.e. Telemetry, status, lap data, etc.)  \n`UniqueSessionId` - The unique ID of your session.  \n`SessioTime` - The timestamp of the current session when this packet was recorded and broadcasted.  \n`FrameIdentifier` - Which grouping of packets this data belongs to.  \n`PlayerCarIndex` - The index of the player's car in field arrays in all corresponding packets.  \n`SecondaryPlayerCarIndex` - If you are playing two player (split screen), this will be player 2's index in the field array.  \n\nTo tell what type of packet any array of bytes that was provided to you is, use the CodemastersToolkit. The `bytes` variable below would come from your telemetry broadcast, or from a deserialized file if you saved telemetry on disk.\n\n    byte[] bytes; //Your telemetry data package\n    PacketType pt = CodemastersToolkit.GetPacketType(bytes);\n    Console.WriteLine(pt.ToString());\n\nConsole output of the above: \"CarTelemetry\"  \nSince we know that this particular data package is a telemetry packet, we can create a telemetry package:\n\n    TelemetryPacket tp = new TelemetryPacket();\n    tp.LoadBytes(bytes);\n\nThe `TelemetryPacket` class contains an array of `CarTelemetryData`, one for each car in the field.  \nAs an exmaple, the below code will print the throttle pressure that every driver is applying at the moment this data was broadcasted.\n\n    foreach (TelemetryPacket.CarTelemetryData ctd in tp.FieldTelemetryData)\n    {\n        Console.WriteLine(ctd.Throttle.ToString());\n    }\n\nMany of the packets follow a similar format as is seen above with the `TelemetryPacket`.  \n\n### Converting all telemetry to packets  \nYou can convert all of the byte array packages that you received. Example:  \n\n    List\u003cbyte[]\u003e telemetry;\n    Packet[] packets = CodemastersToolkit.BulkConvertByteArraysToPackets(telemetry);\n\nYou can then convert each packet from the returned array of packets. For example, converting a `Packet` to the `TelemetryPacket`:\n\n    foreach (Packet p in packets)\n    {\n        if (p.PacketType == PacketType.CarTelemetry)\n        {\n            TelemetryPacket telpack = (TelemetryPacket)p;\n        }\n    }\n\n### Getting a related packet\nYou may need to, for example, find the accompanying `CarStatusPacket` for a particular `TelemetryPacket`. To do this:\n\n    TelemetryPacket telpack;\n    CarStatusPacket csp = (CarStatusPacket)telpack.GetRelatedPacket(packets, PacketType.CarStatus);\n\n**If you previously used the Codemasters.F1_2020.Analysis namespace and now find it missing: The analysis namespace has been moved under the ApexVisual.F1_2020 NuGet package (https://www.nuget.org/packages/ApexVisual.F1_2020/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimhanewich%2Fcodemasters.f1_2020","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimhanewich%2Fcodemasters.f1_2020","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimhanewich%2Fcodemasters.f1_2020/lists"}