TweakDB - psiberx/cp2077-tweak-xl GitHub Wiki

What is TweakDB

TweakDB is a database from REDengine 4 designed for readonly in-game access. It contains static information about characters, items, AI behavior, etc.

At runtime it consists of flats and records.

A flat stores a single value of one of the next types:

  • Scalar
    • Int32
    • Float
    • Bool
    • String
    • CName (string constant)
    • TweakDBID (flat or record ID)
    • gamedataLocKeyWrapper (localization key)
    • raRef:CResource (resource path)
  • Structure
    • Quaternion
    • EulerAngles
    • Vector3
    • Vector2
    • Color
  • Array of any of the above types

Records are typed objects that combine several flats (properties).

Flats that don't belong to any record also called free flats.

A TweakDBID value identifies a flat or record. It's used as a foreign key to define relationships between records. It's represented as a hash of the flat or record name. TweakDB doesn't have access to the original names at runtime and operates with hashed IDs only.

Modding TweakDB

TweakXL allows mods modify TweakDB using:

  • YAML Tweaks – A proprietary TweakXL file format
  • RED Tweaks – An original REDengine / REDmod file format
  • Scripts – With new API added by TweakXL