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

ContainerPath

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

{ "File": "db/units_tables/data" }
{ "Folder": "db/units_tables" }

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_versionstringPFH version enum value
pfh_file_typestringPFH file type enum value
bitmaskunknownPFH flags bitmask
compressstringCompression format enum value
timestampnumberPack file timestamp
interface ContainerInfo {
  file_name: string;
  file_path: string;
  pfh_version: string;
  pfh_file_type: string;
  bitmask: unknown;
  compress: string;
  timestamp: number;
}
public class ContainerInfo
{
    public string FileName { get; set; }
    public string FilePath { get; set; }
    public string PfhVersion { get; set; }
    public string PfhFileType { get; set; }
    public object Bitmask { get; set; }
    public string Compress { get; set; }
    public long 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"] }

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

CompressionFormat

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

ValueDescription
"None"No compression
"Lz4"LZ4 compression
"Zstd"Zstandard compression

PFHFileType

Pack file type. Serialized as a plain string (e.g. "Mod", "Movie", "Boot", etc.).


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
SequenceU16DecodedData[][]Nested sequence (u16 count)
SequenceU32DecodedData[][]Nested sequence (u32 count)

Example:

{ "StringU8": "hello" }
{ "I32": 42 }
{ "Boolean": true }

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

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

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" } }

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

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

Loc

Decoded localisation file.

FieldTypeDescription
tableTableInMemoryTable data with key, text, and tooltip columns

Text

Decoded text file.

FieldTypeDescription
encodingTextEncodingCharacter encoding of the file
formatTextFormatDetected file format
contentsstringDecoded text contents

TextEncoding values: "Iso8859_1", "Utf8", "Utf8Bom", "Utf16Le"

TextFormat values: "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)

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

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

Bmd

Decoded BMD (Battle Map Data) file.

FieldTypeDescription
serialise_versionnumberFile format version (23-27)
(other fields)unknownComplex battlefield-related data

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)

AnimsTable

Decoded AnimsTable file.

FieldTypeDescription
versionnumberFile format version (currently 2)
entriesunknown[]List of animation table entries

Atlas

Decoded Atlas (sprite sheet) file.

FieldTypeDescription
versionnumberFile format version (currently 1)
unknownnumberUnknown field
entriesunknown[]List of sprite entries

Audio

Decoded Audio file.

FieldTypeDescription
datanumber[]Raw binary audio data

GroupFormations

Decoded GroupFormations file.

FieldTypeDescription
formationsunknown[]List of formation definitions

MatchedCombat

Decoded MatchedCombat file.

FieldTypeDescription
versionnumberFile format version (1 or 3)
entriesunknown[]List of matched combat entries

PortraitSettings

Decoded PortraitSettings file.

FieldTypeDescription
versionnumberFormat version (1 or 4)
entriesunknown[]Portrait entries, one per art 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

UnitVariant

Decoded UnitVariant file.

FieldTypeDescription
versionnumberVersion of the UnitVariant
unknown_1numberUnknown field
categoriesunknown[]Variant categories

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)

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)

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.

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

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>>


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

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)

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

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

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

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
resultsunknown[]Diagnostic results from the most recent check

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

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

Search Types

SearchSource

Which data source to search. Serialized as a plain string:

ValueDescription
"Pack"Currently loaded pack
"ParentFiles"Parent mod dependencies
"GameFiles"Vanilla game files
"AssKitFiles"Assembly Kit files

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.

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
sourceSearchSourceWhich data source to search
search_onSearchOnWhich file types to search
matchesMatchesResults from the most recent search
game_keystringGame key for the files being searched

Match Types

Search results use specialized match types per file format. All match containers share the same pattern: a path string and a matches array.

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 (e.g. TableMatches, TextMatches, AnimFragmentBattleMatches, etc.) share the same structure: { path: string, matches: <MatchType>[] }.

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.