Jump to content

capturing game events

Recommended Posts

I was wondering what type of events can be captured from the game run time binary (through the TruckersMP client)?


What am I interested in knowing? well.....

When I play single player and have 'offenses' on there is a good amount of traffic violations that will register and sooner or later cause me to have consequences financially in the game. Examples: Speed violations, Wrong lane, Running red lights and collisions with AI (or in case MP other players!).

I was wondering if these events could be captured from the game as it would allow for logging or emitting these events as a stream (e.g. to kafka or rabbitmq through pub-sub architecture)!


This for example could help reconstruct traffic situations simply by looking at the aggregated events chronologically based on player IDs and potentially even help automate kicks or bans in clear cut (programmable) situations. All that while only burdening the clients computing/internet power and receiving the data separately from the MP servers as not to burden them with 10k users worth of event data! Retention of data could be solely focused around collision events and the involved parties. e.g. two players collided on a C-D road, collision speed for truck 1 is 90km/h, truck 2 90km/h but truck 1 was also registered in a 'wrong lane' event that hadn't ended yet at the time of collision. i.e. truck 1 was at fault ?️‍♂️

sorry if this seems a dumb question, but absolutely in the dark about the realms of possibilities of getting situational data out of the game client. This seemed like the only right place to ask and speculate on this kind of topic ? 

Link to comment
Share on other sites

The game acctually has its own developer SDK you can use to get a lot of this information from. https://modding.scssoft.com/wiki/Documentation/Engine/SDK/Telemetry

From its built in documentation these are the events supported out of the box:

 * @brief Fine offence type.
 * Possible values:
 * @li crash
 * @li avoid_sleeping
 * @li wrong_way
 * @li speeding_camera
 * @li no_lights
 * @li red_signal
 * @li speeding
 * @li avoid_weighing
 * @li illegal_trailer
 * @li generic
 * Type: string

As an example, I write the job logger for vtlog and we use more or less all the data from this sdk to log job and send it in realtime to our servers so its fully possible.

A thing to note is that not all these events are instant. These are only fine events so you have to be fined in-game before its triggered.

  • Thanks 1
Link to comment
Share on other sites

  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.