Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Shared Types

This page documents all the data types used in the RPFM server protocol. These types appear as parameters in Commands and as payloads in Responses.

All types are serialized as JSON. Nullable fields use null when absent.


Core Types

DataSource

Discriminates where file data originates from. Serialized as a plain string.

ValueDescription
"PackFile"An open Pack file
"GameFiles"Vanilla game files
"ParentFiles"Parent mod files
"AssKitFiles"Assembly Kit files
"ExternalFile"External file on disk
type DataSource = "PackFile" | "GameFiles" | "ParentFiles" | "AssKitFiles" | "ExternalFile";
// Serialize as a plain string — idiomatic C# is an enum with [JsonStringEnumConverter]:
public enum DataSource
{
    PackFile,
    GameFiles,
    ParentFiles,
    AssKitFiles,
    ExternalFile,
}

ContainerPath

A file or folder path within a Pack. Serialized as a tagged enum:

{ "File": "db/units_tables/data" }
{ "Folder": "db/units_tables" }
type ContainerPath =
  | { File: string }
  | { Folder: string };
// Serialize as either { "File": "..." } or { "Folder": "..." }:
public abstract class ContainerPath { }
public class ContainerPathFile   : ContainerPath { public string File { get; set; } }
public class ContainerPathFolder : ContainerPath { public string Folder { get; set; } }

RFileInfo

Metadata about a packed file within a container.

FieldTypeDescription
pathstringInternal path within the Pack
container_namestring or nullName of the containing Pack (null if unknown)
timestampnumber or nullLast modification timestamp
file_typestringFile type enum value (e.g. "DB", "Loc", "Text")
interface RFileInfo {
  path: string;
  container_name: string | null;
  timestamp: number | null;
  file_type: string;
}
public class RFileInfo
{
    public string Path { get; set; }
    public string? ContainerName { get; set; }
    public long? Timestamp { get; set; }
    public string FileType { get; set; }
}

ContainerInfo

Reduced representation of a Pack file (container-level metadata).

FieldTypeDescription
file_namestringName of the Pack file
file_pathstringFull path to the Pack file on disk
pfh_versionPFHVersionPFH format version
pfh_file_typePFHFileTypePack file type
bitmaskPFHFlagsPFH flags bitmask (u32)
compressCompressionFormatCompression format
timestampnumberPack file timestamp (Unix epoch)
interface ContainerInfo {
  file_name: string;
  file_path: string;
  pfh_version: PFHVersion;
  pfh_file_type: PFHFileType;
  bitmask: PFHFlags;
  compress: CompressionFormat;
  timestamp: number;
}
public class ContainerInfo
{
    public string FileName { get; set; }
    public string FilePath { get; set; }
    public PFHVersion PfhVersion { get; set; }
    public PFHFileType PfhFileType { get; set; }
    public PFHFlags Bitmask { get; set; }
    public CompressionFormat Compress { get; set; }
    public ulong Timestamp { get; set; }
}

DependenciesInfo

Information about loaded dependency files, used to populate dependency tree views.

FieldTypeDescription
asskit_tablesRFileInfo[]Assembly Kit table files
vanilla_packed_filesRFileInfo[]Vanilla game files
parent_packed_filesRFileInfo[]Parent mod files
interface DependenciesInfo {
  asskit_tables: RFileInfo[];
  vanilla_packed_files: RFileInfo[];
  parent_packed_files: RFileInfo[];
}
public class DependenciesInfo
{
    public List<RFileInfo> AsskitTables { get; set; }
    public List<RFileInfo> VanillaPackedFiles { get; set; }
    public List<RFileInfo> ParentPackedFiles { get; set; }
}

SessionInfo

Information about an active session on the server. Returned by the GET /sessions REST endpoint.

FieldTypeDescription
session_idnumberUnique session identifier
connection_countnumberNumber of active WebSocket connections
timeout_remaining_secsnumber or nullSeconds until timeout (null if connections exist)
is_shutting_downbooleanWhether the session is shutting down
pack_namesstring[]Names of the open packs
interface SessionInfo {
  session_id: number;
  connection_count: number;
  timeout_remaining_secs: number | null;
  is_shutting_down: boolean;
  pack_names: string[];
}
public class SessionInfo
{
    public int SessionId { get; set; }
    public int ConnectionCount { get; set; }
    public double? TimeoutRemainingSecs { get; set; }
    public bool IsShuttingDown { get; set; }
    public List<string> PackNames { get; set; }
}

File Types

NewFile

Parameters for creating a new packed file. Serialized as a tagged enum — the variant name determines the file type:

VariantPayloadDescription
AnimPackstringFile name
DB[string, string, number][file_name, table_name, version]
LocstringTable name
PortraitSettings[string, number, [string, string][]][name, version, clone_entries]
Text[string, string][file_name, text_format]
VMDstringFile name
WSModelstringFile name

Example:

{ "DB": ["my_table", "units_tables", 4] }
{ "Text": ["script.lua", "Lua"] }
type NewFile =
  | { AnimPack: string }
  | { DB: [string, string, number] }
  | { Loc: string }
  | { PortraitSettings: [string, number, [string, string][]] }
  | { Text: [string, string] }
  | { VMD: string }
  | { WSModel: string };
// Tagged-enum payload — one class per variant:
public abstract class NewFile { }
public class NewFileAnimPack : NewFile { public string AnimPack { get; set; } }
public class NewFileDB : NewFile { public Tuple<string, string, int> DB { get; set; } }
public class NewFileLoc : NewFile { public string Loc { get; set; } }
public class NewFilePortraitSettings : NewFile
{
    public Tuple<string, uint, List<Tuple<string, string>>> PortraitSettings { get; set; }
}
public class NewFileText : NewFile { public Tuple<string, string> Text { get; set; } }  // second is TextFormat enum
public class NewFileVMD : NewFile { public string VMD { get; set; } }
public class NewFileWSModel : NewFile { public string WSModel { get; set; } }

VideoInfo

Metadata specific to video files.

FieldTypeDescription
formatstringVideo format enum value
versionnumberVideo format version
codec_four_ccstringCodec FourCC identifier
widthnumberVideo width in pixels
heightnumberVideo height in pixels
num_framesnumberTotal number of frames
frameratenumberFrames per second
interface VideoInfo {
  format: string;
  version: number;
  codec_four_cc: string;
  width: number;
  height: number;
  num_frames: number;
  framerate: number;
}
public class VideoInfo
{
    public string Format { get; set; }
    public int Version { get; set; }
    public string CodecFourCc { get; set; }
    public int Width { get; set; }
    public int Height { get; set; }
    public int NumFrames { get; set; }
    public double Framerate { get; set; }
}

FileType

Identifies the type of a packed file. Serialized as a plain string:

ValueDescription
"Anim"Animation file
"AnimFragmentBattle"Battle animation fragment
"AnimPack"Animation pack
"AnimsTable"Animation table
"Atlas"Sprite sheet atlas
"Audio"Audio file
"BMD"Battle map data
"BMDVegetation"Battle map vegetation data
"Dat"Generic data file
"DB"Database table
"ESF"Empire Save Format
"Font"Font file
"GroupFormations"Group formations
"HlslCompiled"Compiled HLSL shader
"Image"Image file (DDS, PNG, etc.)
"Loc"Localisation file
"MatchedCombat"Matched combat animations
"Pack"Nested Pack file
"PortraitSettings"Portrait settings
"RigidModel"3D model file
"SoundBank"Sound bank
"Text"Text file (Lua, XML, JSON, etc.)
"UIC"UI Component
"UnitVariant"Unit variant
"Video"Video file (CA_VP8)
"VMD"VMD text file
"WSModel"WSModel text file
"Unknown"Unrecognized file type
type FileType =
  | "Anim" | "AnimFragmentBattle" | "AnimPack" | "AnimsTable" | "Atlas" | "Audio"
  | "BMD" | "BMDVegetation" | "Dat" | "DB" | "ESF" | "Font" | "GroupFormations"
  | "HlslCompiled" | "Image" | "Loc" | "MatchedCombat" | "Pack" | "PortraitSettings"
  | "RigidModel" | "SoundBank" | "Text" | "UIC" | "UnitVariant" | "Video" | "VMD"
  | "WSModel" | "Unknown";
public enum FileType
{
    Anim, AnimFragmentBattle, AnimPack, AnimsTable, Atlas, Audio,
    BMD, BMDVegetation, Dat, DB, ESF, Font, GroupFormations,
    HlslCompiled, Image, Loc, MatchedCombat, Pack, PortraitSettings,
    RigidModel, SoundBank, Text, UIC, UnitVariant, Video, VMD,
    WSModel, Unknown,
}

CompressionFormat

Compression format for Pack files. Serialized as a plain string:

ValueDescription
"None"No compression
"Lzma1"LZMA1 compression
"Lz4"LZ4 compression
"Zstd"Zstandard compression
type CompressionFormat = "None" | "Lzma1" | "Lz4" | "Zstd";
public enum CompressionFormat { None, Lzma1, Lz4, Zstd }

PFHFileType

Pack file type. Serialized as a plain string:

ValueDescription
"Boot"Boot Pack
"Release"Release Pack
"Patch"Patch Pack
"Mod"Mod Pack
"Movie"Movie Pack
type PFHFileType = "Boot" | "Release" | "Patch" | "Mod" | "Movie";
public enum PFHFileType { Boot, Release, Patch, Mod, Movie }

PFHVersion

PFH (Pack file header) format version. Serialized as a plain string:

ValueDescription
"PFH0"Original format (Empire / Napoleon era)
"PFH2"Shogun 2 era
"PFH3"Rome 2 era
"PFH4"Attila / Warhammer era
"PFH5"Warhammer 2 / Three Kingdoms era
"PFH6"Warhammer 3 / Pharaoh / current era
type PFHVersion = "PFH0" | "PFH2" | "PFH3" | "PFH4" | "PFH5" | "PFH6";
public enum PFHVersion { PFH0, PFH2, PFH3, PFH4, PFH5, PFH6 }

PFHFlags

Pack file header flags. Serialized as a single integer (a u32 bitmask) with these bits:

BitFlagMeaning
0x0000_0100HAS_EXTENDED_HEADERPack has an extended header
0x0000_0080HAS_ENCRYPTED_INDEXThe file index is encrypted
0x0000_0040HAS_INDEX_WITH_TIMESTAMPSIndex entries include timestamps
0x0000_0010HAS_ENCRYPTED_DATAFile data is encrypted
// Raw u32 on the wire. Use bitwise-and against the constants to test flags.
type PFHFlags = number;

const PFH_HAS_EXTENDED_HEADER      = 0x0000_0100;
const PFH_HAS_ENCRYPTED_INDEX      = 0x0000_0080;
const PFH_HAS_INDEX_WITH_TIMESTAMPS = 0x0000_0040;
const PFH_HAS_ENCRYPTED_DATA       = 0x0000_0010;
[Flags]
public enum PFHFlags : uint
{
    None = 0,
    HasExtendedHeader      = 0x0000_0100,
    HasEncryptedIndex      = 0x0000_0080,
    HasIndexWithTimestamps = 0x0000_0040,
    HasEncryptedData       = 0x0000_0010,
}

SupportedFormats

Video container format. Serialized as a plain string:

ValueDescription
"CaVp8"Creative Assembly’s CA_VP8 container
"Ivf"Standard VP8 IVF container
type SupportedFormats = "CaVp8" | "Ivf";
public enum SupportedFormats { CaVp8, Ivf }

OperationalMode

Per-pack operational mode, controlling MyMod behaviour. Serialized as a tagged enum:

VariantPayloadDescription
MyMod[string, string][game_folder_name, mymod_pack_name]
Normal(none)Normal mode, no MyMod association

Example:

{ "MyMod": ["warhammer_2", "my_mymod.pack"] }
"Normal"
type OperationalMode =
  | { MyMod: [string, string] }
  | "Normal";
// Serialize as either { "MyMod": [string, string] } or the string "Normal".
public abstract class OperationalMode { }
public class OperationalModeMyMod : OperationalMode
{
    public string GameFolder { get; set; }
    public string MyModPackName { get; set; }
}
public class OperationalModeNormal : OperationalMode { }

Data Types

DecodedData

Cell data in a table. Serialized as a tagged enum — the variant name indicates the data type:

VariantPayloadDescription
BooleanbooleanBoolean value
F32number32-bit float
F64number64-bit float
I16number16-bit integer
I32number32-bit integer
I64number64-bit integer
ColourRGBstringRGB colour string
StringU8stringUTF-8 string
StringU16stringUTF-16 string
OptionalI16numberOptional 16-bit integer
OptionalI32numberOptional 32-bit integer
OptionalI64numberOptional 64-bit integer
OptionalStringU8stringOptional UTF-8 string
OptionalStringU16stringOptional UTF-16 string
SequenceU16number[]Raw bytes for a nested sequence (u16-prefixed count)
SequenceU32number[]Raw bytes for a nested sequence (u32-prefixed count)

Example:

{ "StringU8": "hello" }
{ "I32": 42 }
{ "Boolean": true }
type DecodedData =
  | { Boolean: boolean }
  | { F32: number } | { F64: number }
  | { I16: number } | { I32: number } | { I64: number }
  | { ColourRGB: string }
  | { StringU8: string } | { StringU16: string }
  | { OptionalI16: number } | { OptionalI32: number } | { OptionalI64: number }
  | { OptionalStringU8: string } | { OptionalStringU16: string }
  | { SequenceU16: number[] } | { SequenceU32: number[] };
// Tagged-enum — one class per variant. Branch on the JSON key.
public abstract class DecodedData { }
public class DecodedDataBoolean         : DecodedData { public bool Boolean { get; set; } }
public class DecodedDataF32             : DecodedData { public float F32 { get; set; } }
public class DecodedDataF64             : DecodedData { public double F64 { get; set; } }
public class DecodedDataI16             : DecodedData { public short I16 { get; set; } }
public class DecodedDataI32             : DecodedData { public int I32 { get; set; } }
public class DecodedDataI64             : DecodedData { public long I64 { get; set; } }
public class DecodedDataColourRGB       : DecodedData { public string ColourRGB { get; set; } }
public class DecodedDataStringU8        : DecodedData { public string StringU8 { get; set; } }
public class DecodedDataStringU16       : DecodedData { public string StringU16 { get; set; } }
public class DecodedDataOptionalI16     : DecodedData { public short OptionalI16 { get; set; } }
public class DecodedDataOptionalI32     : DecodedData { public int OptionalI32 { get; set; } }
public class DecodedDataOptionalI64     : DecodedData { public long OptionalI64 { get; set; } }
public class DecodedDataOptionalStringU8 : DecodedData { public string OptionalStringU8 { get; set; } }
public class DecodedDataOptionalStringU16: DecodedData { public string OptionalStringU16 { get; set; } }
public class DecodedDataSequenceU16     : DecodedData { public byte[] SequenceU16 { get; set; } }
public class DecodedDataSequenceU32     : DecodedData { public byte[] SequenceU32 { get; set; } }

TableInMemory

In-memory table data structure used by DB and Loc files.

FieldTypeDescription
table_namestringTable type identifier (e.g. "units_tables")
definitionDefinitionSchema definition for this table
definition_patchDefinitionPatchRuntime schema modifications
table_dataDecodedData[][]Row data (outer = rows, inner = columns)
alteredbooleanWhether data was altered during decoding
interface TableInMemory {
  table_name: string;
  definition: Definition;
  definition_patch: DefinitionPatch;
  table_data: DecodedData[][];
  altered: boolean;
}
public class TableInMemory
{
    public string TableName { get; set; }
    public Definition Definition { get; set; }
    public DefinitionPatch DefinitionPatch { get; set; }
    public List<List<DecodedData>> TableData { get; set; }
    public bool Altered { get; set; }
}

RFile

A raw packed file.

FieldTypeDescription
pathstringPath of the file within a container
timestampnumber or nullLast modified timestamp (Unix epoch)
file_typeFileTypeDetected or specified file type
container_namestring or nullName of the source container
dataunknownInternal data storage
interface RFile {
  path: string;
  timestamp: number | null;
  file_type: FileType;
  container_name: string | null;
  data: unknown;
}
public class RFile
{
    public string Path { get; set; }
    public long? Timestamp { get; set; }
    public FileType FileType { get; set; }
    public string? ContainerName { get; set; }
    public object Data { get; set; }
}

RFileDecoded

Decoded file content. Serialized as a tagged enum — the variant name indicates the file type. See Decoded File Types for each type’s structure.

Variants: Anim, AnimFragmentBattle, AnimPack, AnimsTable, Atlas, Audio, BMD, BMDVegetation, Dat, DB, ESF, Font, GroupFormations, HlslCompiled, Image, Loc, MatchedCombat, Pack, PortraitSettings, RigidModel, SoundBank, Text, UIC, UnitVariant, Unknown, Video, VMD, WSModel.

Example:

{ "DB": { "mysterious_byte": true, "guid": "", "table": { ... } } }
{ "Text": { "encoding": "Utf8Bom", "format": "Lua", "contents": "-- script" } }
// One variant per known file type. Most carry the decoded type described below;
// a handful (VMD, WSModel) wrap a Text payload.
type RFileDecoded =
  | { Anim: unknown } | { AnimFragmentBattle: AnimFragmentBattle }
  | { AnimPack: unknown } | { AnimsTable: AnimsTable }
  | { Atlas: Atlas } | { Audio: Audio }
  | { BMD: Bmd } | { BMDVegetation: unknown }
  | { Dat: unknown } | { DB: DB }
  | { ESF: ESF } | { Font: unknown }
  | { GroupFormations: GroupFormations } | { HlslCompiled: unknown }
  | { Image: Image } | { Loc: Loc }
  | { MatchedCombat: MatchedCombat } | { Pack: unknown }
  | { PortraitSettings: PortraitSettings } | { RigidModel: RigidModel }
  | { SoundBank: unknown } | { Text: Text }
  | { UIC: UIC } | { UnitVariant: UnitVariant }
  | { Unknown: unknown } | { Video: unknown }
  | { VMD: Text } | { WSModel: Text };
// Tagged enum — one wrapper class per variant. Only the most common ones shown.
public abstract class RFileDecoded { }
public class RFileDecodedDB : RFileDecoded { public DB DB { get; set; } }
public class RFileDecodedLoc : RFileDecoded { public Loc Loc { get; set; } }
public class RFileDecodedText : RFileDecoded { public Text Text { get; set; } }
public class RFileDecodedImage : RFileDecoded { public Image Image { get; set; } }
public class RFileDecodedRigidModel : RFileDecoded { public RigidModel RigidModel { get; set; } }
// ... one class per variant listed in the enum above.

TableReferences

Reference data for a column, used by lookup/autocomplete features.

FieldTypeDescription
field_namestringName of the column these references are for
referenced_table_is_ak_onlybooleanWhether the referenced table only exists in the AK
referenced_column_is_localisedbooleanWhether the referenced column is localised
dataRecord<string, string>Map of actual values to their display text
interface TableReferences {
  field_name: string;
  referenced_table_is_ak_only: boolean;
  referenced_column_is_localised: boolean;
  data: Record<string, string>;
}
public class TableReferences
{
    public string FieldName { get; set; }
    public bool ReferencedTableIsAkOnly { get; set; }
    public bool ReferencedColumnIsLocalised { get; set; }
    public Dictionary<string, string> Data { get; set; }
}

Decoded File Types

DB

Decoded database table file.

FieldTypeDescription
mysterious_bytebooleanBoolean flag (setting to 0 can crash WH2)
guidstringGUID for this table instance (empty for older games)
tableTableInMemoryThe table data including definition and rows
interface DB {
  mysterious_byte: boolean;
  guid: string;
  table: TableInMemory;
}
public class DB
{
    public bool MysteriousByte { get; set; }
    public string Guid { get; set; }
    public TableInMemory Table { get; set; }
}

Loc

Decoded localisation file.

FieldTypeDescription
tableTableInMemoryTable data with key, text, and tooltip columns
interface Loc {
  table: TableInMemory;
}
public class Loc
{
    public TableInMemory Table { get; set; }
}

Text

Decoded text file.

FieldTypeDescription
encodingTextEncodingCharacter encoding of the file
formatTextFormatDetected file format
contentsstringDecoded text contents
interface Text {
  encoding: TextEncoding;
  format: TextFormat;
  contents: string;
}
public class Text
{
    public TextEncoding Encoding { get; set; }
    public TextFormat Format { get; set; }
    public string Contents { get; set; }
}

TextEncoding

Character encoding of a text file’s contents. Serialized as a plain string:

ValueDescription
"Iso8859_1"ISO/IEC 8859-1 (Latin-1)
"Utf8"UTF-8 without BOM
"Utf8Bom"UTF-8 with BOM
"Utf16Le"UTF-16 little-endian

Rust source name: Encoding (in rpfm_lib::files::text). This doc uses the more descriptive name TextEncoding for clarity — the on-the-wire JSON is identical.

type TextEncoding = "Iso8859_1" | "Utf8" | "Utf8Bom" | "Utf16Le";
public enum TextEncoding { Iso8859_1, Utf8, Utf8Bom, Utf16Le }

TextFormat

Source-code format / syntax-highlighting language for a text file. Also used as the second element of the NewFile.Text payload. Serialized as a plain string:

ValueDescription
"Bat"Windows batch file
"Cpp"C / C++
"Css"CSS
"Hlsl"HLSL shader
"Html"HTML
"Js"JavaScript
"Json"JSON
"Lua"Lua
"Markdown"Markdown
"Plain"Plain text (no specific format)
"Python"Python
"Sql"SQL
"Xml"XML
"Yaml"YAML
type TextFormat =
  | "Bat" | "Cpp" | "Html" | "Hlsl" | "Json" | "Js" | "Css"
  | "Lua" | "Markdown" | "Plain" | "Python" | "Sql" | "Xml" | "Yaml";
public enum TextFormat { Bat, Cpp, Html, Hlsl, Json, Js, Css, Lua, Markdown, Plain, Python, Sql, Xml, Yaml }

Image

Decoded image file.

FieldTypeDescription
datanumber[]Original raw image data in native format
converted_datanumber[] or nullPNG-converted data for DDS textures (for viewing)
interface Image {
  data: number[];
  converted_data: number[] | null;
}
public class Image
{
    public byte[] Data { get; set; }
    public byte[]? ConvertedData { get; set; }
}

RigidModel

Decoded RigidModel (3D model) file.

FieldTypeDescription
versionnumberFile format version (6, 7, or 8)
uk_1numberUnknown field
skeleton_idstringSkeleton identifier for animation (empty if static)
lodsunknown[]LOD structures from highest to lowest quality
interface RigidModel {
  version: number;
  uk_1: number;
  skeleton_id: string;
  lods: unknown[];
}
public class RigidModel
{
    public uint Version { get; set; }
    public uint Uk1 { get; set; }
    public string SkeletonId { get; set; }
    public List<object> Lods { get; set; }
}

ESF

Decoded ESF (Empire Save Format) file.

FieldTypeDescription
signaturestringFormat signature (CAAB, CBAB, etc.)
unknown_1numberUnknown header field, typically 0
creation_datenumberCreation timestamp
root_nodeunknownRoot node of the data tree
interface ESF {
  signature: string;
  unknown_1: number;
  creation_date: number;
  root_node: unknown;
}
public class ESF
{
    public string Signature { get; set; }
    public uint Unknown1 { get; set; }
    public uint CreationDate { get; set; }
    public object RootNode { get; set; }
}

Bmd

Decoded BMD (Battle Map Data) file.

FieldTypeDescription
serialise_versionnumberFile format version (23-27)
(other fields)unknownComplex battlefield-related data
// Only the stable header field is typed; the rest is format-specific and opaque.
interface Bmd {
  serialise_version: number;
  [other: string]: unknown;
}
public class Bmd
{
    public uint SerialiseVersion { get; set; }
    // plus format-specific fields depending on serialise_version
}

AnimFragmentBattle

Decoded AnimFragmentBattle file.

FieldTypeDescription
versionnumberFile format version (2 or 4)
entriesunknown[]List of animation entries
skeleton_namestringName of the skeleton
subversionnumberFormat subversion (version 4 only)
interface AnimFragmentBattle {
  version: number;
  entries: unknown[];
  skeleton_name: string;
  subversion: number;
}
public class AnimFragmentBattle
{
    public uint Version { get; set; }
    public List<object> Entries { get; set; }
    public string SkeletonName { get; set; }
    public uint Subversion { get; set; }
}

AnimsTable

Decoded AnimsTable file.

FieldTypeDescription
versionnumberFile format version (currently 2)
entriesunknown[]List of animation table entries
interface AnimsTable {
  version: number;
  entries: unknown[];
}
public class AnimsTable
{
    public uint Version { get; set; }
    public List<object> Entries { get; set; }
}

Atlas

Decoded Atlas (sprite sheet) file.

FieldTypeDescription
versionnumberFile format version (currently 1)
unknownnumberUnknown field
entriesunknown[]List of sprite entries
interface Atlas {
  version: number;
  unknown: number;
  entries: unknown[];
}
public class Atlas
{
    public uint Version { get; set; }
    public uint Unknown { get; set; }
    public List<object> Entries { get; set; }
}

Audio

Decoded Audio file.

FieldTypeDescription
datanumber[]Raw binary audio data
interface Audio {
  data: number[];
}
public class Audio
{
    public byte[] Data { get; set; }
}

GroupFormations

Decoded GroupFormations file.

FieldTypeDescription
formationsunknown[]List of formation definitions
interface GroupFormations {
  formations: unknown[];
}
public class GroupFormations
{
    public List<object> Formations { get; set; }
}

MatchedCombat

Decoded MatchedCombat file.

FieldTypeDescription
versionnumberFile format version (1 or 3)
entriesunknown[]List of matched combat entries
interface MatchedCombat {
  version: number;
  entries: unknown[];
}
public class MatchedCombat
{
    public uint Version { get; set; }
    public List<object> Entries { get; set; }
}

PortraitSettings

Decoded PortraitSettings file.

FieldTypeDescription
versionnumberFormat version (1 or 4)
entriesunknown[]Portrait entries, one per art set
interface PortraitSettings {
  version: number;
  entries: unknown[];
}
public class PortraitSettings
{
    public uint Version { get; set; }
    public List<object> Entries { get; set; }
}

UIC

Decoded UIC (UI Component) file.

FieldTypeDescription
versionnumberFormat version number
source_is_xmlbooleanWhether decoded from XML (true) or binary (false)
commentstringOptional comment/description
precache_conditionstringCondition for precaching
hierarchyRecord<string, unknown>Tree structure of UI element relationships
componentsRecord<string, unknown>Map of component IDs to definitions
interface UIC {
  version: number;
  source_is_xml: boolean;
  comment: string;
  precache_condition: string;
  hierarchy: Record<string, unknown>;
  components: Record<string, unknown>;
}
public class UIC
{
    public uint Version { get; set; }
    public bool SourceIsXml { get; set; }
    public string Comment { get; set; }
    public string PrecacheCondition { get; set; }
    public Dictionary<string, object> Hierarchy { get; set; }
    public Dictionary<string, object> Components { get; set; }
}

UnitVariant

Decoded UnitVariant file.

FieldTypeDescription
versionnumberVersion of the UnitVariant
unknown_1numberUnknown field
categoriesunknown[]Variant categories
interface UnitVariant {
  version: number;
  unknown_1: number;
  categories: unknown[];
}
public class UnitVariant
{
    public uint Version { get; set; }
    public uint Unknown1 { get; set; }
    public List<object> Categories { get; set; }
}

Schema Types

FieldType

The data type of a field in a schema definition. Most values are plain strings; sequence types wrap a nested Definition:

ValueDescription
"Boolean"Boolean value
"F32"32-bit float
"F64"64-bit float
"I16"16-bit signed integer
"I32"32-bit signed integer
"I64"64-bit signed integer
"ColourRGB"RGB colour value
"StringU8"UTF-8 string (length-prefixed u8)
"StringU16"UTF-16 string (length-prefixed u16)
"OptionalI16"Optional 16-bit integer
"OptionalI32"Optional 32-bit integer
"OptionalI64"Optional 64-bit integer
"OptionalStringU8"Optional UTF-8 string
"OptionalStringU16"Optional UTF-16 string
{ "SequenceU16": Definition }Nested sequence (u16 count)
{ "SequenceU32": Definition }Nested sequence (u32 count)
type FieldType =
  | "Boolean" | "F32" | "F64" | "I16" | "I32" | "I64"
  | "ColourRGB" | "StringU8" | "StringU16"
  | "OptionalI16" | "OptionalI32" | "OptionalI64"
  | "OptionalStringU8" | "OptionalStringU16"
  | { SequenceU16: Definition }
  | { SequenceU32: Definition };
// Mix of plain-string and tagged-enum variants. Model it as a tagged union:
public abstract class FieldType { }
public class FieldTypePrimitive : FieldType { public string Kind { get; set; } }  // e.g. "I32"
public class FieldTypeSequenceU16 : FieldType { public Definition SequenceU16 { get; set; } }
public class FieldTypeSequenceU32 : FieldType { public Definition SequenceU32 { get; set; } }

Field

A single field descriptor within a Definition.

FieldTypeDescription
namestringField name
field_typeFieldTypeData type
is_keybooleanPart of the table’s primary key
default_valuestring or nullDefault value for new rows
is_filenamebooleanWhether this field contains a filename/path
filename_relative_pathstring or nullSemicolon-separated relative paths for file lookup
is_reference[string, string] or nullForeign key: [table_name, column_name]
lookupstring[] or nullAdditional columns to show from the referenced table
descriptionstringHuman-readable description
ca_ordernumberPosition in CA’s Assembly Kit editor (-1 = unknown)
is_bitwisenumberNumber of boolean columns to split this field into
enum_valuesRecord<number, string>Named enum values (integer key to string name)
is_part_of_colournumber or nullRGB colour group index (null if not a colour field)
interface Field {
  name: string;
  field_type: FieldType;
  is_key: boolean;
  default_value: string | null;
  is_filename: boolean;
  filename_relative_path: string | null;
  is_reference: [string, string] | null;
  lookup: string[] | null;
  description: string;
  ca_order: number;
  is_bitwise: number;
  enum_values: Record<number, string>;
  is_part_of_colour: number | null;
}
public class Field
{
    public string Name { get; set; }
    public FieldType FieldType { get; set; }
    public bool IsKey { get; set; }
    public string? DefaultValue { get; set; }
    public bool IsFilename { get; set; }
    public string? FilenameRelativePath { get; set; }
    public Tuple<string, string>? IsReference { get; set; }
    public List<string>? Lookup { get; set; }
    public string Description { get; set; }
    public short CaOrder { get; set; }
    public int IsBitwise { get; set; }
    public Dictionary<int, string> EnumValues { get; set; }
    public byte? IsPartOfColour { get; set; }
}

Definition

Schema definition for a specific version of a DB table.

FieldTypeDescription
versionnumberVersion number (-1 = fake, 0 = unversioned, 1+ = versioned)
fieldsField[]Fields in binary encoding order (see note below)
localised_fieldsField[]Fields extracted to LOC files during export
localised_key_ordernumber[]Order of key fields for constructing localisation keys

Note: The fields list is ordered to match the binary encoding of the table, which is not necessarily the order columns appear in the decoded/displayed data. To get fields in decoded column order (with bitwise expansion, enum conversion, and colour merging applied), use the FieldsProcessed command, passing the Definition as input.

interface Definition {
  version: number;
  fields: Field[];
  localised_fields: Field[];
  localised_key_order: number[];
}
public class Definition
{
    public int Version { get; set; }
    public List<Field> Fields { get; set; }
    public List<Field> LocalisedFields { get; set; }
    public List<uint> LocalisedKeyOrder { get; set; }
}

Schema

The full schema containing all table definitions for a game.

FieldTypeDescription
versionnumberSchema format version (currently 5)
definitionsRecord<string, Definition[]>Table name to version definitions
patchesRecord<string, DefinitionPatch>Table name to patches
interface Schema {
  version: number;
  definitions: Record<string, Definition[]>;
  patches: Record<string, DefinitionPatch>;
}
public class Schema
{
    public ushort Version { get; set; }
    public Dictionary<string, List<Definition>> Definitions { get; set; }
    public Dictionary<string, DefinitionPatch> Patches { get; set; }
}

DefinitionPatch

A patch applied to a schema definition. Serialized as a nested map:

{
  "field_name": {
    "property_name": "property_value"
  }
}

Type: Record<string, Record<string, string>>

type DefinitionPatch = Record<string, Record<string, string>>;
// DefinitionPatch is a type alias for the nested map:
using DefinitionPatch = System.Collections.Generic.Dictionary<string, System.Collections.Generic.Dictionary<string, string>>;

Pack Settings Types

PackSettings

Per-pack configuration stored inside the Pack file.

FieldTypeDescription
settings_textRecord<string, string>Multi-line text settings (e.g., ignore lists)
settings_stringRecord<string, string>Single-line string settings
settings_boolRecord<string, boolean>Boolean flags
settings_numberRecord<string, number>Integer settings
interface PackSettings {
  settings_text: Record<string, string>;
  settings_string: Record<string, string>;
  settings_bool: Record<string, boolean>;
  settings_number: Record<string, number>;
}
public class PackSettings
{
    public Dictionary<string, string> SettingsText { get; set; }
    public Dictionary<string, string> SettingsString { get; set; }
    public Dictionary<string, bool> SettingsBool { get; set; }
    public Dictionary<string, int> SettingsNumber { get; set; }
}

Note

A note attached to a path within the Pack file.

FieldTypeDescription
idnumberUnique note identifier
messagestringNote content/body
urlstring or nullOptional URL associated with the note
pathstringPath within the Pack (empty string = global)
interface Note {
  id: number;
  message: string;
  url: string | null;
  path: string;
}
public class Note
{
    public ulong Id { get; set; }
    public string Message { get; set; }
    public string? Url { get; set; }
    public string Path { get; set; }
}

OptimizerOptions

Configuration for the pack optimizer.

FieldTypeDescription
pack_remove_itm_filesbooleanRemove files unchanged from vanilla
db_import_datacores_into_twad_key_deletesbooleanImport datacored tables into twad_key_deletes
db_optimize_datacored_tablesbooleanOptimize datacored tables (not recommended)
table_remove_duplicated_entriesbooleanRemove duplicated rows from DB and Loc files
table_remove_itm_entriesbooleanRemove Identical To Master rows
table_remove_itnr_entriesbooleanRemove Identical To New Row rows
table_remove_empty_filebooleanRemove empty DB and Loc files
text_remove_unused_xml_map_foldersbooleanRemove unused XML files in map folders
text_remove_unused_xml_prefab_folderbooleanRemove unused XML files in the prefab folder
text_remove_agf_filesbooleanRemove unused AGF files
text_remove_model_statistics_filesbooleanRemove unused model_statistics files
pts_remove_unused_art_setsbooleanRemove unused art sets in Portrait Settings
pts_remove_unused_variantsbooleanRemove unused variants from Portrait Settings art sets
pts_remove_empty_masksbooleanRemove empty masks in Portrait Settings
pts_remove_empty_filebooleanRemove empty Portrait Settings files
interface OptimizerOptions {
  pack_remove_itm_files: boolean;
  db_import_datacores_into_twad_key_deletes: boolean;
  db_optimize_datacored_tables: boolean;
  table_remove_duplicated_entries: boolean;
  table_remove_itm_entries: boolean;
  table_remove_itnr_entries: boolean;
  table_remove_empty_file: boolean;
  text_remove_unused_xml_map_folders: boolean;
  text_remove_unused_xml_prefab_folder: boolean;
  text_remove_agf_files: boolean;
  text_remove_model_statistics_files: boolean;
  pts_remove_unused_art_sets: boolean;
  pts_remove_unused_variants: boolean;
  pts_remove_empty_masks: boolean;
  pts_remove_empty_file: boolean;
}
public class OptimizerOptions
{
    public bool PackRemoveItmFiles { get; set; }
    public bool DbImportDatacoresIntoTwadKeyDeletes { get; set; }
    public bool DbOptimizeDatacoredTables { get; set; }
    public bool TableRemoveDuplicatedEntries { get; set; }
    public bool TableRemoveItmEntries { get; set; }
    public bool TableRemoveItnrEntries { get; set; }
    public bool TableRemoveEmptyFile { get; set; }
    public bool TextRemoveUnusedXmlMapFolders { get; set; }
    public bool TextRemoveUnusedXmlPrefabFolder { get; set; }
    public bool TextRemoveAgfFiles { get; set; }
    public bool TextRemoveModelStatisticsFiles { get; set; }
    public bool PtsRemoveUnusedArtSets { get; set; }
    public bool PtsRemoveUnusedVariants { get; set; }
    public bool PtsRemoveEmptyMasks { get; set; }
    public bool PtsRemoveEmptyFile { get; set; }
}

SettingsSnapshot

A full batch of settings. Returned by the SettingsGetAll command — much cheaper than round-tripping per-key getters when you need many settings at once. Each field is a map from setting key to value for one primitive type.

FieldTypeDescription
boolRecord<string, boolean>Boolean settings
i32Record<string, number>Signed 32-bit integer settings
f32Record<string, number>32-bit float settings
stringRecord<string, string>String settings
raw_dataRecord<string, number[]>Raw byte-array settings
vec_stringRecord<string, string[]>String-list settings
interface SettingsSnapshot {
  bool: Record<string, boolean>;
  i32: Record<string, number>;
  f32: Record<string, number>;
  string: Record<string, string>;
  raw_data: Record<string, number[]>;
  vec_string: Record<string, string[]>;
}
public class SettingsSnapshot
{
    public Dictionary<string, bool> Bool { get; set; }
    public Dictionary<string, int> I32 { get; set; }
    public Dictionary<string, float> F32 { get; set; }
    public Dictionary<string, string> String { get; set; }
    public Dictionary<string, byte[]> RawData { get; set; }
    public Dictionary<string, List<string>> VecString { get; set; }
}

Translation Types

Translation

A single translation entry for a Loc key.

FieldTypeDescription
keystringThe Loc key identifying this string
value_originalstringOriginal text in the base language
value_translatedstringTranslated text in the target language
needs_retranslationbooleanWhether the source text has changed since translation
removedbooleanWhether this string has been removed from the source pack
interface Translation {
  key: string;
  value_original: string;
  value_translated: string;
  needs_retranslation: boolean;
  removed: boolean;
}
public class Translation
{
    public string Key { get; set; }
    public string ValueOriginal { get; set; }
    public string ValueTranslated { get; set; }
    public bool NeedsRetranslation { get; set; }
    public bool Removed { get; set; }
}

PackTranslation

Translation data for a pack in a specific language.

FieldTypeDescription
languagestringTarget language code (e.g. "es", "de")
pack_namestringName of the pack
translationsRecord<string, Translation>Loc key to translation data
interface PackTranslation {
  language: string;
  pack_name: string;
  translations: Record<string, Translation>;
}
public class PackTranslation
{
    public string Language { get; set; }
    public string PackName { get; set; }
    public Dictionary<string, Translation> Translations { get; set; }
}

Diagnostics Types

Diagnostics

Diagnostics report configuration and results.

FieldTypeDescription
folders_ignoredstring[]Folder paths excluded from checks
files_ignoredstring[]File paths excluded from checks
fields_ignoredstring[]Table fields excluded ("table_name/field_name")
diagnostics_ignoredstring[]Diagnostic type identifiers to skip
resultsDiagnosticType[]Diagnostic results from the most recent check
interface Diagnostics {
  folders_ignored: string[];
  files_ignored: string[];
  fields_ignored: string[];
  diagnostics_ignored: string[];
  results: DiagnosticType[];
}
public class Diagnostics
{
    public List<string> FoldersIgnored { get; set; }
    public List<string> FilesIgnored { get; set; }
    public List<string> FieldsIgnored { get; set; }
    public List<string> DiagnosticsIgnored { get; set; }
    public List<DiagnosticType> Results { get; set; }
}

DiagnosticType

A single diagnostic result. Serialized as a tagged enum — the variant name indicates which kind of diagnostic fired:

VariantPayloadDescription
AnimFragmentBattleAnimFragmentBattleDiagnosticIssues in an AnimFragmentBattle file
ConfigConfigDiagnosticPack-level configuration issue
DependencyDependencyDiagnosticBroken/missing dependency reference
DBTableDiagnosticIssue in a DB table
LocTableDiagnosticIssue in a Loc file
PackPackDiagnosticPack-wide issue
PortraitSettingsPortraitSettingsDiagnosticIssue in a PortraitSettings file
TextTextDiagnosticIssue in a text file

Each payload is a struct with at least path: string and results: <SpecificDiagnosticReport>[] (the concrete inner fields vary by diagnostic kind and are treated as opaque by this doc). The full structures live in rpfm_extensions::diagnostics — e.g. TableDiagnostic, PackDiagnostic, ConfigDiagnostic, and so on. Clients that only need to display diagnostic results can round-trip the JSON without decoding these payloads.

// The inner payloads are left opaque here — their shape depends on the diagnostic kind.
type DiagnosticType =
  | { AnimFragmentBattle: unknown }
  | { Config: unknown }
  | { Dependency: unknown }
  | { DB: unknown }
  | { Loc: unknown }
  | { Pack: unknown }
  | { PortraitSettings: unknown }
  | { Text: unknown };
public abstract class DiagnosticType { }
public class DiagnosticTypeAnimFragmentBattle : DiagnosticType { public object AnimFragmentBattle { get; set; } }
public class DiagnosticTypeConfig             : DiagnosticType { public object Config { get; set; } }
public class DiagnosticTypeDependency         : DiagnosticType { public object Dependency { get; set; } }
public class DiagnosticTypeDB                 : DiagnosticType { public object DB { get; set; } }
public class DiagnosticTypeLoc                : DiagnosticType { public object Loc { get; set; } }
public class DiagnosticTypePack               : DiagnosticType { public object Pack { get; set; } }
public class DiagnosticTypePortraitSettings   : DiagnosticType { public object PortraitSettings { get; set; } }
public class DiagnosticTypeText               : DiagnosticType { public object Text { get; set; } }

Update Types

APIResponse

Response from a program update check. Serialized as a tagged enum:

VariantPayloadDescription
NewBetaUpdatestringNew beta version available
NewStableUpdatestringNew stable version available
NewUpdateHotfixstringNew hotfix available
NoUpdate(none)Already up to date
UnknownVersion(none)Current version could not be determined
type APIResponse =
  | { NewBetaUpdate: string }
  | { NewStableUpdate: string }
  | { NewUpdateHotfix: string }
  | "NoUpdate"
  | "UnknownVersion";
// Serialize as either a wrapped object { "<Variant>": "version" } or a bare string.
public abstract class APIResponse { }
public class APIResponseNewBetaUpdate   : APIResponse { public string NewBetaUpdate { get; set; } }
public class APIResponseNewStableUpdate : APIResponse { public string NewStableUpdate { get; set; } }
public class APIResponseNewUpdateHotfix : APIResponse { public string NewUpdateHotfix { get; set; } }
public class APIResponseNoUpdate        : APIResponse { }
public class APIResponseUnknownVersion  : APIResponse { }

GitResponse

Response from a git-based update check (schemas, translations, etc.):

ValueDescription
"NewUpdate"A new update is available on the remote
"NoUpdate"The local repository is up to date
"NoLocalFiles"No local copy exists (needs cloning)
"Diverged"Local and remote branches have diverged
type GitResponse = "NewUpdate" | "NoUpdate" | "NoLocalFiles" | "Diverged";
public enum GitResponse { NewUpdate, NoUpdate, NoLocalFiles, Diverged }

Search Types

SearchSource

Which data source to search. Serialized as a tagged enum — the Pack variant carries a pack key, the rest are plain strings:

VariantPayloadDescription
PackstringA specific open pack, identified by pack key
ParentFiles(none)Parent mod dependencies
GameFiles(none)Vanilla game files
AssKitFiles(none)Assembly Kit files

Example:

{ "Pack": "my_mod.pack" }
"GameFiles"
type SearchSource =
  | { Pack: string }
  | "ParentFiles"
  | "GameFiles"
  | "AssKitFiles";
// Serialize as either { "Pack": "pack_key" } or a bare string.
public abstract class SearchSource { }
public class SearchSourcePack        : SearchSource { public string Pack { get; set; } }
public class SearchSourceParentFiles : SearchSource { }
public class SearchSourceGameFiles   : SearchSource { }
public class SearchSourceAssKitFiles : SearchSource { }

SearchOn

Boolean flags for which file types to include in a search. Each field corresponds to a file type:

anim, anim_fragment_battle, anim_pack, anims_table, atlas, audio, bmd, db, esf, group_formations, image, loc, matched_combat, pack, portrait_settings, rigid_model, sound_bank, text, uic, unit_variant, unknown, video, schema

All fields are boolean.

interface SearchOn {
  anim: boolean;
  anim_fragment_battle: boolean;
  anim_pack: boolean;
  anims_table: boolean;
  atlas: boolean;
  audio: boolean;
  bmd: boolean;
  db: boolean;
  esf: boolean;
  group_formations: boolean;
  image: boolean;
  loc: boolean;
  matched_combat: boolean;
  pack: boolean;
  portrait_settings: boolean;
  rigid_model: boolean;
  sound_bank: boolean;
  text: boolean;
  uic: boolean;
  unit_variant: boolean;
  unknown: boolean;
  video: boolean;
  schema: boolean;
}
public class SearchOn
{
    public bool Anim { get; set; }
    public bool AnimFragmentBattle { get; set; }
    public bool AnimPack { get; set; }
    public bool AnimsTable { get; set; }
    public bool Atlas { get; set; }
    public bool Audio { get; set; }
    public bool Bmd { get; set; }
    public bool Db { get; set; }
    public bool Esf { get; set; }
    public bool GroupFormations { get; set; }
    public bool Image { get; set; }
    public bool Loc { get; set; }
    public bool MatchedCombat { get; set; }
    public bool Pack { get; set; }
    public bool PortraitSettings { get; set; }
    public bool RigidModel { get; set; }
    public bool SoundBank { get; set; }
    public bool Text { get; set; }
    public bool Uic { get; set; }
    public bool UnitVariant { get; set; }
    public bool Unknown { get; set; }
    public bool Video { get; set; }
    public bool Schema { get; set; }
}

GlobalSearch

Global search configuration and results.

FieldTypeDescription
patternstringText pattern or regex to search for
replace_textstringReplacement text
case_sensitivebooleanWhether the search is case-sensitive
use_regexbooleanWhether the pattern is a regular expression
sourcesSearchSource[]One or more data sources to search
search_onSearchOnWhich file types to search
matchesMatchesResults from the most recent search
game_keystringGame key for the files being searched
interface GlobalSearch {
  pattern: string;
  replace_text: string;
  case_sensitive: boolean;
  use_regex: boolean;
  sources: SearchSource[];
  search_on: SearchOn;
  matches: Matches;
  game_key: string;
}
public class GlobalSearch
{
    public string Pattern { get; set; }
    public string ReplaceText { get; set; }
    public bool CaseSensitive { get; set; }
    public bool UseRegex { get; set; }
    public List<SearchSource> Sources { get; set; }
    public SearchOn SearchOn { get; set; }
    public Matches Matches { get; set; }
    public string GameKey { get; set; }
}

Matches

The results of a global search, grouped by file type. Each field is an array of per-type match containers (defined in the next section) — except schema, which is a single SchemaMatches container.

FieldTypeDescription
animUnknownMatches[]Matches in animation files
anim_fragment_battleAnimFragmentBattleMatches[]Matches in battle animation fragments
anim_packUnknownMatches[]Matches in animation packs
anims_tableUnknownMatches[]Matches in animation tables
atlasAtlasMatches[]Matches in atlases
audioUnknownMatches[]Matches in audio files
bmdUnknownMatches[]Matches in BMD files
dbTableMatches[]Matches in DB tables
esfUnknownMatches[]Matches in ESF files
group_formationsUnknownMatches[]Matches in group formations
imageUnknownMatches[]Matches in images
locTableMatches[]Matches in Loc tables
matched_combatUnknownMatches[]Matches in matched combat files
packUnknownMatches[]Matches in nested Pack files
portrait_settingsPortraitSettingsMatches[]Matches in portrait settings
rigid_modelRigidModelMatches[]Matches in RigidModel files
sound_bankUnknownMatches[]Matches in sound banks
textTextMatches[]Matches in text files (Lua, XML, …)
uicUnknownMatches[]Matches in UIC files
unit_variantUnitVariantMatches[]Matches in UnitVariant files
unknownUnknownMatches[]Matches in unclassified files
videoUnknownMatches[]Matches in video files
schemaSchemaMatchesMatches in the schema (single container, not an array)
interface Matches {
  anim: UnknownMatches[];
  anim_fragment_battle: AnimFragmentBattleMatches[];
  anim_pack: UnknownMatches[];
  anims_table: UnknownMatches[];
  atlas: AtlasMatches[];
  audio: UnknownMatches[];
  bmd: UnknownMatches[];
  db: TableMatches[];
  esf: UnknownMatches[];
  group_formations: UnknownMatches[];
  image: UnknownMatches[];
  loc: TableMatches[];
  matched_combat: UnknownMatches[];
  pack: UnknownMatches[];
  portrait_settings: PortraitSettingsMatches[];
  rigid_model: RigidModelMatches[];
  sound_bank: UnknownMatches[];
  text: TextMatches[];
  uic: UnknownMatches[];
  unit_variant: UnitVariantMatches[];
  unknown: UnknownMatches[];
  video: UnknownMatches[];
  schema: SchemaMatches;
}
public class Matches
{
    public List<MatchContainer<UnknownMatch>> Anim { get; set; }
    public List<MatchContainer<AnimFragmentBattleMatch>> AnimFragmentBattle { get; set; }
    public List<MatchContainer<UnknownMatch>> AnimPack { get; set; }
    public List<MatchContainer<UnknownMatch>> AnimsTable { get; set; }
    public List<MatchContainer<AtlasMatch>> Atlas { get; set; }
    public List<MatchContainer<UnknownMatch>> Audio { get; set; }
    public List<MatchContainer<UnknownMatch>> Bmd { get; set; }
    public List<MatchContainer<TableMatch>> Db { get; set; }
    public List<MatchContainer<UnknownMatch>> Esf { get; set; }
    public List<MatchContainer<UnknownMatch>> GroupFormations { get; set; }
    public List<MatchContainer<UnknownMatch>> Image { get; set; }
    public List<MatchContainer<TableMatch>> Loc { get; set; }
    public List<MatchContainer<UnknownMatch>> MatchedCombat { get; set; }
    public List<MatchContainer<UnknownMatch>> Pack { get; set; }
    public List<MatchContainer<PortraitSettingsMatch>> PortraitSettings { get; set; }
    public List<MatchContainer<RigidModelMatch>> RigidModel { get; set; }
    public List<MatchContainer<UnknownMatch>> SoundBank { get; set; }
    public List<MatchContainer<TextMatch>> Text { get; set; }
    public List<MatchContainer<UnknownMatch>> Uic { get; set; }
    public List<MatchContainer<UnitVariantMatch>> UnitVariant { get; set; }
    public List<MatchContainer<UnknownMatch>> Unknown { get; set; }
    public List<MatchContainer<UnknownMatch>> Video { get; set; }
    public MatchContainer<SchemaMatch> Schema { get; set; }
}

Match Types

Search results use specialized match types per file format. All match containers share the same wrapper shape:

FieldTypeDescription
pathstringInternal path of the file the matches came from
sourceSearchSourceData source the file was searched in
container_namestringName of the containing Pack (or empty)
matches<Match>[]Match entries — type depends on file kind

TableMatch (used for DB and Loc files):

FieldTypeDescription
column_namestringColumn where the match is
column_numbernumberLogical column index (-1 if hidden)
row_numbernumberRow number (-1 if hidden by filter)
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringContents of the matched cell

TextMatch (used for text files):

FieldTypeDescription
rownumberRow of the first character
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringLine containing the match

UnknownMatch (used for binary/unknown files):

FieldTypeDescription
posnumberByte position of the match
lennumberLength of the matched pattern in bytes

AnimFragmentBattleMatch (used for AnimFragmentBattle files):

FieldTypeDescription
skeleton_namebooleanMatch is in the skeleton name
table_namebooleanMatch is in the table name
mount_table_namebooleanMatch is in the mount table name
unmount_table_namebooleanMatch is in the unmount table name
locomotion_graphbooleanMatch is in the locomotion graph
entry[number, [number, boolean, boolean, boolean] or null, boolean, boolean, boolean, boolean, boolean] or nullEntry match details
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringThe matched text

AtlasMatch (used for Atlas files — same structure as TableMatch):

FieldTypeDescription
column_namestringColumn where the match is
column_numbernumberLogical column index
row_numbernumberRow number of the match
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringContents of the matched cell

PortraitSettingsMatch (used for PortraitSettings files):

FieldTypeDescription
entrynumberIndex of the entry
idbooleanMatch is in the id field
camera_settings_headbooleanMatch is in head camera skeleton node
camera_settings_bodybooleanMatch is in body camera skeleton node
variant[number, boolean, boolean, boolean, boolean, boolean] or nullVariant match details
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringThe matched text

RigidModelMatch (used for RigidModel files):

FieldTypeDescription
skeleton_idbooleanMatch is in the skeleton id
mesh_value[number, number] or nullLOD and mesh index, or null
mesh_namebooleanMatch is in the mesh name
mesh_mat_namebooleanMatch is in the material name
mesh_textute_directorybooleanMatch is in the texture directory
mesh_filtersbooleanMatch is in the mesh filters
mesh_att_point_namenumber or nullAttachment point index with match
mesh_texture_pathnumber or nullTexture path index with match
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringThe matched text

UnitVariantMatch (used for UnitVariant files):

FieldTypeDescription
entrynumberIndex of the entry
namebooleanMatch is in the name
variant[number, boolean, boolean] or nullVariant match details
startnumberByte offset where match starts
endnumberByte offset where match ends
textstringThe matched text

SchemaMatch (used for schema searches):

FieldTypeDescription
table_namestringThe table name
versionnumberVersion of the matched definition
columnnumberColumn index of the match
column_namestringFull name of the matched column

All match container types (TableMatches, TextMatches, AnimFragmentBattleMatches, etc.) use the wrapper shape from the top of this section — { path, source, container_name, matches } — with matches being an array of the corresponding per-type match struct.

interface TableMatch {
  column_name: string;
  column_number: number;
  row_number: number;
  start: number;
  end: number;
  text: string;
}

interface TextMatch {
  row: number;
  start: number;
  end: number;
  text: string;
}

interface UnknownMatch {
  pos: number;
  len: number;
}

interface AnimFragmentBattleMatch {
  skeleton_name: boolean;
  table_name: boolean;
  mount_table_name: boolean;
  unmount_table_name: boolean;
  locomotion_graph: boolean;
  entry:
    | [number, [number, boolean, boolean, boolean] | null, boolean, boolean, boolean, boolean, boolean]
    | null;
  start: number;
  end: number;
  text: string;
}

interface AtlasMatch extends TableMatch {}  // same shape as TableMatch

interface PortraitSettingsMatch {
  entry: number;
  id: boolean;
  camera_settings_head: boolean;
  camera_settings_body: boolean;
  variant: [number, boolean, boolean, boolean, boolean, boolean] | null;
  start: number;
  end: number;
  text: string;
}

interface RigidModelMatch {
  skeleton_id: boolean;
  mesh_value: [number, number] | null;
  mesh_name: boolean;
  mesh_mat_name: boolean;
  mesh_textute_directory: boolean;
  mesh_filters: boolean;
  mesh_att_point_name: number | null;
  mesh_texture_path: number | null;
  start: number;
  end: number;
  text: string;
}

interface UnitVariantMatch {
  entry: number;
  name: boolean;
  variant: [number, boolean, boolean] | null;
  start: number;
  end: number;
  text: string;
}

interface SchemaMatch {
  table_name: string;
  version: number;
  column: number;
  column_name: string;
}

// The wrapper that groups matches for one file, used by every *Matches type:
interface MatchContainer<M> {
  path: string;
  source: SearchSource;
  container_name: string;
  matches: M[];
}
type TableMatches              = MatchContainer<TableMatch>;
type TextMatches               = MatchContainer<TextMatch>;
type UnknownMatches            = MatchContainer<UnknownMatch>;
type AnimFragmentBattleMatches = MatchContainer<AnimFragmentBattleMatch>;
type AtlasMatches              = MatchContainer<AtlasMatch>;
type PortraitSettingsMatches   = MatchContainer<PortraitSettingsMatch>;
type RigidModelMatches         = MatchContainer<RigidModelMatch>;
type UnitVariantMatches        = MatchContainer<UnitVariantMatch>;
type SchemaMatches             = MatchContainer<SchemaMatch>;
public class TableMatch
{
    public string ColumnName { get; set; }
    public uint ColumnNumber { get; set; }
    public long RowNumber { get; set; }
    public long Start { get; set; }
    public long End { get; set; }
    public string Text { get; set; }
}

public class TextMatch
{
    public ulong Row { get; set; }
    public long Start { get; set; }
    public long End { get; set; }
    public string Text { get; set; }
}

public class UnknownMatch
{
    public long Pos { get; set; }
    public long Len { get; set; }
}

// AtlasMatch has the same shape as TableMatch.
public class AtlasMatch : TableMatch { }

public class SchemaMatch
{
    public string TableName { get; set; }
    public int Version { get; set; }
    public int Column { get; set; }
    public string ColumnName { get; set; }
}

// AnimFragmentBattleMatch, PortraitSettingsMatch, RigidModelMatch and UnitVariantMatch
// follow the tables above; field-for-field translations are straightforward
// (booleans → bool, nullable tuples → Tuple<...>? or a named class).

// Wrapper shared by every *Matches type:
public class MatchContainer<M>
{
    public string Path { get; set; }
    public SearchSource Source { get; set; }
    public string ContainerName { get; set; }
    public List<M> Matches { get; set; }
}

MatchHolder

A tagged enum wrapping a single file type’s matches. The variant name indicates the file type:

{ "Db": { "path": "db/units_tables/data", "matches": [...] } }
{ "Text": { "path": "script/campaign/mod.lua", "matches": [...] } }

Variants: Anim, AnimFragmentBattle, AnimPack, AnimsTable, Atlas, Audio, Bmd, Db, Esf, GroupFormations, Image, Loc, MatchedCombat, Pack, PortraitSettings, RigidModel, SoundBank, Text, Uic, UnitVariant, Unknown, Video, Schema.

// Most variants carry an UnknownMatches; only the rich-formatted file types carry their own match container.
type MatchHolder =
  | { Anim: UnknownMatches }
  | { AnimFragmentBattle: AnimFragmentBattleMatches }
  | { AnimPack: UnknownMatches }
  | { AnimsTable: UnknownMatches }
  | { Atlas: AtlasMatches }
  | { Audio: UnknownMatches }
  | { Bmd: UnknownMatches }
  | { Db: TableMatches }
  | { Esf: UnknownMatches }
  | { GroupFormations: UnknownMatches }
  | { Image: UnknownMatches }
  | { Loc: TableMatches }
  | { MatchedCombat: UnknownMatches }
  | { Pack: UnknownMatches }
  | { PortraitSettings: PortraitSettingsMatches }
  | { RigidModel: RigidModelMatches }
  | { SoundBank: UnknownMatches }
  | { Text: TextMatches }
  | { Uic: UnknownMatches }
  | { UnitVariant: UnitVariantMatches }
  | { Unknown: UnknownMatches }
  | { Video: UnknownMatches }
  | { Schema: SchemaMatches };
// One wrapper class per variant. Only the most common ones shown — pattern is identical for the rest.
public abstract class MatchHolder { }
public class MatchHolderDb   : MatchHolder { public MatchContainer<TableMatch> Db { get; set; } }
public class MatchHolderLoc  : MatchHolder { public MatchContainer<TableMatch> Loc { get; set; } }
public class MatchHolderText : MatchHolder { public MatchContainer<TextMatch> Text { get; set; } }
public class MatchHolderSchema : MatchHolder { public MatchContainer<SchemaMatch> Schema { get; set; } }
// ... one class per variant listed above; most wrap MatchContainer<UnknownMatch>.