Skip to main content

Reads replay files from the game Circuit Superstars and offers tools to analyze the extracted data

Project description

CSUP Analyzer

What

Reads replay files (the .header files) from the game Circuit Superstars and offers tools to analyze the extracted data.

The replay files hold information about (for quali and race respectively):

  • lap times
  • fastest lap times
  • time penalties per lap (no slow down penalties)
  • metres driven
  • number of laps driven
  • number of laps led
  • total race time
  • track name and layout
  • driver car
  • driver/car color codes
  • if driver is an AI
  • driver name
  • driver platform

Besides reading them out of the files in a well-structured way and serving them via a pandas DataFrame (very popular in python data analysis) it also calculates more variables out of those provided:

  • time until starting line (basically the time until you start lap 1)
  • race start position
  • race finish position
  • race positions by lap

Who

This is a community project kicked-off by Dremet but everyone is welcome to contribute and use the code, see Licence at the bottom.

When

This project was launched at the end of June 2023 when the version 1.5.0 of the game was released because the .header replay files did not hold that much valuable information before.

Why

The purpose of this libary is to analyze race data. There is currently no API you can request race data/statistics from and also there is no in-game race history/statistics functionality.

Another reason for this project is that the initial author, Dremet, is administrating the community website https://www.csup.app/ which offers league administration, standings calculations, an elo list, driver statistics etc. Until the 1.5.0 patch there was no way to automatically enter race results into the database behind the website. Extracting data from the .header files is the first step to (semi-) automize result entry. The plan is to launch a CSUP.APP discord bot that offers a /enter_results {race_id} {header_files} command for organizers to enter results easily. That bot would use this library to extract the data from the replay files.

How

After each race you can find a .header file for each session (e.g. one for qualification and one for the race) in a folder. Assuming your main drive is named "C:" as well you only need to replace "WINDOWS_USER" and "SOME_USER_ID" in the follow folder path to find the replay files on your computer:

C:\Users\WINDOWS_USER\AppData\LocalLow\Square Enix Ltd\circuit-superstars\SOME_USER_ID\race-recordings

If you just want to use the library, simply install it like any other library with pip install csup_analyzer or pdm add csup_analyzer.

If you want to develop/contribute and you use pdm for your python environments you should be able to easily set up the environment with the pyproject.toml file (pdm install). Otherwise a requirements.txt file is provided.

Afterwards you can adapt the file paths in run.py to test it and have fun with the modified pandas DataFrame accessible via event.result_df.

Contribute

You are very welcome to work on this project and create pull requests! Feel free to contact me (Dremet) on Discord. You'll find me on (almost) all CSUP discord servers.

If you want to add calculations please have a look at csup_analyzer/event/Result.py.

If you want to add visualization support please go to csup_analyzer/plots/Plots.py.

License

License: MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

csup_analyzer-0.1.2.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

csup_analyzer-0.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file csup_analyzer-0.1.2.tar.gz.

File metadata

  • Download URL: csup_analyzer-0.1.2.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.7.4 CPython/3.9.13

File hashes

Hashes for csup_analyzer-0.1.2.tar.gz
Algorithm Hash digest
SHA256 844d0b691509cd2900e8d24a520d84131f4225086e84a717a4537c856f01bfa5
MD5 5d7e8c296f53d16b7c59ca59dd4844ff
BLAKE2b-256 3fc003dacb9074713e310fc48c95469baede60582152781be6391c0e795370f9

See more details on using hashes here.

File details

Details for the file csup_analyzer-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: csup_analyzer-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.7.4 CPython/3.9.13

File hashes

Hashes for csup_analyzer-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f2fced7a6217ddc52bc9e906b7679d9d264529545656b648a0c5144522f5d35a
MD5 6fe34282a621bf4e84550a1bd9ec459d
BLAKE2b-256 7e0e43b97bb78f3c33894dbe5705c693933c4d563d6d4eda083dce0ef71ff426

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page