Skip to content
SheetForge

Sheet syntax

A SheetForge sheet describes itself. Column A is reserved for markers, and the actual data starts at column B. This chapter is the reference for the markers and the type notations a sheet can carry.

A sheet is one table of your data: a file in a local folder, a sheet of an xlsx file, or a tab of a Google spreadsheet. These pages also call it a tab.

In this chapter

This page covers the sheet layout, the markers, keys and uniqueness, and how to compose complex data.

Sheet layout

Rows are identified by their marker, not their position. You can insert comment rows anywhere, and the import still works.

To adapt an existing spreadsheet, insert one marker column in front of your data and add the three required marker rows: @name, @type and @desc. Existing data columns stay as they are.

If you have no sheet yet, create one from a template in the Getting Started window. See Start from a template.

The example shows columns A | B | C | D:

#        | Item definitions — hand-edited by design team
@name    | codeName      | displayName | price
@type    | RecordId      | string      | int=10
@desc    | unique key    | shown in UI | shop price (gold)
         | item.sword    | Sword       | 120
         | item.potion   | Potion      |

The empty price cell of item.potion materializes the explicit default 10.

Markers

Column AMeaning
#Comment row. Ignored entirely, preserved verbatim on round-trip
@nameField-name row, one name per column
@typeField-type row. See Types and defaults
@descDescription row. Codegen bakes it into XML doc comments and inspector tooltips
@overlapPer-column duplicate policy. See Unique values
@styleSheet display metadata: a group label and a color for this sheet. See Sheet groups and colors
@enumMarks the whole sheet as enum definitions rather than a data table. See Enum sheets
@locMarks the sheet as a localization sheet. See Localization sheets
@yourMarkerA custom structural marker that a plugin registers. See Custom structural markers
(empty)Data row

Marker rules

  • @name, @type and @desc are required.
  • @overlap, @style, @enum, @loc and any custom markers are optional.
  • Marker rows may appear in any order, as long as they are above the data rows.
  • An unknown @marker is an error, with the nearest registered name as a suggestion, such as @desc. Registered custom markers join the suggestion pool.
  • Data in a column that has no @name/@type header is an error. This is the orphan-data guard: silent data loss is never allowed.

Keys and uniqueness

A tab may key on RecordId only, IntId only, or both. The three cases behave symmetrically everywhere.

The RecordId key column

A RecordId column with no @ is the key column. A tab holds at most one.

SituationResult
Zero key columnsValid, until another tab references this tab (TargetTabHasNoKey)
Two or more key columnsError (MultipleKeyColumns)
Duplicate key valuesError (DuplicateRecordId)
An empty key cellError

The IntId key column

IntId is a secondary integer key. Its uniqueness is enforced independently, and other tabs can reference it via IntId@Tab.

Integer-key references get the same support as RecordId@Tab: integrity validation, nearest-match suggestions, rename propagation, and the record canvas.

Tabs with both keys

When a tab carries both keys, RecordId is the display and identity value. The integer is shown alongside it.

Another tab can point at the same record either way: RecordId@ThisTab by its string key, or IntId@ThisTab by its integer key.

Unique values

Ordinary columns allow duplicate values by default. The @overlap row sets the policy per column: true allows duplicates and is the default, false enforces value uniqueness.

To enforce uniqueness, put false in the column's @overlap cell. The comparison is value-based:

  • 1.0 and 1 count as the same value.
  • Two lists are duplicates when all elements and their order match.
  • An empty cell in an optional reference column holds an empty reference, which points at nothing. Two empty references are never duplicates of each other.
  • An empty cell in an optional scalar column holds its default, and the default is compared like any other value. Two empty int? cells both hold 0, so they are duplicates.

Key columns are always unique. Writing @overlap true on a key column is a contradiction error.

Localization sheets

An @loc marker row turns the sheet into a localization sheet. Rows are keys and columns are locales. Each locale column's @loc cell names its locale code.

  • The RecordId key column is required. The key value is the localization key.
  • The first locale column is the source locale.
  • Locale columns are string columns. string? is the recommended form, because an empty cell is then a missing translation, not an error.
  • Two optional columns are reserved by name: smart (bool) and comment (string).
@loc     |            | en          | ko    |
@name    | codeName   | en          | ko    | comment
@type    | RecordId   | string?     | string? | string?
@desc    | key        | source text |       |
         | ui.ok      | OK          | 확인  | Confirm button

The sheet stays an ordinary table for editing, Export, Push, xlsx and the web app. What changes is the output:

  • The import generates no record class and no Database ScriptableObject (SO).
  • The import generates per-tab key constants.
  • When the Unity Localization package is installed, the import synchronizes the String Table.

@enum and @loc on the same sheet is a conflict error.

For LocRef references and minting, see Reference text from a data sheet. For the bridge and the translation workflows, see Unity Localization bridge.

Custom structural markers

A plugin can register its own markers. You write a registered marker row the way you write @overlap, the built-in per-column marker: the row carries one value per column, and each value is validated column by column. A plugin's @curve marker, for example, could annotate how each numeric column interpolates.

  • A registered marker row may appear in any order above the data. A duplicate row is rejected, and a marker below the data is an error.
  • The marker validates each column's value and decides what an empty cell means. The Core never interprets the value itself.
  • A custom marker is column-level metadata, not a new data shape. Data shapes stay in normalization: references, List<T> and type columns.

The Data Studio shows the value in the column header tooltip.

To register a marker and read its values from a plugin, see Custom structural markers.

Compose complex data by reference

Normalization comes first. The recommended way to express a complex structure, such as a skill made of several effects, is to split it into small records and join them by reference.

  • Put the smallest reusable records, such as one effect, in a tab of their own, one record per row.
  • Write a combination as a list of references to those records: List<RecordId@Effects>.
  • Give those records a type column that holds an enum. The enum value names the piece of game code that handles the row, and your runtime uses a switch on it to dispatch behavior. No embedded scripting language is needed.

The Plugin Demo is laid out this way. Each row of its ExampleSkills tab lists records of the ExampleEffects and ExampleActions tabs. To open it, see Plugin demo.

Mini-grammars

Mini-grammars are custom cell types like attack:add:10. They are for small tuples. The Core provides the ; and : conventions. Don't overuse them.

Procedural logic

For genuinely procedural one-off logic, reference a script asset the same way you reference an image: List<AssetRef@Scripts>. SheetForge validates the reference and bakes it. Executing the script is your game's job.

In a project that delivers without Addressables, use List<DirectRef> instead.

Special data shapes

Even tricky-looking data, such as level curves, normalizes cleanly with List<float> columns and references between tabs.

Normalize the data first. Reach for a custom structural marker only for genuinely verbose per-column annotations.

Next steps