Skip to main content
The Client.System namespace contains core engine systems that support the entire game client.

Framework

Framework Singleton

The main game framework that coordinates all systems. Struct Layout:
// Client::System::Framework::Framework
[StructLayout(LayoutKind.Explicit, Size = 0x35D8)]
public unsafe partial struct Framework {
    [FieldOffset(0x0008)] public bool IsDestroying;
    [FieldOffset(0x0009)] public bool IsExiting;
    [FieldOffset(0x000A)] public bool IsFreed;
    [FieldOffset(0x000C)] public int ExitCode;
    [FieldOffset(0x0010)] public SystemConfig SystemConfig;
    [FieldOffset(0x0460)] public DevConfig DevConfig;
    [FieldOffset(0x0580)] public byte ClientLanguage;
    [FieldOffset(0x0581)] public byte Region;
    
    // Input
    [FieldOffset(0x07B0)] public GamepadInputData GamepadInputs;
    [FieldOffset(0x09FC)] public CursorInputData CursorInputs;
    [FieldOffset(0x0A2C)] public KeyboardInputData KeyboardInputs;
    
    // Network
    [FieldOffset(0x1678)] public NetworkModuleProxy* NetworkModuleProxy;
    [FieldOffset(0x1680)] public bool IsNetworkModuleInitialized;
    
    // Timing
    [FieldOffset(0x16C0)] public float FrameDeltaTime;
    [FieldOffset(0x16C4)] public float RealFrameDeltaTime;
    [FieldOffset(0x16D0)] public uint FrameCounter;
    [FieldOffset(0x17CC)] public float FrameRate;
    
    // Modules
    [FieldOffset(0x2B38)] public ExcelModuleInterface* ExcelModuleInterface;
    [FieldOffset(0x2B40)] public ExdModule* ExdModule;
    [FieldOffset(0x2B68)] public UIModule* UIModule;
    [FieldOffset(0x2B88)] public SoundManager* SoundManager;
}
Singleton Access:
var framework = Framework.Instance();
Key Methods (Virtual):
  • Setup() - VF1: Initialize framework
  • Destroy() - VF2: Destroy framework
  • Free() - VF3: Free resources
  • Tick() - VF4: Main frame tick
  • GetUIModule() - Get UI module
Usage Example:
var fw = Framework.Instance();

// Check timing
var deltaTime = fw->FrameDeltaTime;
var fps = fw->FrameRate;
Console.WriteLine($"FPS: {fps:F1}, Delta: {deltaTime:F4}s");

// Access modules
var uiModule = fw->GetUIModule();
var soundManager = fw->SoundManager;

// Check client state
if (fw->IsExiting) {
    Console.WriteLine("Game is exiting");
}

ClientTime

Eorzea and real time tracking.
var framework = Framework.Instance();
var clientTime = &framework->ClientTime;

var eorzeaTime = clientTime->EorzeaTime;
var localTime = clientTime->LocalTime;

Resource System

ResourceManager

Manages loading and caching of game resources. Struct Layout:
// Client::System::Resource::ResourceManager
[StructLayout(LayoutKind.Explicit, Size = 0x1728)]
public unsafe partial struct ResourceManager {
    [FieldOffset(0x8)] public ResourceGraph* ResourceGraph;
}
Singleton Access:
var resourceManager = ResourceManager.Instance();
Key Methods:
  • GetResourceSync(ResourceCategory*, uint*, uint*, byte*, void*) - Load resource synchronously
  • GetResourceAsync(ResourceCategory*, uint*, uint*, byte*, void*, bool) - Load resource asynchronously
  • FindResourceHandle(ResourceCategory*, uint*, uint*) - Find loaded resource
Resource Categories:
public enum ResourceCategory {
    Common = 0,
    BgCommon = 1,
    Bg = 2,
    Cut = 3,
    Chara = 4,
    Shader = 5,
    Ui = 6,
    Sound = 7,
    Vfx = 8,
    UiScript = 9,
    Exd = 10,
    GameScript = 11,
    Music = 12,
    SqpackTest = 18,
    Debug = 19,
}
Usage Example:
var rm = ResourceManager.Instance();

// Load a UI texture
var category = ResourceCategory.Ui;
var type = 0u;
var hash = 0u;
var path = "ui/icon/000000/000001.tex";

var handle = rm->GetResourceSync(&category, &type, &hash, path, null);
if (handle != null) {
    // Resource loaded
}

Memory System

Memory Management

The game uses a custom memory management system. IMemorySpace - Memory allocation interface
public unsafe partial struct IMemorySpace {
    // Virtual functions for allocation
}
Usage:
// Memory allocation is typically handled internally
// Use with caution for custom allocations

Configuration

SystemConfig

System-level configuration.
var framework = Framework.Instance();
var sysConfig = &framework->SystemConfig;

// Access configuration values

DevConfig

Development configuration (available in some builds).
var framework = Framework.Instance();
var devConfig = &framework->DevConfig;

File System

FileAccessPath

Manages file paths for configuration and user data.
var framework = Framework.Instance();
var configPath = &framework->ConfigPath;

// Access paths
var gamePath = framework->GamePath;
var userPath = framework->UserPath;

Input System

Keyboard Input

var framework = Framework.Instance();
var keyboard = &framework->KeyboardInputs;

// Check key states
for (int i = 0; i < 256; i++) {
    if (keyboard->IsKeyDown(i)) {
        Console.WriteLine($"Key {i} is down");
    }
}

Mouse/Cursor Input

var framework = Framework.Instance();
var cursor = &framework->CursorInputs;

var mouseX = cursor->X;
var mouseY = cursor->Y;
var mouseButtons = cursor->Buttons;

Gamepad Input

var framework = Framework.Instance();
var gamepad = &framework->GamepadInputs;

// Check gamepad state
if (gamepad->IsConnected) {
    var buttons = gamepad->Buttons;
    var leftStickX = gamepad->LeftStickX;
    var leftStickY = gamepad->LeftStickY;
}

Task System

TaskManager

Manages asynchronous tasks.
var framework = Framework.Instance();
var taskManager = &framework->TaskManager;

// Task management is typically internal

Timer System

TimePoint

Represents a point in time.
var framework = Framework.Instance();
var utcTime = framework->UtcTime;

Performance Counter

var framework = Framework.Instance();
var perfCounter = framework->PerformanceCounterValue;
var perfFrequency = framework->PerformanceCounterFrequency;

// Calculate elapsed time
var seconds = (double)perfCounter / perfFrequency;

Common Patterns

Frame Timing

var fw = Framework.Instance();

// Get frame information
var frameCount = fw->FrameCounter;
var deltaTime = fw->FrameDeltaTime;
var realDelta = fw->RealFrameDeltaTime;

// Check if time is paused (e.g., in message box)
if (fw->PauseFrameTicksCounter > 0) {
    // Time is paused
}

Accessing Core Modules

var fw = Framework.Instance();

// UI
var uiModule = fw->UIModule;
if (uiModule != null) {
    // Use UI module
}

// Sound
var soundMgr = fw->SoundManager;
if (soundMgr != null) {
    // Control audio
}

// Excel data
var excelModule = fw->ExcelModuleInterface;
if (excelModule != null) {
    // Access game data
}

Client Language and Region

var fw = Framework.Instance();

var language = fw->ClientLanguage;
var region = fw->Region;

Console.WriteLine($"Language: {language}, Region: {region}");

Game Version

var fw = Framework.Instance();
var version = fw->GameVersion;

// Check expansion versions
var exVersions = fw->ExVersions;
// 0: Heavensward
// 1: Stormblood
// 2: Shadowbringers
// 3: Endwalker
// 4: Dawntrail

Steam Integration

var fw = Framework.Instance();

if (fw->IsSteamGame) {
    var steamApi = fw->SteamApi;
    if (steamApi != null) {
        // Use Steam API
    }
}

See Also

Build docs developers (and LLMs) love