GithubHelp home page GithubHelp logo

rencloud / scs-sdk-plugin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nlhans/ets2-sdk-plugin

181.0 24.0 34.0 5.27 MB

ETS2 (Euro Truck Simulator 2) & ATS (American Truck Simulator) SDK plug-in. Telemetry data is shared via SharedMemory/Memory Mapped Files.

License: MIT License

C# 42.79% C++ 30.66% C 26.54% Batchfile 0.01%
ets2 ats telemetry

scs-sdk-plugin's Introduction

fork of nlhans work

SCS Telemetry for EuroTruckSimulator 2 and AmericanTruckSimulator

SCS has kindly released a SDK that allows developers and users to stream telemetry data from the game to any 3rd party applications. An example program was provided (and often used) which enabled streaming data by using text files stored on the users harddisk. This puts unnecessary stress on the users harddrive (not the mention the number of re-writes that would hurt SSDs), and moreover requires the user to manually configure the telemetry data source.

This SDK plug-in transports the telemetry stream via a Memory Mapped File. This is a special Windows (file)stream which resides completely in RAM and can be read from multiple applications.

Installation

Actually you need to build this branch yourself. I will add a release later. Stay tuned for more information.

Installation is easy inside Euro Truck Simulator 2. Place the acquired DLL inside bin/win_x64/plugins/ of your ETS2/ATS installation. It is possible the plugins directory doesn't exists yet (as with every default installation). In that case you need to create the plugins folder. Place the DLL inside the plugins folder.

You will now notice that each time ETS2/ATS now starts it prompts the SDK has been activated. Unfortunately you have to press OK to this message every time, but it's a small price to pay for the added features that are possible via the SDK.

Developers Information

Documentation (not completed at the moment)

There is also an Documentation. It tells a lot about the values. An installation, build , etc. guide will also follow. Should there still be questions, feature request or other changes visit the discord server linked at the top.

Sadly the usage of the documentation generating syntax leads to a lot of warnings, while compiling the c# part. That's because the documentation use < and >. But that's no valid xml. Therefore the compiler cry's ๐Ÿ˜ข and give the warning about invalid xml. With the help of #pragma it wont show up.

Overview

This plug-in stores it's data inside a Memory Mapped File, or "Shared Memory". This allows it to operate without any access to harddrive, or configuration hassle by the user to locate the memory map.

Rev Numbers

Rev Numbers shows big changes on the shared memory and sometimes on the C# object. That means Rev 10 wont work with Rev 9. Doesn't matter which side is not updated. Sub Versions that you can see in changelog.md should work with small errors or completely without. The C# object is mostly not changed. Only if needed, because of new values (most of the cases) or structure changes (less the case). If this occurs i will notice that. (See changelog.md. If you directly access the shared memory you will find an overview about the changes here.)

Plugin for 1.46/SDK1.14

Lower SDK Version means there are less values / values that are zero. To get an overview which values that are look at the list at the middle of this document. Note to the SDK Version: SDK 1.13 is not the same like the sdk version of ETS2 or ATS. Both games have an own SDK version. See list under ATS. A version number with an asterisk (e.g. 1.46*) indicates that this version is currently in open beta.

ETS2

Game Version SDK Version Plugin State
1.26 and before 1.12 and before Not Tested, could work with errors
1.27 - 1.34 1.13 Should work
1.35 1.14 Should work
1.36 1.15 Should work
- 1.40 1.16 Should work
1.41 - 1.44 1.17 Should work
1.45 - 1.46 1.18 Works, Test Version

ATS

Game Version SDK Version Plugin State
1.34 and before 1.0 Should work
1.35 1.01 Should work
1.36 1.02 Should work
- 1.40 1.03 Should work
1.41 - 1.44 1.04 Should work
1.45 - 1.46 1.05 Works, Test Version

SDK VERSION AND GAME SDK VERSION

SDK VERSION ETS2 SDK Version ATS SDK VERSION
1_1 1.07 -
1_2 1.08 -
1_4 1.10 -
1_5 1.12 -
1_9 1.13 1.00
1_10 1.14 1.01
1_11 1.15 1.02
1_12 1.16 1.03
1_13 1.17 1.04
1_14 1.18 1.05

Telemetry fields and the c# object

The following telemetry fields are supported, structure is similar the C# object. Starting with sdk 1.10, game patch 1.35 and ETS2 1.14, ATS 1.01 code for some part of the need different versions of the sdk. The plugin handles this. If a game lower than 1.35 is used, only the values without (1.14/1.01) are possible:

Edit: for better overview it is now (ETS2 SDK/ATS SDK/Game Version). I added the game version, because it is the same for ats and ets2 and most of you probably doesn't know the specific Game SDK Version.

Changes are marked with the deleted Tag. New stuff is marked with the inserted Tag.

Game Values (V.1.11):
โ”‚    โ”œโ”€โ”€ Telemetry Timestamp (not the in-game time, only for usage in code, see documentation for more information #todo add link) (now ulong)
โ”‚    โ”œโ”€โ”€ Simulation Timestamp
โ”‚    โ”œโ”€โ”€ Render Timestamp
โ”‚    โ”œโ”€โ”€ Multiplayer Time Offset (1.18/1.05/1.45)
โ”‚    โ”œโ”€โ”€ Paused, game state
โ”‚    โ”œโ”€โ”€ SCSGame identifier as enum, currently ets2/ats/unknown
โ”‚    โ”œโ”€โ”€ GameVersion and Game Telemetry Version (major.minor)
โ”‚    โ”œโ”€โ”€ Dll version (usage in code)
โ”‚    โ”œโ”€โ”€ TelemetryVersion
โ”‚    โ”œโ”€โ”€ Substances
โ”‚    โ”œโ”€โ”€ Common Values:
โ”‚    โ”‚    โ”œโ”€โ”€ Scale
โ”‚    โ”‚    โ”œโ”€โ”€ Game Time (Time object with in-game minutes and datetime object)
โ”‚    โ”‚    โ”œโ”€โ”€ NextRestStop (Frequency object, more a time span)
โ”‚    โ”‚    โ””โ”€โ”€ NextRestStopTime (Specific date, calculated)
โ”‚    โ”œโ”€โ”€ Truck Values (Contains 2 big parts, and a small one):
โ”‚    โ”‚    โ”œโ”€โ”€ Constants/Configs (Values that barely change):
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Motor Values:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Forward Gear Count
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Reverse Gear Count
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Retarder Step Count
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Selector Count
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Engine RPM Max
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Differential Ration
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Gear Ratios Forward
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Gear Ratios Reverse
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Shifter Type Value (Enum)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ SlotGear
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ SlotHandlePosition
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ SlotSelectors
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Capacity Values:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Fuel
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Adblue
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Warning Factors:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Fuel
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Adblue
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Air Pressure
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Air Pressure Emergency
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Oil Pressure
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Water Temperature
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Battery Voltage
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Wheels:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Count
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Radius
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Simulated
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Powered
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Liftable
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Steerable
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Brand Id (code)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Brand
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Id (code)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Name
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ LicensePlate (1.14/1.01/1.35)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ LicensePlateCountryId (1.14/1.01/1.35)
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ LicensePlateCountry (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Current Values (Values that change a lot):
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Electric Enabled
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Engine Enabled
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ LiftAxle (1.17/1.04/1.41)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ LiftAxleIndicator (1.17/1.04/1.41)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ TrailerLiftAxle (1.17/1.04/1.41)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ TrailerLiftAxleIndicator (1.17/1.04/1.41)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Motor Values:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Gear Values:
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ HShifterSlot
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Selected
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ HShifterSelector
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Brake Values:
โ”‚    โ”‚    โ”‚    โ”‚         โ”œโ”€โ”€ RetarderLevel
โ”‚    โ”‚    โ”‚    โ”‚         โ”œโ”€โ”€ Air Pressure
โ”‚    โ”‚    โ”‚    โ”‚         โ”œโ”€โ”€ Temperature
โ”‚    โ”‚    โ”‚    โ”‚         โ”œโ”€โ”€ Parking Brake
โ”‚    โ”‚    โ”‚    โ”‚         โ””โ”€โ”€ Motor Brake
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Dashboard:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Fuel Values:
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Amount
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Average Consumption
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Range (estimated range with current amount of fuel)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Warnings:
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Air Pressure
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Air Pressure Emergency
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Fuel warning
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Adblue
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ oil pressure
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ adblue
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ water temperature
โ”‚    โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ battery voltage
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Gear Dashboards
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Speed (m/s,km/h,mph)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ CruiseControlSpeed (m/s,km/h,mph)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Adblue amount
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Oil Pressure
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Oil Temperature
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Water Temperature
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ BatteryVoltage
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ RPM
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Odometer
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Wipers
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Cruise Control ("special field", same like `CruiseControlspeed == 0`)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Acceleration:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Linear Velocity
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Angular Velocity
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Linear Acceleration
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Angular Acceleration
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Cabin Angular Velocity
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Cabin Angular Acceleration
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Lights:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Aux Front (enum for 3 states)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Aux Roof (enum for 3 states)
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Dashboard Backlight
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Blinker Left Active
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Blinker Right Active
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Blinker Left On
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Blinker Right On
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Parking
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Beam Low
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Beam High
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Beacon
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Brake
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Reverse
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ HazardWarningLights (1.17/1.04/1.41)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Wheels:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Substance
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ SuspDeflection
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Velocity
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Steering
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Rotation
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Lift
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Lift Offset
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ on ground
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ position
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Damage:
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Engine
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Transmission
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Cabin
โ”‚    โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ chassis
โ”‚    โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ wheels (avg. of all wheels)
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Position (position in world space with position and orientation)
โ”‚    โ”‚    โ””โ”€โ”€ Positioning:
โ”‚    โ”‚         โ”œโ”€โ”€ Cabin (vehicle space)
โ”‚    โ”‚         โ”œโ”€โ”€ Head (cabin space)
โ”‚    โ”‚         โ”œโ”€โ”€ Hook (vehicle space)
โ”‚    โ”‚         โ”œโ”€โ”€ Head Offset
โ”‚    โ”‚         โ”œโ”€โ”€ Cabin Offset
โ”‚    โ”‚         โ””โ”€โ”€ Contains "more fields" see at the bottom of the list
โ”‚    โ”œโ”€โ”€ Trailer Values (will be set to 0, false, etc. if you have no trailer, while on job or with trailer ownership detached wont reset the values)[0-9] (array starting with 1.14/1.01 so 0 for 1 trailer or version lower than that):
โ”‚    โ”‚    โ”œโ”€โ”€ Attached
โ”‚    โ”‚    โ”œโ”€โ”€ Hook
โ”‚    โ”‚    โ”œโ”€โ”€ Position
โ”‚    โ”‚    โ”œโ”€โ”€ Wheel Values:
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Substance
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ SuspDeflection
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Velocity
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Steering
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Rotation
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ On Ground
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Lift
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ LiftOffset
โ”‚    โ”‚    โ”œโ”€โ”€ WheelsConstants:
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Count
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Radius
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Simulated
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Powered
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Liftable
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Steerable
โ”‚    โ”‚    โ”œโ”€โ”€ Acceleration:
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Linear Velocity
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Angular Velocity
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Linear Acceleration
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Angular Acceleration
โ”‚    โ”‚    โ”œโ”€โ”€ DamageValues:
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Cargo (1.14/1.01/1.35)
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Wheels
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Chassis
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Body (1.18/1.05/1.45)
โ”‚    โ”‚    โ”œโ”€โ”€ Chassis (code)
โ”‚    โ”‚    โ”œโ”€โ”€ Id (code)
โ”‚    โ”‚    โ”œโ”€โ”€ Name
โ”‚    โ”‚    โ”œโ”€โ”€ CargoAccessoryId
โ”‚    โ”‚    โ”œโ”€โ”€ BodyType (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ BrandId (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Brand (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Name (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ ChainType (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ LicensePlate (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ LicensePlateCountryId (1.14/1.01/1.35)
โ”‚    โ”‚    โ””โ”€โ”€ LicensePlateCountry (1.14/1.01/1.35)
โ”‚    โ”œโ”€โ”€ Job Values(will be reset after the job finished flag is disappeared):
โ”‚    โ”‚    โ”œโ”€โ”€ Delivery Time (time object -> in-game minutes and datetime object)
โ”‚    โ”‚    โ”œโ”€โ”€ Remaining Delivery Time (calculated)
โ”‚    โ”‚    โ”œโ”€โ”€ CargoLoaded (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ SpecialJob (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Market (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ City Destination Id (code)
โ”‚    โ”‚    โ”œโ”€โ”€ City Destination
โ”‚    โ”‚    โ”œโ”€โ”€ Company Destination Id (code)
โ”‚    โ”‚    โ”œโ”€โ”€ Company Destination
โ”‚    โ”‚    โ”œโ”€โ”€ City Source Id (code)
โ”‚    โ”‚    โ”œโ”€โ”€ City Source
โ”‚    โ”‚    โ”œโ”€โ”€ Company Source Id (code)
โ”‚    โ”‚    โ”œโ”€โ”€ Company Source
โ”‚    โ”‚    โ”œโ”€โ”€ Income
โ”‚    โ”‚    โ”œโ”€โ”€ Planned Distance Km (1.15/1.02/1.36)
โ”‚    โ”‚    โ””โ”€โ”€ Cargo Values:
โ”‚    โ”‚         โ”œโ”€โ”€ Mass
โ”‚    โ”‚         โ”œโ”€โ”€ Name (code)
โ”‚    โ”‚         โ”œโ”€โ”€ Id (1.14/1.01/1.35)
โ”‚    โ”‚         โ”œโ”€โ”€ UnitCount (1.14/1.01/1.35)
โ”‚    โ”‚         โ”œโ”€โ”€ UnitMass (1.14/1.01/1.35)
โ”‚    โ”‚         โ””โ”€โ”€ CargoDamage (1.14/1.01/1.35)
โ”‚    โ”œโ”€โ”€ Control Values:
โ”‚    โ”‚    โ”œโ”€โ”€ User Input:
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Steering
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Throttle
โ”‚    โ”‚    โ”‚    โ”œโ”€โ”€ Brake
โ”‚    โ”‚    โ”‚    โ””โ”€โ”€ Clutch
โ”‚    โ”‚    โ””โ”€โ”€ Game Values:
โ”‚    โ”‚         โ”œโ”€โ”€ Steering
โ”‚    โ”‚         โ”œโ”€โ”€ Throttle
โ”‚    โ”‚         โ”œโ”€โ”€ Brake
โ”‚    โ”‚         โ””โ”€โ”€ Clutch
โ”‚    โ”œโ”€โ”€ Navigation Values:
โ”‚    โ”‚    โ”œโ”€โ”€ Navigation Distance
โ”‚    โ”‚    โ”œโ”€โ”€ Navigation Time
โ”‚    โ”‚    โ””โ”€โ”€ Speed Limit
โ”‚    โ”œโ”€โ”€ SpecialEvents:
โ”‚    โ”‚    โ”œโ”€โ”€ On Job
โ”‚    โ”‚    โ”œโ”€โ”€ Job Cancelled (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Job Delivered (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Fined (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Tollgate (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Ferry (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Train (1.14/1.01/1.35)
โ”‚    โ”‚    โ”œโ”€โ”€ Refuel Start
โ”‚    โ”‚    โ”œโ”€โ”€ Refuel End (Fired on refuel stop)
โ”‚    โ”‚    โ””โ”€โ”€ Refuel Payed (Fired on refuel end/engine start)
โ”‚    โ””โ”€โ”€ GameplayEvents (1.14/1.01/1.35):
โ”‚         โ”œโ”€โ”€ Refuel:
โ”‚         โ”‚    โ””โ”€โ”€ Amount (No Version note)  (see changelog update 10.4 for some notes to that)
โ”‚         โ”œโ”€โ”€ Cancelled:
โ”‚         โ”‚    โ”œโ”€โ”€ Started (This value could be wrong if profile is closed or game is restarted, see changelog update 10.4)
โ”‚         โ”‚    โ”œโ”€โ”€ Finished
โ”‚         โ”‚    โ””โ”€โ”€ Penalty
โ”‚         โ”œโ”€โ”€ Delivered:
โ”‚         โ”‚    โ”œโ”€โ”€ Started (This value could be wrong if profile is closed or game is restarted, see changelog update 10.4)
โ”‚         โ”‚    โ”œโ”€โ”€ Finished>
โ”‚         โ”‚    โ”œโ”€โ”€ StartedBackup (See changelog update 10.4 and documentation for notes to that property)
โ”‚         โ”‚    โ”œโ”€โ”€ AutoLoaded
โ”‚         โ”‚    โ”œโ”€โ”€ AutoParked
โ”‚         โ”‚    โ”œโ”€โ”€ CargoDamage
โ”‚         โ”‚    โ”œโ”€โ”€ DeliveryTime
โ”‚         โ”‚    โ”œโ”€โ”€ DistanceKm
โ”‚         โ”‚    โ”œโ”€โ”€ EarnedXp
โ”‚         โ”‚    โ””โ”€โ”€ Revenue
โ”‚         โ”œโ”€โ”€ Fined:
โ”‚         โ”‚    โ”œโ”€โ”€ Amount
โ”‚         โ”‚    โ””โ”€โ”€ Offence
โ”‚         โ”œโ”€โ”€ Tollgate:
โ”‚         โ”‚    โ””โ”€โ”€ PayAmount
โ”‚         โ””โ”€โ”€ Transport:
โ”‚              โ”œโ”€โ”€ PayAmount
โ”‚              โ”œโ”€โ”€ SourceId
โ”‚              โ”œโ”€โ”€ SourceName
โ”‚              โ”œโ”€โ”€ TargetId
โ”‚              โ””โ”€โ”€ TargedName  

Also there are a few more fields you can use:

Truck.Positioning:
	- Head position in Cabin Space
	- Head position in Vehicle Space
	- Head position in World Space
	- Head Position in World Space 
	- Cabin Position in World Space
	- Hook Position in World Space

Methods:
	- In-game Minutes to Date(Time)
	- Add 2 FVectors
	- Add a FVector and a DVector
	- Rotate: Rotates specified vector by specified orientation 

May I forgot something or there is a missing version information. When you found missing values or something else create an issue that would be great.

The fields are updated as fast as ETS2/ATS can and will do, as this is how the SDK has been designed by SCS. When a telemetry value has changed the SDK will immediately call a handler. This plug-in implements this handler which stores the data to the right field inside the data structure. There is no "sample ticker" yet. This must be done at the client side, by regularly checking if the timestamp has been updated.

Client Implementations

C#

Actually I'm not fully happy with the actual demo. But I didn't reached my plan that works like the old one. Later I will change the current demo so that they will be a lot times better.

Javascript

If you want to use javascript have a look here Kniffen TruckSim-Telemetry.

Other

For other languages you need to create/find a library that can open and read MemoryMapped files. The data storage format is binary and can be found in "scs-telemetry/inc/scs-telemetry-common.hpp". The shared memory map name is "Local\SCSTelemetry". I will add some more documentary in this header later.

Upcoming Changes

There will be some upcoming changes. One changes will probably linux support, which will using tcp on windows and linux. So shared memory would be dropped. Additional, also to still achieve a better performance, changes to when data will be send will be done. Currently data is partly updated and fully parsed on c# side. That will change. The c# side will not parse the full object each time when the changes going live.

scs-sdk-plugin's People

Contributors

davwheat avatar dreagonmon avatar gitter-badger avatar kniffen avatar nlhans avatar rencloud avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scs-sdk-plugin's Issues

Chassis is actually not working as aspected

see also c++ todo inline

chassis doesn't work actually ... so i need to change that

that means id with v is directly vehicle.x.y now i should check it is vehicle.
For chassis check contains 2 dots? 1 dot? have to check this

Think about a good way to handle the offset

fast ideas:
value size areas : first int, floats, bool, ... and than the amount
set the offset at the and off a function call up to the needed amount ? (think that is the easiest on so like above and actually only the order is needed)
create a JSOn/XML/... file that controls C# part and C++, some useful cases for this but i think its overkill

More languages

add plugins for other languages (python, java, etc. )

if you have wishes comment this issue

create better demo...

demo application is working but not nice. trailer page now with 10 trailer will freeze ui and thats a no go. need to change to a better idea

Global Logger function

A logger function is used to write to the game log.
But actually i can't get this function to work global so that i can used it in 2 different files.

It would be nice to achieve this.

change config event handling

id of attribute could be not unique. Because of that, the usage of id of the config should be used, like the way to detect the job.

Shared memory generator file

a file that specify the form of the shared memory

one for c++ that creates the file and on created by this c++ program to inform the plugins how the memory looks

make it possible to only take a subset of the big telemetry easily or add new values

hi, can you help me with the code ?

i need a simple program (just to output data in the console)
but i dont know how to read data from the object.
this is my code.
can you give me an example of how to get data (create propper object and use it)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Ets2SdkClient;

namespace fdggdf
{

class Program
{
//Ets2SdkClient.Ets2SdkTelemetry Telemetry = new Ets2SdkClient.Ets2SdkTelemetry();
Ets2SdkClient.Ets2Telemetry._Physics a = new Ets2SdkClient.Ets2Telemetry._Physics();
Ets2SdkClient.Ets2Telemetry._Drivetrain b = new Ets2SdkClient.Ets2Telemetry._Drivetrain() ;

static void Main(string[] args)
{
Program P = new Program();

while (true)
{
float m = P.a.AccelerationZ;
float z = P.b.EngineRpmMax;
Console.WriteLine(m);
Console.WriteLine(z);
}

}
}

Update C# code

Best would be Net.core Standard etc. (for linux changes later)

try to make the convert class better debug-able

in some cases (mostly by directly setting debug points in the convert class) while debugging and continuing after an break point the code crashes because of the convert class. I will try to add some code only compiled while debug-mode is enabled to avoid these crashes hopefully.

Online Job is not working correctly

Describe the bug
Sure SDK currently doesn't correct report online jobs, but i think it's possible to detect them( have to test this)

To Reproduce
Start Online Contract

Expected behavior
Remaining Time should be a normal value
(may onjob doesn't fires have to check this. Last time it was an offset error)

Screenshots
no need for this

Demo Client Error

Hey,

First thank you for sdk1.9 and can you help me with this error please. I run debug mode and VS show me this error, but when run DemoClient.exe.. just close after few seconds when I click on my profile, before I click on my profile everything show on about tab.

System.ArgumentException: 'Requested value 'arcade ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ๏ฟฝ' was not found.'

value_arcade_error

Thank you.

Shared Memory update rate leads sometimes to crashes

Currently the shared memory is updated every 25ms.

I think through the big size of 32kB this time can be sometimes to short. In older release where the size was 16kB this problems happens less or never.

There are some idea in addition to #34 to avoid this problem, but i need to look around for good ways to handle fast refreshing shared memory files in c#.

One idea was to use 2 shared memory files, but i think it would be better only to use one file and update only a part with high frequency and the rest with a lower frequency.

When you have some good ideas or good knowledge in shared memory files in c# it would nice if you share some of your ideas. It would be nice to get the data in a high update rate in c# and avoid crashes on startup.

For dev_rework

correct the alt offspace something around the lights and later still not working

fuel range is not working? and gui show wrong rows instead iritating

fuel gosts and event

Is it possible to make a refueling event and
is it possible to get the fuel costs?

Is kniffen/TruckSim-Telemetry supported?

Hey,
First of all, I don't have any C or C# knowledge whatsoever. Please don't hate me for my dumb question.
Secondly, will this plugin work with https://github.com/kniffen/TruckSim-Telemetry ? There is an open issue on the repo asking for support of your project. It was opened 3 months ago and still not closed. I'm wondering if this plugin works with TruckSim-Telemetry the same way nlhans' plugin did.
Sorry for the badly formulated issue, I can't really express my thoughts in English well ๐Ÿ˜Œ. Have a great day.

update c++ project

update the c++ project
change code, update vc++ version to 2019, etc.

Think about performance

Some of the values are updated with higher frequency and some not, but to update the data at the moment the whole object is refreshed.

Think about ideas to get a better performance and deliver high update frequency of the changing values like speed, temperature etc. and a lower of the rest.

May with two shared memory's or some other Technics

linux support

create a working linux dll of the c++ code
and update projects c# code to c# standard -> linux + windows demo

New Feature: Refuel Event

Add new Event Refuel. Currently it will based on the last and the current fuel value. If it goes up it will be triggered. May it will contain a minimum threshold to avoid wrong calls. But i will test this.

When there is an update of the SDK that provides an refuel event it will change directly to that one.

Because it will not change the shared memory structure (that is what i think while i create the issue), it wont change the rev value. So it should be compatible with the current release of the Demo GUI and the coming update, however, the current release wont show the new event ๐Ÿ˜‰.
Full Version should be Rev 10 Update 2.

This feature issue will close #45. But wont add the costs features.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.