API FOR EXTERNAL APPS

There are two main ways external applications can connect to the game. First is Shared Memory access, available on PC only  and on all platforms this can be done using UDP protocol. Both are ways to provide lots of various real-time information about the game, ie- physics state, car speed, best lap time, wind direction, etc. The purpose for this is to share this real-time data with external hardware. This could range from cockpit simulators, telemetry calculations, to additional info displays.

From within the game player can enable either of this in the Options menu. This page provides the necessary API and example applications to connect to either variant.

 1. SHARED MEMORY

The shared memory is implemented in the same way we did it 10+ years ago- using a Memory-Mapped file (easier understood as an in-memory file). The game has 2 modes. Old Project CARS (compatible with the older game and older apps) – n memory file is named “$pcars$” for this version and a newer Project CARS2  (“$pcars2$” for the new version )

It’s updated every render frame, so this really depends on your user settings; ie; Resolution: ‘Hz’.

Code examples, how to use the memory mapped file

Old protocol version:

New protocol version:

 

Patch 5 (for New protocol version)

API header file:

Changelog:

Archive

API header file:

Nationalities:

Changelog:

2. UDP

The UDP interface is used to share information on places, where the Shared Memory approach cannot be used, mainly on console hardware. The game sends data using fixed port over the network for listening applications. As Shared Memory, this too has two versions. older for backward compatibility and new one.

Code examples, how to use the UDP data sent over network.

 

Project CARS version
Example app:

API header file:

 

Project CARS 2 version

Example app:

 

Patch 5 (for Project CARS 2 version)

API header file:

Nationalities file:

Changelog:

Archive

API header file:

Nationalities:

Changelog:

Stay Connected