Database operations ​

Database operations change records in the game database, game_package/gamedatabases/gamedatabases.2025.bin.

A database op file in full ​

jsonc
{
  "schema_version": 1,
  "ops": [
    // change one field of one row
    { "op": "set", "select": "rules.stop_go_penalty", "field": "penalty_duration", "value": "10" },
    // copy another key's value
    { "op": "set", "select": "{446668bc25ba571c}[_metadata_=f1_26]", "field": "worldEri",
      "value_from": "{446668bc25ba571c}[_metadata_=myteam_26].worldEri" },
    // copy a row with every key, then change some of them
    { "op": "add-row", "table": "audio.audio_bundle_settings",
      "from": "audio.audio_bundle_settings.audio_bundle_settings[_metadata_=ferrari_2025]",
      "set": { "_metadata_": "cs16_ferrari", "bundle_name": "cs16_ferrari" } },
    // add an entry to a comma-separated list field, and take one out
    { "op": "list-append", "select": "entrants.entrant_setup_modes.entrant_setup_mode[_metadata_=swofty_f1]",
      "field": "entrant_lists", "value": "cs_f1_2016" },
    { "op": "list-remove", "select": "track_data.track_layers.TrackLayer[_metadata_=f1]",
      "field": "game_setup_modes", "value": "swofty_f1" },
    // write one raw record: type tag 2 (text), value as hex bytes ("cs16_mercedes.bdl")
    { "op": "put-record", "key": "audio.audio_car_data.F1_m_mercedes.bundle_name", "type": 2,
      "value": "637331365f6d657263656465732e62646c" },
    // remove one record; a stock record is skipped without allow_stock_removal
    { "op": "remove-record", "key": "audio.audio_car_data.F1_m_mercedes.detonations_category" }
  ]
}

These ops are trimmed from Classic Seasons' db/season.json and db/core.json. List the file in operations.database in your manifest:

json
"operations": {
  "database": ["db/season.json"]
}

Or put the same ops in an operations.assets file with a db. prefix (db.set, db.add-row). Next to ops, a file can hold fields (Key names), strict (The completeness check) and side_data (Acknowledging findings). For a walkthrough, see Game database. A native plugin reads the loaded database back with swofty/db.hpp, using the same keys.

A build that can't apply an op fails, naming the addon and the cause:

text
applying yourname.my-addon: rules.stop_go_penalty.penalty_duraton: no such key

Operations ​

set ​

jsonc
{
  "op": "set",
  "select": "entrants.teams.team[_metadata_=williams_26]",  // the row: a path, with selectors
  "field": "display_name_code",                              // the field; a path such as TrackNameData_0.title works too
  "value": "WIL"                                             // always a string
}
  • Write every value as a string, whatever the field's type. A bool is True or False. A list joins its entries with commas and no spaces: "0,-0.6,0".
  • value_from instead of value copies the value of another database path.
  • "create": true with a "type" tag adds the field when the row lacks it.
  • A select that matches no row waits for a later addon to add the row (Applying changes), and fails the build if none does. A missing field, without create, fails the build.
  • A select that matches several rows takes the first one, which is the stock row, or else the row the earliest addon in the load order added. The build warns once per selector: <select>: 2 rows match; using the first, <row>. key paths of put-record and remove-record still fail with <select>: 2 rows match, and so does a strict file.
  • datasets is accepted but not built: a set with it fails.
text
<select>.<field>: no such key
<select>.<field>: set needs value or value_from
<select>.<field>: create needs type
dataset-scoped set is not implemented yet

add-row ​

jsonc
{
  "op": "add-row",
  "table": "entrants.teams",                                 // the table's real path: row numbers or selectors, never a {hash}
  "from": "entrants.teams.team[_metadata_=williams_26]",     // the source row, a row of table
  "set": { "_metadata_": "team12_26", "display_name_code": "T12" },  // keys of the copy to change
  "copy": "all",                                             // optional: all (default) or listed
  "stat_id": "fresh"                                         // optional: fresh or keep
}

add-row copies every key of the source row: its fields, its sub-object keys such as ai_vehicle_config.* on vehicles, and its nested tables with their _instancecount_ keys and rows, at any depth. set then changes keys of the copy. Every set key must be a key the copy has. The copy goes at the table's next row number, and the table's count goes up by one (The row-count rule).

  • copy: all copies every key of the source row and every key in the file's fields list. listed copies only the keys in the fields list.
  • stat_id: fresh gives the copy the id the install keeps for it, else the next free id above the table's rows in load order (Kept ids). keep keeps the source row's id. The default is fresh in a top-level table whose rows all have different ids, and keep elsewhere (Stat ids).

The build prints, prefixed with the addon's id:

text
my-addon: add-row entrants.teams.team_<n> (from entrants.teams.team[_metadata_=williams_26]): stat_id <id> (the source's is <id>)
my-addon: add-row entrants.teams.team_<n> (from entrants.teams.team[_metadata_=williams_26]): copied <n> key(s)

It fails with one of:

text
<table>: add-row needs the table's real path, not a {hash}
<from> is not a row of <table>
<table>.<row>: unknown field <field>
<table>.<row>: copy listed needs a fields list
<new row>.<field> already exists

list-append and list-remove ​

jsonc
{ "op": "list-append",
  "select": "entrants.entrant_setup_modes.entrant_setup_mode[_metadata_=swofty_f1]",
  "field": "entrant_lists",
  "value": "cs_f1_2016,cs_f1_2017" }   // each comma-separated value is added if missing
{ "op": "list-remove",
  "select": "track_data.track_layers.TrackLayer[_metadata_=f1]",
  "field": "game_setup_modes",
  "value": "swofty_f1" }               // each comma-separated value is removed

Both treat the field as a comma-separated list and keep its order. Several addons can append to the same list without a conflict. A missing field fails the build with <select>.<field>: no such key.

put-record ​

jsonc
{
  "op": "put-record",
  "key": "audio.audio_car_data.F1_m_mercedes._metadata_",  // a path, which can use selectors, or 0x and 16 hex digits
  "type": 2,                                              // the record's type tag
  "value": "46315f6d5f6d65726365646573"                   // the bytes, in hex: "F1_m_mercedes"
}

put-record writes one raw record. When the key exists, its tag and value are replaced; otherwise the record is added.

text
<key>: value must be hex bytes
bad record key <key>

remove-record ​

jsonc
{ "op": "remove-record",
  "key": "tracks.Track_0.PoleOnRight",   // a path, which can use selectors, or 0x and 16 hex digits
  "allow_stock_removal": true }          // optional: remove a record of the stock database

A remove-record whose key is already absent is a no-op, and the build prints <addon id>: <key>: already removed.

virtual-list ​

jsonc
{ "op": "virtual-list", "list": "f5_1959" }   // before the add-row that adds the entrant list f5_1959

Marks an entrant list your addon adds as virtual. The game loads every row of entrants.entrant_lists below the table's count as a list, keeps its stat id in a byte (255 at most) and lets an entrant setup mode hold 32 lists, so a big season pack runs out of both. A virtual list takes neither:

  • The add-row that adds it passes the 255 ceiling.
  • After every addon's database ops, the build moves its row, entrant rows included, to entrant_list_10000 and up, puts the table's last added row in its place and lowers the count. The game never loads it.
  • The build takes its label out of every content set's and entrant setup mode's list fields.
  • A box that names it shows when swofty_virtual_list is offered under swofty_f1. When the box is pressed, the core reads the virtual row into swofty_virtual_list and selects that list; the next press puts the host's own entrants back.

The build prints one line per list and a summary:

text
virtual list f5_1959: 312 key(s) moved from entrants.entrant_lists.entrant_list_301 to entrants.entrant_lists.entrant_list_10000
virtual lists: 76 moved above the count (230 lists left for the game), 2 list field(s) no longer name them

A stock list stays where it is, and nothing moves when the table's last row is a stock list.

Removing stock records ​

A remove-record of a key in the game's stock database is skipped. The build warns once per addon with the count:

text
warning: My Mod: 12 removal(s) of stock database records skipped; the game crashes when a record it reads is missing

The addon's row on the Addons page shows the count after a build or a conflict check. Keys that addons add, earlier in the same addon or in another one, are removed as before. Set "allow_stock_removal": true on the op to remove a stock record.

A remove-record of a record that a track's activation adds is always skipped, with or without allow_stock_removal:

text
warning: My Mod: 12 removal(s) of database records the tracks add skipped; the game crashes when a record it reads is missing

The game crashes on any key it reads that is missing; see Missing keys. A build that removes a stock record writes the database into gamedatabases.2025.bin instead of editing it at runtime. Export game files (.zip) in the DB Editor skips the same removals and lists them.

Renamed and removed entrant lists ​

The game looks up its entrant lists (entrants.entrant_lists) by name. A database mod made from an older game version's database renames or removes a list that the newer version added:

jsonc
// made from an older database: the stock f2_2026 list becomes f2_2025
{ "op": "set", "select": "entrants.entrant_lists.entrant_list[_metadata_=f2_2026]", "field": "_metadata_", "value": "f2_2025" }

When an addon's ops rename one of the stock lists, remove it, lower _entrant_list_instancecount_ so the list is past the count, or take a list name out of a content set's available_entrant_lists or an entrant setup mode's entrant_lists or selectable_entrant_lists, the build applies the ops as written. It warns once per addon:

text
warning: My Mod: renames or removes the entrant list(s) f2_2026; F2 menus may crash with it

Track layer overrides ​

A row of content_sets.content_set_N.track_layer_override_N names two track layers (track_data.track_layers) by label: after the track database loads, the game copies the override layer's world onto the target layer, for every game setup mode. The game checks neither label. After every addon's ops, the build drops each override row whose target or override names no track layer row, moves the rows after it down and lowers the count, with one line per row:

jsonc
// the classic world on the f1 layer becomes my_layer's, but no track layer row is labelled my_layer
{ "op": "set", "select": "content_sets.content_set[_metadata_=2025].track_layer_override_0",
  "field": "override", "value": "my_layer" }
text
content set 2025: dropped track_layer_override track_layer_override (override my_layer names no track_data.track_layers row; the game reads past the end of the layer table there)

Add the layer row before the override row names it. The keys past the new count stay in the database, where the game ignores them. A content set or layer table the build cannot read is left as it is, and the build goes on.

remove-row ​

json
{ "op": "remove-row", "select": "tracks.Track_3" }

remove-row is defined but not built: a build with one fails with remove-row is not implemented yet.

How add-row names keys ​

Key names ​

The database stores a hash of each key's path, not the path, so the build can't list a row's keys. It probes the source row with the launcher's key catalogue, row_keys.txt.gz: every key path found under each row shape of the stock database, generated from the identifier strings in F1_25.exe, its printf format strings with each integer conversion expanded to 0..31 (colour_%u_default gives colour_0_default to colour_31_default), tools/gamedb/names.txt, the key catalogue and the run-time compositions in tools/gamedb/compositions.txt, such as player.driver.preloaded on entrant setup modes. A row shape is a row path with its row numbers written _N: entrants.entrant_setup_modes.entrant_setup_mode_N.

The file's fields map, keyed by table as written or its resolved path and the row name, adds names the catalogue lacks. Every listed field must exist on the source row:

json
"fields": { "entrants.teams.team": ["_metadata_", "stat_id", "display_name_code"] }

copy: listed keeps the behaviour of launcher 1.2.1 and earlier: the copy has only the listed fields, and the fields list is required.

The completeness check ​

The build prints how many keys each add-row copied, and checks the copy against the catalogue:

text
copy all: a key of the source row that the fields list doesn't name (a line)
  add-row … (from …): copied 9 key(s) the fields list for … doesn't name: …
copy listed: a key of the source row that the fields list doesn't name, so the copy lacks it (a warning)
  add-row … (from …): the fields list for … misses 9 key(s) of the source row, not copied: …
both: a row shape, of the row or a nested row, that has no catalogue entry (a warning)
  add-row … (from …): the key catalogue has no entry for …; keys only the exe builds at run time may be missing

Rows past a row count that set lowers don't count as missing. With "strict": true at the top of the op file, each warning fails the build.

The build can't count the keys it can't name. An FNV-1a key gives no sign of the path it hashes, and the file holds records in hash order, so a key under the source row and a key elsewhere look alike. A key that only the game's code builds at run time, from names the exe holds in pieces, is missing from the catalogue until tools/gamedb/compositions.txt lists it. Regenerate the catalogue after changing that file:

sh
cargo run --release -p swofty-core --example row_keys -- --game <F1 25 folder>

cargo run -p swofty-core --example check_add_rows -- --game <F1 25 folder> --addon <addon folder> applies an addon's database files to the stock database and prints the check. --listed checks the files as launcher 1.2.1 copied them; --strict stops at the first finding.

Stat ids ​

Tables indexed by stat_id find a row by its id, so a copy that keeps its source's id hides the source or another copy. Every stock top-level table with a stat_id on each row gives each row its own id, except f1_world.map.markers.TrackMapMarker_N, schedule.events.fixed_event_N and track_data.game_setup.TrackDataSet_N. Among them: entrants.entrant_lists.entrant_list_N, entrants.entrant_setup_modes.entrant_setup_mode_N, entrants.vehicles.vehicle_packages.vehicle_package_N, entrants.teams.team_N, entrants.drivers.driver_N, entrants.vehicles.vehicle_N and game_setup.game_setup_modes.game_setup_mode_N.

A copy into such a table gets an id of its own (Kept ids), and the build prints it:

text
f1-1990: add-row entrants.entrant_lists.entrant_list_68 (from entrants.entrant_lists.entrant_list[_metadata_=f1_2026]): stat_id 105 (the source's is 67)

Kept ids ​

A copy keeps its id from build to build, so a career keeps its cars, teams and drivers. The launcher keeps the id of every copy it gives one in $DATA/registry/row-ids.json, one file per install next to the core's ids.json, keyed <addon>/<table>.<row>/<label>. Every profile's build reads it, so a row has the same id whatever the profile, the load order or the other addons:

  • A copy the file has no id for takes, at a profile's first build with the file, the id the profile's last build gave the row with its label, or, for a new profile, the newest build of any profile. The last build's rows are read from its database file and from the database edits in its swofty/assets.json, where a build that loads the database in game puts them.
  • Any other new copy takes the next free id above the table's rows, in load order, as builds before 1.6.10 gave it, passing over the ids the file keeps for other rows and the ids the core's ids.json holds. A fresh install with the same addons in the same order gives a save made before 1.6.10 its ids back, and two installs that build the same addons in the same order from an empty file get the same ids.
  • An addon that is turned off or removed keeps its rows' ids. Turned back on, its rows get them back. An update that adds a row gives the new row a new id and leaves the others alone.
  • A kept id that a row of the database, the core's ids.json or the table's ceiling now rules out moves to the next free id, in that profile only. The new id is kept under profiles.<profile> in the file; the install-wide id stays in rows, so every other profile keeps the id its careers hold, and a profile with no entry of its own reads the install-wide one. The id a row moved from is kept as an alias in the same place.
  • 1.6.10 and 1.6.11 gave new copies an id from the hash of their key and kept none of the ids earlier builds gave. The first build after them puts those rows back once: each takes the id the newest game session log from before 1.6.10 ($DATA/sessions/<stamp>/loader.log) shows for its label, and a row no log shows takes the next free id in load order again. An addon whose hashed team ids a session loaded since 1.6.10, while none loaded its earlier ones, keeps the hashed ids.
  • The file keeps every id a row had before the one it keeps (the ids 1.6.10 and 1.6.11 hashed, the ids a row moved from). Each build writes them to swofty/id_aliases.json as { "version": 1, "tables": { "teams": { "646": 518 }, "vehicles": {}, "drivers": {} } }, earlier id to current id. When a Grand Prix is continued and no entrant list holds the saved entrants' teams, the core maps the saved entrants' team, vehicle and driver ids through it and loads the list that holds the mapped teams, so a Grand Prix started on 1.6.10 or 1.6.11 loads on a later build.
  • An earlier id maps to the current id unless a stock row, a row of an addon in the build or a core registry record of an addon in the build holds it. A registry record of an addon the build leaves out does not stop the alias. Two rows that moved from one earlier id to different ids give no alias for it, and a row lent by another player's room gives none.
  • The core's ids.json pools never allocate an id this file keeps for a row, whether it is under rows or under any profile's rows.
  • A table with no free id left takes the lowest id kept for an addon the build leaves out, then the lowest id ids.json holds for a record of an addon the build leaves out that no career uses.
  • Two copies with one label in one addon's table are <label> and <label>#2.

The build prints where each id came from:

text
swofty.classic-seasons-2016: add-row entrants.vehicles.vehicle_438 (from entrants.vehicles.vehicle[_metadata_=f1_2025_mercedes]): stat_id 512 (the source's is 3; kept from row-ids.json)
swofty.classic-seasons-2016: add-row entrants.vehicles.vehicle_439 (from entrants.vehicles.vehicle[_metadata_=f1_2025_ferrari]): stat_id 513 (the source's is 4; as the last build gave it)
my-addon: add-row entrants.vehicles.vehicle_449 (from entrants.vehicles.vehicle[_metadata_=f1_2025_ferrari]): stat_id 655 (the source's is 4)
my-addon: add-row entrants.vehicles.vehicle_450 (from entrants.vehicles.vehicle[_metadata_=f1_2025_ferrari]): stat_id 737 (the source's is 4; 600, kept for it, is kept for another row or held by a record of the core's registry; from the row's key)
my-addon: add-row entrants.vehicles.vehicle_packages.vehicle_package_90 (from entrants.vehicles.vehicle_packages.vehicle_package_0): stat_id 83 (the source's is 2; no other id up to 254 is free; reused from old-addon/entrants.vehicles.vehicle_packages.vehicle_package/old_era, which this build leaves out)
database: row-ids.json keeps 412 added-row id(s) (11 new)

swofty registry row-ids <addon> lists the ids an addon's rows keep and where each came from:

text
$ swofty registry row-ids my-addon
my-addon: 2 added row(s) keep these stat ids
  entrants.vehicles.vehicle/my_car       655  kept, the next free id in load order when it was added
  entrants.vehicles.vehicle/my_old_car   512  kept, seeded from a profile's last build or a game session from before 1.6.10

The game keeps the id of some tables in one byte, and of game setup modes and seasons as a bit of a 32-bit mask. A copy into one of them never gets an id above the table's highest:

TableHighest stat_id
entrants.vehicles.vehicle_packages.vehicle_package_N254
entrants.drivers.driver_N16382
entrants.vehicles.vehicle_N16382
entrants.teams.team_N16382
entrants.engines.Engine_N254
entrants.characters.character_N254
entrants.animation.driver_animation_sets.driver_animation_set_N254
entrants.entrant_lists.entrant_list_N255
entrants.nationality.nationality_N255
leaderboards.leaderboard_descriptor_N255
game_setup.scenarios.scenario_N (statId)254
game_setup.game_setup_modes.game_setup_mode_N31
game_setup.seasons.season_N (statId)31
entrants.entrant_setup_modes.entrant_setup_mode_N31

A leaderboard descriptor's id is the byte that names the Time Trial board (LBV<id><track><D|W>) and splits the cars and times of the lists that point at it (Leaderboards). A game setup mode or season id above 31 stops the game at boot. A driver id is 16 bits in memory and 14 in saves and net messages, so 16382 is the highest; vehicle and team ids are packed the same way in the game's keys; a copy takes 208 to 253 first, then 256 upward.

When the next id above the table's highest would pass it, the copy gets the lowest id above the stock rows' highest that no row holds, and a driver the lowest free id from 208. The build prints it:

text
swofty.classic-seasons-2021: add-row entrants.vehicles.vehicle_packages.vehicle_package_122 (from entrants.vehicles.vehicle_packages.vehicle_package[_metadata_=f1_2025]): stat_id 83 (the source's is 24; 255 is above 254, the highest the game reads)

When no id is free and no addon the build leaves out keeps one, the add-row fails like any op that can't apply. The core allocates registry vehicle packages and entrant lists above the highest id the database ops leave in the table, and registry drivers from the free ids in 208 to 16382, never 254, 255 or an id whose low byte is 0xff (Stat ids). An explicit stat_id near the ceiling leaves the registry fewer ids.

A stat_id in set wins, unless a row an addon added earlier in the build holds that id. The copy then gets an id of its own (Kept ids) that no addon later in the load order sets on a row it adds, references to it by label follow, a [stat_id=<id>] selector later in the same file finds the copy, and the build warns with both addons and both ids:

text
my-addon: stat_id 500 of my_team is taken by their_team from other-addon; the build gave it stat_id 512. The addon's author should leave stat_id out of add-row

A stat_id in set above the table's highest moves the same way, and the build warns:

text
my-addon: stat_id 300 of my_car is above 254, the highest the game reads in entrants.vehicles.vehicle_packages.vehicle_package; the build gave it stat_id 59. The addon's author should leave stat_id out of add-row

A stat_id in set that the core's ids.json keeps for another addon's registry record, in a table whose ids careers hold (teams, vehicles, drivers, driver heads, entrant lists, scenarios), moves the same way, and the build warns:

text
my-addon: stat_id 247 of my_driver is the id careers hold for other-addon/their_driver; the build gave it stat_id 256. The addon's author should leave stat_id out of add-row

A statId in set on a game_setup.scenarios row moves the same way when a row added earlier holds it or it is above 254, and [statId=<id>] selectors follow. A scenario copy without a statId in set keeps its source's.

The conflicts report counts each clash as a database conflict between the two addons. The id a copy moves to depends on the addons before it in the load order, so a career made with one load order expects that order's ids. An id that a stock row holds stays as set. A copy into a nested table, such as an entrant of an entrant list, keeps its source's id; the build prints a line when the nested table's ids were all different.

Unlock items ​

The rows of unlockable_content.unlockable_items.unlockable_item_list_<n>.folder_<m>.<kind> (unlockable_livery, unlockable_se_livery, unlockable_decal_set, unlockable_suit and every other kind) carry a statId that must be unique within the unlock list, across all its folders and kinds (Sponsors). Leave statId out of set and the launcher gives the row one:

An add-row into an unlock folderstatId of the copy
no statId in setthe id the install keeps for the row, else a free one (Kept ids)
"stat_id": "keep" and no statId in setthe source row's
a statId in set that no row of the list holdsas set
a statId in set that a stock row or a row added earlier holdsa free one, with a warning

A free id is the lowest from 10000 (or above the list's highest stock id, should that ever pass 10000) up to 65535 that no row of the list holds, no addon later in the load order sets on an unlock row of the list, row-ids.json keeps for no other row, and the core's ids.json holds for no registry livery's unlock row (livery.unlock, one pool for all lists, Liveries). Ids from 10000 stay clear of the game: an update adds its unlock rows right above the highest stock id, as Steam build 26566308 added toro_rosso_barcelona_26 with 5280. Each unlock list is its own id space, so a decal set added to lists 1 and 2 can get the same id in both. When no id up to 65535 is free, the row takes an id kept for an addon the build leaves out, then the add-row fails.

The id is kept in row-ids.json under <addon>/<list>.unlockable_item/<kind>/<label>, for example my-addon/unlockable_content.unlockable_items.unlockable_item_list_2.unlockable_item/unlockable_se_livery/my_livery, so it stays the same at every build, whatever the profile, the load order or the other addons, and moving the row to another folder keeps it. The build prints where each id came from:

text
my-addon: add-row unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery_22 (from unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery[_metadata_=toro_rosso_miami_26]): statId 10000 (the source's is 5274)
my-addon: add-row unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery_22 (from unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery[_metadata_=toro_rosso_miami_26]): statId 10000 (the source's is 5274; kept from row-ids.json)

A statId in set that another row of the list holds moves, unlike a stat_id a stock row holds: two unlock rows with one id hide each other, and a game update can give a stock row the id an addon picked. The copy gets an id of its own, kept from then on, a [statId=<id>] selector later in the same file finds the copy, and the build warns:

text
my-addon: add-row unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery_22 (from …): statId 5280 is taken by unlockable_content.unlockable_items.unlockable_item_list_2.folder_23.unlockable_se_livery_21 (toro_rosso_barcelona_26); statId 10000
my-addon: statId 5280 of my_livery is taken by toro_rosso_barcelona_26 from the game; the build gave it statId 10000. The addon's author should leave statId out of add-row
my-addon: statId 5281 of my_livery is taken by f1_sticker from other-addon; the build gave it statId 10001. The addon's author should leave statId out of add-row

A clash with another addon's row counts as a database conflict between the two addons. A statId below 0 or one that is not a number stays as set.

An unlockable_se_livery row added to an unlockable_content.unlockable_items.unlockable_item_list_<n>.folder_<m> table, by add-row or by put-record, unlocks the new special livery. The build writes the row's ownership key, the djb2 hash of eSELivery and the row's _metadata_, to the owned_items block of swofty/settings.json, and swofty_core.dll reports that key as owned to the livery picker. A key that any stock database value also gives is left out with a warning.

What a copy does not bring along ​

add-row copies the source row's keys. The game also finds data for a row by its label, by a name built from the label or from a field, or by its stat_id, in other tables and in game files. A copy under a new label gets none of that data. The game then reads stock defaults, a missing row or a missing resource for it, often without an error: the car runs, but on the wrong setup.

  • Rows of another table labelled with the source's label, found by their own label. Teams: showroom.teams_history.team_history, f1_world.fan_zone.fz_choices_stings.FZChoicesStings (williams_26).
  • Rows of another table that name the source in a field, found by a field value or list of each row, every row read. Teams: pit_lane.pit_times.team_pit_times, by team. Game setup modes: game_setup.branding.game_setup_branding and track_data.game_setup.TrackDataSet, by game_setup_modes.
  • Rows labelled with a name built from the source: a folder name, the label plus a suffix, a field value. Vehicle packages: car_setup.presets.vehicle_package_setups_N, labelled with the package folder f1_2025_vehicle_package, the first folder of resource_path.
  • Values elsewhere that name the source: other rows hold the source's label or stat_id. Vehicles: entrants.entrant_lists.entrant_list_N.entrant_N.vehicle, showroom.vehicle_offsets.vehicle_offset_N.vehicle, showroom.vehicles_history.vehicle_history_N.vehicle. Vehicle packages: entrants.vehicles.vehicle_N.vehicle_package.
  • Game files named after the source: paths built from the label or a field. Vehicle packages: the car template's CarPhysics2.baseVtfAsset and Tyres defaults name eaid://f1_2025_vehicle_package/.... Vehicles: per-track AI data at environment_package/tracks/<track>/ai/<ai_package_folder>/<asset_filename>/.
  • Keys of the source the catalogue does not name: paths the exe builds at run time. Car setup presets: 420 keys per row. Game setup modes: 11 keys under championship_won_cutscene and tyre_regulations, which the swofty_f1 copy lacked until addons/swoftymod/db/core.json listed them in a fields list. Both are in the catalogue from launcher 1.4.0. Customisation items: colour_1_default to colour_4_default; see Colour defaults of customisation items.

Car setups of a vehicle package ​

On session start the game finds a vehicle package's car setups with the row lookup car_setup.presets.vehicle_package_setups[_metadata_=<package folder>] (reader 0x140c04fd0) and reads <row>.<ai|player>.<variant>.<slider>:

  • variants: max_downforce, med_downforce, balanced, med_speed, max_speed;
  • sliders: the 42 labels of car_setup.sliders.slider_N, such as ballast, brake_bias, front_suspension_height and rear_suspension_height.

Each stock row holds these 420 keys and its _metadata_. A copy of f1_2025 with the folder cs_2019_vehicle_package needs a preset row of its own:

json
{ "op": "add-row", "table": "car_setup.presets",
  "from": "car_setup.presets.vehicle_package_setups[_metadata_=f1_2025_vehicle_package]",
  "set": { "_metadata_": "cs_2019_vehicle_package" } }
text
preset row for the copy   in game
none                      the AI drives setups that ground the car: plank contacts, sparks, running wide
_metadata_ only           loading the session crashes (a read at index -1)
all 421 keys              the copy drives its source's setups

Launchers before 1.4.0 copy only the catalogued _metadata_; give the op a fields list of the 421 keys for them.

Colour defaults of customisation items ​

Every row of these tables holds the four keys colour_1_default, colour_2_default, colour_3_default and colour_4_default, of tag 11 (colour). No row holds a colour_0_default or a colour_5_default.

TableRows
customisation.custom_avatar.suits.Suit_N362
customisation.custom_avatar.gloves.Gloves_N362
customisation.custom_avatar.helmets.Helmet_N279
customisation.custom_avatar.tops.Tops_N360
customisation.custom_avatar.trousers.Trousers_N110
customisation.custom_avatar.casual_footwear.CasualFootWear_N49
customisation.custom_avatar.casual_headwear.CasualHeadwear_N94
customisation.custom_avatar.eyewear.Eyewear_N29
  • Most stock rows hold empty text, which the game parses with atoi as 0. Customisable designs hold signed 32-bit ARGB numbers, such as -1710619 (#e5e5e5).
  • At boot, Sess_Apply_ContentAvailability calls Game_Build_CustomisationCatalogue (0x1414059c0). It builds the four names from the format string colour_%u_default and reads each of them on every row with Gdb_Get_FieldInt, with no check for a missing key (0x1414078f2 to 0x1414078fa for gloves, the same for the other tables). A row that lacks any of the four crashes the game at boot with an access violation at F1_25.exe+0x14078fa.
  • A customisable suit design gives an AI driver's suit its colours from colour_1_default to colour_3_default. An AI driver in tier01_livery76 wears its #e5e5e5, #0e3858 and #ffb43f (-1710619, -15845288, -19393).
  • add-row copies the four keys of any of these rows, empty text included, and swofty_core applies a copied empty value as the game's 0. Launcher 1.4.0 and earlier copy them only from a fields list, and on the runtime route their swofty_core ignores the empty values: edit … ignored: an int needs integer text (the game parses it with atoi), got ''.

Team kit of a special livery ​

Every row of customisation.custom_se_liveries.se_liveries holds a team_customisation: the label of a team kit row, entrants.team_customisation.team_customisation_for_year_N.team_customisation_M. The 21 stock rows name kits such as 2025-mclarensilverstone and 2026-tororosso.

  • A kit label is not the car's folder name. The 2026 kits of Alpine, Aston Martin, Racing Bulls and Cadillac are 2026-renault, 2026-forceindia, 2026-tororosso and 2026-cadillac; their car folders are lotus, force_india, toro_rosso and gm_cadillac.
  • At boot, Sess_Apply_ContentAvailability (0x1413e4cf0) reads each row's team_customisation and skips the row when it is empty (0x1413e9764). Otherwise it finds the kit row with that label, by strcmp over every year (0x1424aca70), and reads the kit's official_driver_customisations with no check for a kit it did not find (0x1413e9785 to 0x1413e9797). A row that names no kit crashes the game at boot with an access violation at F1_25.exe+0x13e9797.
  • Game_Build_CustomisationCatalogue (0x1414059c0) reads the same value and also skips an empty one (0x1414173a0).
  • The build checks every special livery row after all database operations. It empties a team_customisation that labels no kit row, and warns with the addon that wrote the value:
text
More Liveries: special livery lotus_lx02 has team_customisation 2026-lotus, and entrants.team_customisation has no row with that label; the value is left empty (the game crashes at start-up on a team kit it cannot find)

Take the label from the kit row whose linked_team is the car's team.

The side-data check ​

After every addon's operations ran, the build checks each add-row whose copy has a new label, against the built database. A finding is one of three kinds:

  • Known lookup: a lookup a reverse-engineered reader makes, listed below. A warning per lookup and addon.
  • To review: a name or value match with no known reader. One warning per addon with the count.
  • Out of area: a match in a table of a game area the copy does not reach by default. Listed only.

swofty build --side-data lists every finding after the warnings, tagged [known], [review], [ignored] or with its area, such as [career]. The warnings do not fail the build, even with "strict": true.

Known lookups ​

  • A copy of entrants.vehicles.vehicle_packages.vehicle_package_N: the game looks up the car_setup.presets.vehicle_package_setups row labelled with folder 1 of resource_path, in Car_Load_SetupPreset (0x140c04fd0). Without it, the AI drives setups that ground the car.
  • A copy of game_setup.game_setup_modes.game_setup_mode_N: the game_setup.branding.game_setup_branding rows whose game_setup_modes list the mode, in 0x142a12f80. Without them, no branding: logos and flags such as car_setup_available and mfd_enabled.
  • A copy of game_setup.game_setup_modes.game_setup_mode_N: the track_data.game_setup.TrackDataSet rows whose game_setup_modes list the mode, in 0x142e44b50. Without them, no per-track data set.
  • A copy of entrants.teams.team_N: the pit_lane.pit_times.team_pit_times row whose team names the team, in 0x1434c8bf0 (the pit lane system). Without it, other pit stop times.

A copy whose name for the lookup is the source's, such as a vehicle package copy that keeps its resource_path, finds the source's row and gets no finding.

text
Classic Seasons: F1 2019: car_setup.presets.vehicle_package_setups has a row labelled f1_2025_vehicle_package and none labelled cs_2019_vehicle_package; f1_2025_vehicle_package is folder 1 of resource_path of the add-row vehicle package entrants.vehicles.vehicle_packages.vehicle_package[_metadata_=f1_2025], and Car_Load_SetupPreset (0x140c04fd0) reads the package's car setups from that row on session start: without it the AI drives setups that ground the car. Add a row per copy, such as an add-row into car_setup.presets.vehicle_package_setups from car_setup.presets.vehicle_package_setups[_metadata_=f1_2025_vehicle_package] that sets _metadata_

Matches to review ​

  1. The check lists the names the game can derive from the source row: the label, the label plus the table's row word (f1_2025_vehicle_package), identifier values of the row's fields (asset_filename, ai_package_folder), and the folders of path values that hold the label or a digit (resource_path). It keeps the names the copy changed.
  2. For each such name, it finds rows labelled with it in other tables, and reports each table that has no row labelled with one of the copy's names from the same fields. A copy that keeps a field value, such as ai_package_folder, still reaches the rows labelled with it, except when the source's label or label plus row word gives the same name.
  3. It finds values elsewhere that name the source by its label, or by its stat_id in an id field named after the source's table (team_id), and reports each field that never names the copy. When rows of other tables share the source's label, it counts only fields named after the source's table or whose catalogue meaning names it.

It leaves out:

  • the table the copy went into, and rows under the source and the copy;
  • tables covered by a known lookup for the copy;
  • a field value that names another row, such as an entrant's driver, when the copy's value labels a row of a table where the source's value labels one too: that row's own copy is checked;
  • rows labelled with the label of another add-row source of the build in the same table, such as entrants.vehicles.vehicle_packages.vehicle_package[_metadata_=f1_2025] for an entrant list copied from f1_2025;
  • values inside copies the same addon made that still name the source, such as a package copy's ai_package_folder.

It groups the findings per table or field and addon. The copies SwoftyMod adds get no findings.

text
Classic Seasons: F1 2019: 23 side-data finding(s) to review, matched by name with no known reader: rows labelled with a source's name in animation.team_data.teamData, audio.audio_bundle_settings.audio_bundle_settings, beta.team_colours.teamColours and 15 more and none for the copy; values naming a source in 16 field(s) and none naming the copy. swofty build --side-data lists them; list reviewed ones in the op file's side_data.ignore

Game areas ​

A match in a table under one of these prefixes is listed only, unless the addon made an add-row copy into a table of the same area:

AreaTable prefixes
careeraccolades, bank, career, challenge_career, driver_academies, driver_contracts, driver_market, emails, engine_management, facilities, invitational_events, news, personal_development, pit_crew_training, press_interviews, recognition, resource_points, rivals, specialist_manager, sponsors
story modestory_mode, driver_statistics.story_mode_driver_statistics
F1 Worldf1_world, second_worlds, f1cg, auction
onlineleaderboards, online_systems, entitlements, paddock_pass, options_system.options.multiplayer, options_system.context, options_system.restrictions
front endshowroom, f1_life, videos
customisationcustomisation, unlockable_content
unnamedtop-level names the catalogue does not know, written {<hash>}

Acknowledging findings ​

side_data.ignore at the top of an op file lists the tables and fields whose findings you reviewed, for the copies the file makes:

json
{
  "schema_version": 1,
  "side_data": { "ignore": ["bank.*", "engine_management.driver_wear_rates.driver_wear_rate"] },
  "ops": []
}

A pattern is a dotted table path (<container>.<row word>) or field path, as the findings print them, with or without row numbers and _N; * matches any run of characters. accolades.AccoladeDataGroup.driver_data.AccoladeDriver and accolades.AccoladeDataGroup_N.driver_data.AccoladeDriver_N are the same pattern. A pattern covers known lookups too. Acknowledged findings are listed with [ignored]. A pattern that matches no finding gives a warning. An unknown key under side_data, or a pattern that is not a path, fails the build like other op-file errors.

Before you copy ​

swofty db deps <row> prints the same data for a stock row: the derived names, the known lookups with the row each finds, the rows of other tables labelled with each name, and the fields whose values pick the row, each tagged with its area:

sh
swofty db deps "entrants.vehicles.vehicle_packages.vehicle_package[_metadata_=f1_2025]"

cargo run -p swofty-core --example check_add_rows -- --game <F1 25 folder> --addon <addon folder> prints the check for one addon with the completeness check.

Keys the catalogue does not name ​

A key whose path only the exe builds stays out of the catalogue until tools/gamedb/compositions.txt lists it, and add-row then copies it without a fields list. A name the exe prints from one format string with one or two integer conversions, such as colour_%u_default, needs no line there for add-row: the row_keys generator expands the exe's format strings. tools/gamedb/catalog.py does not, and names such a key only from a compositions.txt line. tools/gamedb/deepkeys.py finds such keys under a row; see Finding unnamed keys.

Selecting rows ​

A path names a row by its index or finds it by a field. Any segment of the path can be a selector, Name[field=value]:

text
tracks.Track_3                                                                  the row at index 3
entrants.teams.team[_metadata_=gm_cadillac_26]                                  the team with this label
track_data.game_setup.TrackDataSet[_metadata_=f1_2026].TrackData[_metadata_=melbourne]
                                                                                Melbourne's row in the f1_2026 dataset
{446668bc25ba571c}[_metadata_=f1_26]                                            a row in a table whose full path is unknown

Selectors resolve left to right, each one beneath the rows already chosen. A selector reads the table's rows up to its _instancecount_, or up to the first row without a _metadata_ when the table has no count, and must match exactly one row. Otherwise the build fails and names the segment:

text
track_data.game_setup.TrackDataSet[_metadata_=f9]: no row matches
track_data.game_setup.TrackDataSet[_metadata_=f1_2026].TrackData[_metadata_=okayama]: no row matches in track_data.game_setup.TrackDataSet_16.TrackData
entrants.teams.team[display_name_code=WIL]: 2 rows match

Values are unquoted and can contain . and [. A value ends at the first ] that ends the path or comes before a ..

Selectors work in select, field, value_from, add-row's table and from, and the key of put-record and remove-record. A {hash} placeholder goes only at the start of a path; selectors can follow it.

Use labels where possible. Row numbers can change between game builds. The dataset rows under track_data.game_setup are listed in A track with its own name.

The row-count rule ​

Adding a row also updates the table's _instancecount_. The game ignores rows beyond this count. A new row needs every key a stock row of the table has, which add-row copies; see Key names and Adding a row.

add-row raises the count of the table table resolves to. Adding to track_data.game_setup.TrackDataSet[_metadata_=f1_2026] raises track_data.game_setup.TrackDataSet_16._TrackData_instancecount_.

add-row needs the table's real path, written with row numbers or selectors. A {hash} placeholder can be used for set, but not for add-row.

A mod made for an earlier game version can lower a count and leave stock rows above it. add-row writes the new row over those stock keys and the build prints reuses N stock key(s) of a row above the table's count. A key another addon wrote at the new row's number still fails the op with already exists.

Rows SwoftyMod adds ​

SwoftyMod adds two rows labelled swofty_f1, copies of the stock f1 rows, before any addon's operations run:

  • a game setup mode in game_setup.game_setup_modes, with stat_id 20 and the swofty_f1 entrant setup mode;
  • an entrant setup mode in entrants.entrant_setup_modes, with empty entrant_lists and selectable_entrant_lists.

Every stock list of game setup modes that holds f1 also holds swofty_f1, except the lists of the championships (championships.Championship_N: the careers and Braking Point), which keep their one setup mode. A SwoftyMod change that does not apply to the database is skipped with a warning. An addon adds its entrant lists to the mode with list-append:

json
{ "op": "list-append", "select": "entrants.entrant_setup_modes.entrant_setup_mode[_metadata_=swofty_f1]",
  "field": "entrant_lists", "value": "my_entrant_list" }

Settings ​

A db option changes operations at build time:

  • {{id}} in any string is replaced with the option's value: true or false, the number, or the choice value.
  • "when": { "id": value } keeps the operation only when every listed option has that value.
  • "addon" in a when keeps the operation only while that addon is on in the profile and the build: an addon id, { "id", "version" } with a semver range, or a list of them that must all be on. It combines with the option values.
  • A when at the top of the file applies to every operation in it.
json
{ "op": "set", "select": "rules.stop_go_penalty", "field": "penalty_duration", "value": "{{penalty_seconds}}" },
{ "op": "set", "select": "entrants.teams.team[_metadata_=gm_cadillac_26]", "field": "display_name_code", "value": "CAD",
  "when": { "short_names": true } },
{ "op": "set", "select": "f2.calendar.round[_metadata_=round_6]", "field": "track", "value": "istanbul_park",
  "when": { "addon": "track.istanbul_park", "istanbul_park": true } }

A bad addon value fails the build and names it:

text
miguelvf3.f2-revamp: when.addon: "Istanbul Park" is not an addon id
miguelvf3.f2-revamp: when.addon: "versoin" is not a key of an addon; use id and version

A toggle with needs reads as off while an addon it needs is off. Content that needs another addon has a full example. A launcher before 1.9.34 fails the build on addon in a when and on a when at the top of a file.

Changing a db option marks the profile for a rebuild. The next launch, or swofty build, applies it.

Applying changes ​

Track activation runs first, then operations run in addon load order. DB Editor packages are addons and run in the same order; a package change that no longer applies is skipped with a warning instead of failing the build:

text
warning: My DB Edits: change skipped: entrants.teams.team[_metadata_=williams_26]: no row matches, even after every addon's changes

An addon whose track the build leaves out has its failing database ops skipped the same way.

An op whose selector matches no row waits, with the ops after it in its file that fail. It applies right after the first later addon whose ops add records, once its row exists, and the addons after that still override it. A Team Simplified Grid Editor edit of a grid Classic Seasons adds applies this way, though Team Simplified loads first, and swofty conflicts lists the edit as the winner over Classic Seasons on the fields it sets.

An op still waiting after every addon fails the build. A DB Editor package's op, or one of an addon whose track the build leaves out, is skipped with the warning above instead:

text
applying teamsimplified.mods (grid-editor): entrants.entrant_lists.entrant_list[_metadata_=cs_f1_2016]: no row matches, even after every addon's changes

A later change to a field replaces the earlier value, and the build prints the conflict (Order and conflicts). With the in-game loader, the changed records reach the game through swofty/assets.json (Build route and runtime route).

See Game database (GVDB) for the file format, how the game reads it and the table catalogue. Modding recipes covers adding rows, grid size and tracks.