Integrations
Telemetry Pipeline
Extracting data from the SCS Telemetry SDK.
The accuracy of Waylog's platform relies entirely on the quality of data extracted from the game client.
The SCS Telemetry SDK
Euro Truck Simulator 2 and American Truck Simulator expose internal game state via a shared memory SDK. Waylog interacts with this SDK using a Rust implementation within the Tauri desktop client.
Data Flow
- Memory Polling: The Rust backend (
src-tauri) continuously reads the shared memory space. - Delta Filtering: Emitting data on every frame would overload the IPC bridge. Rust filters the data, emitting JSON payloads (
telemetry-update) only when meaningful changes occur (e.g., GPS coordinates change, speed shifts, cargo state alters). - State Derivation: The React frontend receives the raw stream and processes it through a state machine. It determines when the user transitions from
NO_JOBtoON_JOB, and eventually toDELIVERED. - Data Aggregation: Throughout the job, the client batches GPS breadcrumbs and discrete events (like refuelling or receiving a fine).
- Sync: The batched payload is sent to the Fastify API to be permanently recorded in PostgreSQL.
The State Machine
The client-side state machine is crucial. It must gracefully handle game crashes, paused states, and multiplayer desyncs.
- Job Identification: Every job is assigned a deterministic ID based on its origin, destination, cargo, and start time. This prevents duplicate records if the network drops and the client has to retry syncing.
- Event Triggers: The state machine monitors for specific flags. For example, if
telemetry.job.deliveredbecomestrue, the machine locks the final revenue and damage stats, prepares the payload, and transitions back toNO_JOB.