Skip to content

Compact Types

Compact types encode structured data into a single cell using a concise text format. Each compact type defines its own element types, cell-filling syntax, and export encoding.

Category Regular Table Property Sheet Tree-Structured Data
Compact Types ✓ ✓
Type Description
>>[]T Compact array View
>>[N]T Fixed-size compact array View
>>map[K]V Compact map View
>>object Compact object View
>>minmax Compact minmax View
>>wtpool Compact weighted pool View
>>vector Compact vector View
>>tuple Compact tuple View
  • Separate element values with |. Quote any value containing |.
  • Two default export value shorthands are supported: / exports null; {} exports an empty container or a zero-valued object.
  • There is no way for fields or elements to define their own default export values.

A compact array stores a variable-length array within a single spreadsheet cell.

Desc---
Namelevelsrewardsnames
Type>>[]int>>[]float=/>>[]string={}
110|20|301.5|2.0sword|shield|bow
25|10
>>[]T

T can be any Basic Type, except for rgba.

>>[]string
>>[]int
>>[]float

Separate element values with |. Quote any value containing |. An empty slot between | takes the zero value of the element type (e.g., a||c, ||).

10|20|30
foo|bar|`hello|world`
>>[]int → no default export value
>>[]int=/ → null
>>[]int={} → empty array []

See Default Export Value for more information.

A compact array of fixed length — exactly N elements.

Desc--
Nameweightscoord
Type>>[3]float>>[2]int=/
10.3|0.59|0.1112|7
21.0|0.0|0.0
>>[N]T

T can be any Basic Type, except for rgba.

>>[3]float
>>[2]int
>>[4]duration

Same as >>[]T, except a cell must contain exactly N element values.

Separate element values with |. Quote any value containing |. An empty slot between | takes the zero value of the element type (e.g., a||c, ||).

10|20|30
foo|bar|`hello|world`
>>[3]int → no default export value
>>[3]int=/ → null
>>[3]int={} → [0, 0, 0]

See Default Export Value for more information.

A compact map stores key-value pairs within a single spreadsheet cell.

Desc--
Nametroopsdrops
Type>>map[string]int>>map[int]int=/
1warrior:10|mage:20|archer:30101=>2|102=>5
2warrior:5
>>map[K]V

K must be string, an integer type, or an enum type; V must be a Basic Type.

>>map[string]int
>>map[int]int

K cannot have any options.

Separate each key and value with : or =>. Separate pairs with |. Quote any key containing :, =>, or |, and any value containing |.

warrior:10|mage:20|archer:30
101=>2|102=>5
>>map[string]int → no default export value
>>map[string]int=/ → null
>>map[string]int={} → empty map {}

See Default Export Value for more information.

Allowed only for maps whose value type is bool.

keyOnly → equivalent to keyOnly=true
keyOnly=true

When enabled:

  • The input syntax collapses to a |-delimited key list.
  • Omitted map values are coerced to true.

This semantically “turns” a map into a set — yet still it exports as a map.

Desc-
Nameskill-set
Type>>map[string]bool
OptionskeyOnly
1fireball|heal|dash
2fireball

A compact object stores a record with named fields within a single spreadsheet cell.

Desc--
Namestatsreward
Type>>object|Hp int|Mp int|Name string>>object|Id int|Qty(q) int={}
1Hp:100|Mp:50|Name:warriorId:101|q:3
2Hp=>120|Name=>mage
>>object|Name0 T0|Name1 T1|...

All field types (T0, T1, …) must be Basic Types.

>>object|Hp int|Mp int|Name string
>>object|Id int|Qty(q) int

Separate each name and value with : or =>. Separate fields with |. Fields with zero values can be omitted. Unknown fields cause an error.

Hp:100|Mp:50|Name:battleMage
Hp=>100|Name=>warrior

Field names may define a shorthand to reduce typing effort. Append (shorthand) to the field name (e.g., >>object|Qty(q) int). When configuring data, the shorthand may be used in place of the field name (e.g., q: 10 instead of Qty: 10).

>>object|Hp int|Mp int → no default export value
>>object|Hp int|Mp int=/ → null
>>object|Hp int|Mp int={} → {Hp: 0, Mp: 0}

See Default Export Value for more information.

On data export, Archmage emits all declared fields; missing fields take their zero values.

A compact minmax stores a min-max pair within a single spreadsheet cell.

Desc--
NamehpRangedmgRange
Type>>minmax|int>>minmax|float=/
110|201.5|3.0
25|5
>>minmax|T

T must be an integer type, a floating-point type, or duration.

>>minmax|int
>>minmax|float32
>>minmax|int64
>>minmax|duration

Exactly two values — min and max — are required, separated by |.

10|20
1.5|3.0
1s|2h
>>minmax|int → no default export value
>>minmax|int=/ → {min: 0, max: 0}
>>minmax|int={} → {min: 0, max: 0}

See Default Export Value for more information.

On data export, a minmax becomes an object with min and max fields.

A compact weighted pool encodes a sequence of item-weight pairs within a single spreadsheet cell.

Desc---
NamedropPoollootPoolpet-pool
Type>>wtpool|string>>wtpool|int=/>>wtpool|ref@pet={}
1gold:50|gem:10|nothing:40101=>5|102=>3slime:10|dog:5|cat:5|snake:1
2gold:100
>>wtpool|T

T is the item type. It can be any Basic Type, except for rgba. Any l10n value in the pool must be an empty string or an l10n reference.

Weights are int32 values; the data type is fixed and never needs to be specified.

>>wtpool|string
>>wtpool|int
>>wtpool|ref@pet

The weight cannot have any options.

Separate each item and weight with : or =>. Separate pairs with |. Quote any item containing :, =>, or |. The same item may appear more than once.

gold:50|gem:10|nothing:40
101=>5|102=>3
slime:10|dog:5|cat:5
>>wtpool|int → no default export value
>>wtpool|int=/ → null
>>wtpool|int={} → empty pool {items: [], weights: []}

See Default Export Value for more information.

On data export, a weighted pool becomes an object with two parallel arrays, items and weights. Each weight corresponds to the item at the same index.

A compact vector stores a geometric vector within a single spreadsheet cell.

Desc---
Nameposscalecolor
Type>>vector|2|int>>vector|3|float32=/>>vector|4|int32={}
110|201.0|1.0|1.0255|0|0|255
25|8
>>vector|Dim|T

Dim must be 2, 3, or 4; T must be an integer or a floating-point type.

>>vector|2|int
>>vector|3|float32
>>vector|4|int32

Element values are positional, separated by |. Exactly Dim values are required. An empty slot between | takes the zero value of the element type (e.g., 1||3, ||).

1|2
1|2|3
1|2|3|4
>>vector|3|float → no default export value
>>vector|3|float=/ → {x: 0, y: 0, z: 0}
>>vector|3|float={} → {x: 0, y: 0, z: 0}

See Default Export Value for more information.

On data export, a vector becomes an object with x and y fields, extended with z and w according to Dim.

A compact tuple stores a positional struct within a single spreadsheet cell.

Desc--
Nameentrypair
Type>>tuple|int|string|bool>>tuple|int|int=/
1100|warrior|true3|7
2100||true
>>tuple|T0|T1|T2|...

All field types (T0, T1, …) must be Basic Types. At most seven fields are permitted, and rgba may not appear as the first field.

>>tuple|int|string|bool
>>tuple|datetime|duration

Field values are positional, separated by |. Zero-value fields can be omitted, so long as the | separators remain.

100|warrior|true
100||true
>>tuple|int|string|bool → no default export value
>>tuple|int|string|bool=/ → null
>>tuple|int|string|bool={} → {item0: 0, item1: "", item2: false}

See Default Export Value for more information.

On data export, Archmage represents tuples as objects. Keys follow the pattern item0, item1, item2, and so on.