Skip to content

v1.2.5

Choose a tag to compare

@TrackAndTruckDevs TrackAndTruckDevs released this 03 Oct 01:24
· 44 commits to main since this release

SPF Framework v1.2.5

GitHub Release GitHub Release

📥 For Users: Download Pre-built Binary

  1. Download the spf-framework_*.zip archive from the releases.

  2. Extract all contents of the archive into your game's plugins folder:
    <YOUR_GAME>\bin\win_x64\plugins\

    For example, if your game is installed at C:\Program Files (x86)\Steam\steamapps\common\American Truck Simulator, the final path would be:
    C:\Program Files (x86)\Steam\steamapps\common\American Truck Simulator\bin\win_x64\plugins\

  3. The resulting directory structure should look like this:

[Game Root Directory]
└───bin
    └───win_x64
        └───plugins
            │   spf-framework.dll
            ├───spfAssets
            │   └───localization
            │           en.json
            │           *.json
            │           ....
            └───spfPlugins

🛠️ For Developers: Build from Source

If you want to customize the framework or contribute to its development, you can build it yourself using CMake. We support both Visual Studio and Ninja generators.

Quick Build (Ninja):

git clone https://github.com/TrackAndTruckDevs/SPF-Framework.git
cd SPF-Framework
cmake -B build -G "Ninja" -DCMAKE_BUILD_TYPE=Release
cmake --build build

For detailed build instructions, including automatic deployment to your game folder, please refer to our README.md.


🧪 Example Plugin: Pre-compiled API Demonstration

For those who want to see the framework in action immediately, we provide a pre-compiled Example Plugin. This is a ready-to-use DLL that demonstrates the core capabilities of the SPF API (Telemetry, Camera control, Custom UI, Vehicle monitoring, etc.).

Installation:

  1. Navigate to your game's directory: [Game Root]\bin\win_x64\plugins\spfPlugins\.
  2. Extract the ExamplePlugin folder from the downloaded archive directly into this folder.

Correct directory structure:

[Game Root Directory]
└── bin/win_x64/plugins/
    ├── spf-framework.dll
    ├── spfAssets/
    └── spfPlugins/
        └── ExamplePlugin/
            ├── ExamplePlugin.dll
            └── localization/

For Developers:
The source code of this plugin is the ultimate reference for learning how to use the SPF API. Explore the implementation and see how each system is integrated:
👉 ExamplePlugin Source Code

Note: This is a compiled demonstration plugin intended for testing and development purposes. It does not provide gameplay features for regular users.


📦 Developer Resources & API Documentation

To start creating your own SPF-compatible plugins, use the resources:

Downloadable Assets:

  • spf-framework_v1.2.5.zip — The framework itself (DLL and localization).
  • SPF_API_v1.2.5.zip — All necessary C headers for your project.
  • MyPlugin_Template_v1.2.5.zip — A complete, ready-to-compile plugin template.
  • ExamplePlugin_v1.2.5.zip — A pre-compiled, ready-to-use demonstration plugin.

🛠️ Developer Tools & Helpers

  • SPF Ghidra Pattern Helper — A Ghidra script designed to quickly generate and test byte signatures. It supports SPF-style templates and advanced search syntax, greatly easing plugin development for American Truck Simulator and Euro Truck Simulator 2.

📝 What's New in this Release

SPF Framework v1.2.5

🔊 Sound API — Production Release

Warning

This is a production release of the Sound API. The ABI has changed compared to previous beta versions. If you used the old Sound API in your plugins, you must rebuild them against the new API headers — the new SPF_Sound_API.h is not binary-compatible with the beta. Only the Sound API ABI is affected; other plugin APIs remain stable.

  • Rebuilt Interception Layer: The FMOD interception is now built on event-instance detours (start/stop/create/release/setVolume/setPitch) with a path resolver backed by game per-bank data, plus bank load/unload hooks and an activity callback.
  • Game Event Control API: New SND_GameEvent_* API for full control over live game sound events.
  • Per-Event Overrides: SND_OverrideEvent{Pitch,Volume} and SND_SuppressEventPlayback let you override pitch, volume, or fully suppress playback of any event — with suppression-counter driven flow (no instance tracking needed).
  • SoundRef Replacement: New SND_SoundRef_Replace to swap sound sources at runtime.
  • SND_LoadBankMemory: Load banks directly from memory.
  • Activity Callback: SND_SetActivityCallback reports sound activity to plugins in real time.

🔀 SoundRef Catalog & Override API

  • SoundRef Snapshot Catalog: SoundService now exposes a snapshot catalog of sound references across UI/VN/RDATA/VFS/LIVE origins with O(1) cached lookups.
  • Override API: SND_RegisterSoundRefOverride / SND_UnregisterSoundRefOverride / SND_ClearSoundRefOverrides / SND_GetSoundRefOverride, plus live-event rebind via SoundRef_LoadConfig + SystemUpdate hooks.
  • New SoundRef Tab in Sound Window: Browse path/source/category/origin/enabled for every soundref.

📂 Plugin VFS Mount API

  • Env_VfsMount / Env_VfsUnmount: Mount your plugin directory under /spf/<PluginName> with per-pool priority ordering (higher = resolved earlier).
  • Mount Enumeration: Env_VfsGetMountCount / Env_VfsGetMountAt + SPF_VfsMountInfo for a flat view of all live UFS mounts.
  • Auto-Unmount: Plugin mounts are cleaned up automatically on plugin unload. New VFS tab in the info window.

🎥 Interior Camera Fix

  • Camera Object Replacement: Fixed the game swapping the active camera's underlying object without changing its type (e.g. switching trucks in the interior view) — writes now correctly target the new object.
    • Thanks to aefly! — #14

⌨️ Reliable Key Blocking for Plugins

  • DirectInput Blocking: Block keyboard input from DirectInput by masking blocked keys in GetDeviceState/GetDeviceData; unified input state locking under InputManager.
  • Layout-Aware DIK Mapping: DIK codes now map to the foreground window's keyboard layout (per-thread layouts fixed).
  • Persistent Keybind Settings: Binding settings are preserved on rebind, and programmaticallyBlocked state survives config reloads.
    • Thanks to aefly! — #13

🔹 Miscellaneous

  • Added MotionCab to the plugin list.
  • Various minor bug fixes and stability improvements.

🔒 Security Verification

Every binary in this release was scanned on VirusTotal before publication.
Scan results are tied to the exact SHA-256 of each file — you can verify them independently.

File SHA-256 VirusTotal
spf-framework.dll 92b98aacb6cf1099b7cc218438c680ef92d32dbaba09d2b474e640ebb25eb1d6 clean
ExamplePlugin.dll e13bdc85049799b5a8ab9fabca6035655a41b0568bd5fa22913037dfa06cfeb9 70/71 clean, 1 false positive

If your Windows SmartScreen or Smart App Control blocks a download despite a clean verdict above, this is a known issue with unsigned open-source binaries. The files are safe.


Developed with ❤️ by Track & Truck Devs. Support us on Patreon to help us keep the project growing!