npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

f1-telemetry-cli

v1.2.1

Published

Recorder and processor for F1 games.

Downloads

18

Readme

f1-telemetry-cli

CircleCI npm (tag) semantic-release

A simple CLI for tracking and processing F1 game UDP data (currently supports F1 2020).

Companion CLI for the F1 Racing Portal.

Overview

This CLI uses the in-game UDP packet stream to parse and process the race data as it comes in. This data is then persisted to a flat json file on interval for later retrieval/processing. There are many other solutions out there that accomplish this in different ways. The approach of this package was to try and be very selective about what data is stored to try and keep the process as lightweight as possible. If you are looking to collect as much data as possible for more powerful post-processing capabilities, you might want to check out this project.

Tracked Data

Here is a high level idea of the kinds of data that this CLI records:

  • Session ID
  • Driver data such as racing number and team
  • Snapshot lap data for tracking fastest lap, fastest sectors, and driver status
  • End of race classification data for all drivers such as fastest lap time, points, pit stops, penalties (basically everything you see on the final screen after a race/quali)
  • Custom data such as best lap tire (this is not provided in lap or classification data)

For a full example of a completed race, check out the stub here.

Installation

npm install -g f1-telemetry-cli

Usage

f1-telemetry help
f1-telemetry [command]

Commands:
  f1-telemetry record          Start recording F1 2020 sessions
  f1-telemetry process <file>  Process session data for specific session
  f1-telemetry session         Get live session data

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Recorder

f1-telemetry record

Start recording F1 2020 sessions

Options:
      --version          Show version number                           [boolean]
      --help             Show help                                     [boolean]
  -p, --path             Path to write file to                    [default: "."]
      --write-frequency  Time in ms to wait between flushes to file
                                                                 [default: 2500]
      --prefix           Name to prefix written file with          [default: ""]
      --port             UDP port to listen on                  [default: 20777]
  -f, --forward-address  IP Address to forward UDP packet stream to

This command will record the active UDP data stream from the game and save the important bits and bobs in a very lightweight json file. This can be extremely useful for collecting data for things like league races.

Processor

f1-telemetry process <file>

Process session data for specific session

Options:
      --version  Show version number                                   [boolean]
      --help     Show help                                             [boolean]
  -p, --path     Path to write file to                            [default: "."]
  -n, --name     Name of the processed file               [default: "processed"]

This command will further process the raw json data and put it into a slightly more usable format.

This command also augments the original data with some calculated data that could be useful such as:

  • Driver Fastest Lap Delta - the difference between each driver's fastest lap and the race's fastest lap
  • Driver Fastest Lap Sector Deltas - the difference between each driver's fastest sector and the session's fastest lap's fastest sector (not the overall fastest sector)

It will then organize this data sorted by the finishing race position and keyed by the driver's racing number.

For a full example of a completed race, check out the stub here.

Session

f1-telemetry session

Get live session data

Options:
      --version       Show version number                              [boolean]
      --help          Show help                                        [boolean]
      --port          UDP port to listen on                     [default: 20777]
      --events-shown  Number of events to show in events table      [default: 5]
  -m, --map-file      Path to csv driver map (racing number, driver name)
                                                                 [default: null]

This command can be used to stream session information to your console. This is a great tool for getting at-a-glance information as a broadcaster or spectator.

To correlate real-time events to drivers, you can pass a path to a csv with driver racing numbers to names like so:

2,Rawrocopter
21,Redbaron

Now everytime an event comes in for racing number 2, Rawrocopter will be shown instead.