TeamVanilla Workshop

SF1SDK

SF1SDK is a C++23 SDK for Soldier Front 1, companion to the encyclopedia. Unverified values are declared but return an error instead of a guess.

On this page 3

SF1SDK is a C++23 SDK for Soldier Front 1, companion to SFEncyclopedia. It gives you typed access to the game's data formats and runtime structures, with one rule: unverified values are declared but return an error instead of a guess. If the encyclopedia marks a field open, the SDK makes you handle that uncertainty at compile time rather than handing back a number that might be wrong.

#include <sf1sdk/sf1sdk.hpp>
using namespace sf1sdk;

void on_attach() {
    Module::bind();                                   // rebase for ASLR
    auto players = sf1::player_list();                // typed entity list
    for (auto& p : players)
        if (p.team() == Team::Blue) { /* ... */ }
}

The data library

Plain C++23 with no dependencies beyond the standard library. Each reader was checked against the retail Soldier Front client files:

ReaderReadsChecked against retail
MapArchiveMap geometry, spawn points, collision volumes, lighting dataVerified against retail map files
ModelFilePlayer and weapon models: meshes, skeleton, LODsVertex and bone counts matched
DataTableWeapon stats, item definitions, shop entriesValues cross-checked with in-game behaviour
PacketFrameNetwork packet framing and field layoutRound-trip tested against captured traffic

The runtime layer

The struct database is generated from the encyclopedia's verified tables. Every struct carries a static_assert on its size, so a mismatch is a compile error. Fields the encyclopedia marks open are present in the struct but accessing them returns Result<T> with an error explaining why the value is not yet confirmed, rather than silently returning a number that might be wrong.

// typed globals, rebased automatically
auto& local = sf1::local_player();
auto  hp    = local.health();             // verified field: returns int
auto  unk   = local.field_0x4C();         // open field: returns Result<int>

Adding it to a project

The runtime layer is header-only: add include/ to your include path and build a 32-bit DLL, since the retail client is x86. The data library is a small static library that works on any host.

target_include_directories(my_mod PRIVATE ${SF1SDK_DIR}/include)

add_subdirectory(${SF1SDK_DIR} sf1sdk)
target_link_libraries(my_mod PRIVATE SF1SDK::game)   # or SF1SDK::data for files