Skip to content

[assessment] Technical Assessment: Euro Truck Simulator 2 #29

Description

@github-actions

Related to: #24

Tracker ID: analysis-issue-24-ets2

Feasibility: HIGH

Complexity: LOW-MEDIUM

Executive Summary

Euro Truck Simulator 2 is an excellent candidate for GamesDat integration with a clear and well-documented integration path. SCS Software provides an official Telemetry SDK that exposes real-time game state through a shared memory interface, making this one of the most straightforward integrations possible.

Recommended Base Class

MemoryMappedFileSource(T) (located in GamesDat/Telemetry/Sources/MemoryMappedFileSource.cs)

Rationale:

  • ETS2's official Telemetry SDK exposes game state via shared memory (memory-mapped file)
  • This is the same pattern used by Trackmania (see TrackmaniaMemoryMappedSource.cs)
  • The SDK provides a C/C++ header defining the exact memory layout as structs
  • GamesDat's MemoryMappedFileSource(T) is specifically designed for this use case

Implementation Approach

1. Integration Type: Real-Time Telemetry via Shared Memory

ETS2 uses the SCS Telemetry SDK which provides:

  • Shared memory region with structured telemetry data
  • Real-time updates during gameplay (high frequency, typically 60Hz+)
  • Well-documented C/C++ struct definitions
  • No anti-cheat concerns (officially supported by developer)

2. Implementation Steps

Step 1: Define C# Telemetry Struct

The SDK provides C++ headers defining the exact memory layout. Example fields include:

  • Truck data: Speed, RPM, gear, fuel level, engine temperature, odometer, damage
  • Position data: GPS coordinates (X, Y, Z), rotation, heading
  • Job/Cargo data: Cargo weight, destination, job income, time remaining
  • Game state: Paused, time of day, game time

This needs to be translated to a C# struct with [StructLayout(LayoutKind.Sequential)] to match the memory layout exactly.

Step 2: Extend MemoryMappedFileSource(T)

public class ETS2TelemetrySource : MemoryMappedFileSource(ETS2TelemetryData)
{
    public const string TelemetryMapName = "Local\\SCSTelemetry"; // SDK-defined name
    
    public ETS2TelemetrySource(TimeSpan? pollInterval = null)
        : base(TelemetryMapName, pollInterval ?? TimeSpan.FromMilliseconds(16)) // ~60Hz
    {
    }
}

Step 3: Plugin Installation

Users must install the SCS Telemetry SDK plugin (a DLL) into the ETS2 plugins directory. This is a one-time setup step documented by SCS Software.

3. Data Available

The ETS2 Telemetry SDK exposes extremely rich data:

Vehicle Telemetry:

  • Speed (km/h, mph)
  • Engine RPM, gear (current, range)
  • Fuel level, capacity, consumption rate
  • Oil temperature, pressure
  • Water temperature
  • Battery voltage
  • Brake temperatures (all wheels)
  • Wheel speeds, suspension deflection
  • Wear/damage per component

Navigation & Position:

  • World coordinates (X, Y, Z)
  • Rotation (heading, pitch, roll)
  • Current city, country
  • GPS navigation data

Job & Economy:

  • Cargo weight, damage
  • Delivery destination
  • Job income, time limits
  • Remaining distance
  • Company reputation

Game State:

  • Game time (hours, minutes)
  • Time scale (accelerated time)
  • Paused state
  • Truck configuration

Blockers

None identified. However, there are important implementation notes:

Implementation Considerations

1. SDK Plugin Requirement

Users must install the SCS Telemetry SDK plugin DLL. This is:

  • ✅ Officially supported by SCS Software
  • ✅ Safe and non-invasive
  • ✅ Well-documented by the community
  • ⚠️ Manual installation step (not automatic)

Mitigation: Clear documentation and setup wizard in GamesDat to guide users through plugin installation.

2. Struct Layout Precision

The C# struct layout must exactly match the C++ memory layout provided by the SDK. Misalignment will cause:

  • Garbage data
  • Memory access violations
  • Crashes

Mitigation:

  • Use [StructLayout(LayoutKind.Sequential)] with explicit field offsets if needed
  • Reference existing community implementations (many open-source ETS2 telemetry apps exist)
  • Thorough testing across different game versions

3. SDK Version Compatibility

SCS Software may update the telemetry struct layout with game updates. This is rare but possible.

Mitigation:

  • Include SDK version field in telemetry data
  • Implement version detection and graceful degradation
  • Monitor SCS Software release notes

4. Game State Lifecycle

The shared memory region is only available when:

  • The plugin is installed
  • The game is running
  • A session is active (driving)

Mitigation:

  • Implement connection retry logic (already built into MemoryMappedFileSource)
  • Clear error messages when plugin is not detected

Open Questions

  1. Which struct version to target?

    • The SDK has evolved over multiple versions
    • Need to determine which version(s) to support
    • Consider supporting multiple versions with version detection
  2. American Truck Simulator compatibility?

    • ATS uses the same SDK with identical struct layout
    • Can we create a shared base class for both games?
    • Recommendation: Implement as a single source that works for both ETS2 and ATS
  3. Data sampling frequency?

    • What poll interval is optimal? (16ms = 60Hz is typical)
    • Should this be user-configurable?
  4. Coordinate system handling?

    • ETS2 uses a specific world coordinate system
    • Do we need to transform coordinates for analysis/visualization?

Implementation Notes

Complexity Breakdown

LOW Complexity:

  • Base class exists and is proven (Trackmania uses same pattern)
  • SDK is officially documented
  • No reverse engineering required
  • No anti-cheat concerns

MEDIUM Complexity:

  • C++ to C# struct translation requires precision
  • Plugin installation adds user setup friction
  • Struct versioning may require maintenance

Estimated Implementation Effort

Core Integration: 2-4 hours

  • Define C# telemetry struct from SDK headers
  • Create ETS2TelemetrySource class extending MemoryMappedFileSource(T)
  • Basic testing

Polish & Documentation: 2-3 hours

  • Setup documentation for SDK plugin installation
  • Error handling for missing plugin
  • User-facing configuration options

Testing: 2-3 hours

  • Test with actual game
  • Validate data accuracy
  • Test connection/disconnection scenarios

Total Estimate: 6-10 hours for a production-ready implementation

Synergy with American Truck Simulator

Since ATS uses the identical SDK, implementing ETS2 provides 90% of ATS support for free. Consider implementing both simultaneously with a shared base class:

public abstract class SCSGameTelemetrySource : MemoryMappedFileSource(SCSTelemData)
{
    // Shared implementation
}

public class ETS2TelemetrySource : SCSGameTelemetrySource { }
public class ATSTelemetrySource : SCSGameTelemetrySource { }

Reference Implementations

Many open-source projects have already implemented ETS2 telemetry in C#:

  • Funbit/ets2-telemetry-server (Node.js with C# bridge)
  • nlhans/ets2-sdk-plugin (C# examples)
  • Various Streamdeck/Simhub plugins

These can serve as references for struct layout validation.

Risk Assessment

Technical Risk: ⚠️ LOW

  • Well-documented SDK
  • Proven integration pattern in GamesDat
  • Active community support

Maintenance Risk: ⚠️ LOW-MEDIUM

  • Game updates may change struct layout (rare)
  • SDK plugin must stay compatible with game versions
  • Monitor SCS Software release cycle

User Experience Risk: ⚠️ MEDIUM

  • Manual plugin installation is a friction point
  • Users must understand how to install DLLs
  • Clear error messages critical

Recommendation

Proceed with high confidence. Euro Truck Simulator 2 is one of the best candidates for GamesDat integration:

✅ Official SDK support
✅ Proven integration pattern (MemoryMappedFileSource)
✅ Rich telemetry data
✅ No anti-cheat concerns
✅ Large, dedicated player base
✅ Synergy with American Truck Simulator

Priority: Should be in the first wave of new game integrations due to low complexity and high success probability.

Suggested Pairing: Implement ETS2 and ATS together as a package deal (minimal additional effort).

Next Steps

  1. ✅ Technical assessment complete (this issue)
  2. ⏳ UX assessment (separate workflow, in progress)
  3. ⏳ Download and study SCS Telemetry SDK headers
  4. ⏳ Create proof-of-concept C# struct definition
  5. ⏳ Create implementation issue if approved

AI generated by Development Feasibility Agent

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions