Skip to main content

Data Tables

Data tables hold a game's rows of balance data: weapons, enemies, loot, levels, upgrade costs. Designers author them in a spreadsheet-like editor window, or paste them in from a spreadsheet, and the game reads them with a key lookup or a query. A second part, the data store, keeps rows that change while the game runs, such as an inventory or a list of unlocks, and saves them through the save game system.

Tables are an engine feature, not a package. Any component, script or package can hold a reference to a row.

Concepts​

Data Schema: The row type: an ordered list of typed columns with defaults and validation rules. Any number of tables share one schema.

Data Table: Rows of one schema. Each row has a unique key such as rifle_mk2. Transforms into one runtime resource.

Data Table Set: An ordered stack of tables with the same schema. Later layers add rows or override single cells: base game, DLC, difficulty, mods.

Data Store: Writable tables at runtime, declared per project. Rows live in a save slot, in the player profile, or only for the session.

TermMeaning
Row keyThe stable identity of a row. Lower-case names without spaces or separators work best (rifle_mk2). Keys are compared by hash, and a table rejects two keys that hash alike. Renaming a key is done from the Usages tab, which fixes references and keeps the old key resolving.
Row referenceA plDataRowRef: a table plus a row key. It is the type of a Row column and the property type a component uses to point at a row.
Derived columnA read-only column computed from the other numeric columns of the same row, e.g. DPS = Damage * FireRate. It is computed when the table is transformed, so it costs nothing at runtime.
Indexed columnA column whose equality queries use a sorted index instead of scanning every row.
LayerOne table of a table set. A layer row with an existing key overrides only the cells it authors, a new key adds a row, and a row marked Removed hides the row below it.
Store scopeProfile: survives across save slots (unlocks, bestiary). Slot: part of one save game (inventory, quest log). Session: never written (run statistics, caches).

How the pieces fit​

  1. Author. Edit rows in the table window, paste a range from a spreadsheet, import a CSV, TSV or JSON file, or link the table to a file that stays the source of truth.
  2. Document. The table is saved as an ordinary editor document with one object per row. A cell that equals its column default is not stored, so a one-cell edit is a one-line diff.
  3. Transform. Saving validates every cell, computes the derived columns, builds indexes and writes a compact columnar file. Errors stop the transform and are listed in the Validation tab.
  4. Runtime. The game loads the table as a plDataTableResource. A key lookup is a binary search, and reading a cell is one offset into a packed column.
  5. Hot reload. While the editor's engine process runs, every edit is pushed to it within half a second, before the table is saved.

In this manual​

PageCovers
Getting startedCreating a schema and a table, adding rows, reading a row from C++ and from Visual Script.
Schemas & column typesEvery column type with its text form, column flags, derived columns, renaming and retyping columns, generated C++ row headers.
The table windowThe Rows, Schema, Import, Validation and Usages tabs, the inspector, bulk edits, the clipboard and the row picker.
Import, linked sources & setsCSV, TSV and JSON import and export, linked source files, table sets and layers.
C++ runtimeLoading tables, lookups, column handles, queries, row references, table sets, hot reload, threads and Text columns.
Data store & savingDeclaring store tables, writing rows, transactions, events, saving to slots and profiles, migration between builds.
Scripting & toolsThe DataTables script functions, the events component, the Live Data panel, the project settings, console commands and cvars.
TroubleshootingCommon errors and what they mean, and the current limitations.