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.
Type Availability
Section titled “Type Availability”| Category | Regular Table | Property Sheet | Tree-Structured Data |
|---|---|---|---|
| Compact Types | ✓ | ✓ |
Type List
Section titled “Type List”| 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 |
Common Rules
Section titled “Common Rules”- Separate element values with
|. Quote any value containing|. - Two default export value shorthands are supported:
/exportsnull;{}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 | - | - | - |
| Name | levels | rewards | names |
| Type | >>[]int | >>[]float=/ | >>[]string={} |
| 1 | 10|20|30 | 1.5|2.0 | sword|shield|bow |
| 2 | 5|10 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>[]TT can be any Basic Type, except for rgba.
>>[]string>>[]int>>[]floatValue Syntax
Section titled “Value Syntax”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|30foo|bar|`hello|world`Default Export Value
Section titled “Default Export Value”>>[]int → no default export value>>[]int=/ → null>>[]int={} → empty array []See Default Export Value for more information.
Related Types
Section titled “Related Types”>>[N]T
Section titled “>>[N]T”A compact array of fixed length — exactly N elements.
| Desc | - | - |
| Name | weights | coord |
| Type | >>[3]float | >>[2]int=/ |
| 1 | 0.3|0.59|0.11 | 12|7 |
| 2 | 1.0|0.0|0.0 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>[N]TT can be any Basic Type, except for rgba.
>>[3]float>>[2]int>>[4]durationValue Syntax
Section titled “Value Syntax”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|30foo|bar|`hello|world`Default Export Value
Section titled “Default Export Value”>>[3]int → no default export value>>[3]int=/ → null>>[3]int={} → [0, 0, 0]See Default Export Value for more information.
Related Types
Section titled “Related Types”>>map[K]V
Section titled “>>map[K]V”A compact map stores key-value pairs within a single spreadsheet cell.
| Desc | - | - |
| Name | troops | drops |
| Type | >>map[string]int | >>map[int]int=/ |
| 1 | warrior:10|mage:20|archer:30 | 101=>2|102=>5 |
| 2 | warrior:5 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>map[K]VK must be string, an integer type, or an enum type; V must be a Basic Type.
>>map[string]int>>map[int]intK cannot have any options.
Value Syntax
Section titled “Value Syntax”Separate each key and value with : or =>. Separate pairs with |. Quote any key containing :, =>, or |, and any value containing |.
warrior:10|mage:20|archer:30101=>2|102=>5Default Export Value
Section titled “Default Export Value”>>map[string]int → no default export value>>map[string]int=/ → null>>map[string]int={} → empty map {}See Default Export Value for more information.
Option keyOnly
Section titled “Option keyOnly”Allowed only for maps whose value type is bool.
keyOnly → equivalent to keyOnly=truekeyOnly=trueWhen 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 | - |
| Name | skill-set |
| Type | >>map[string]bool |
| Options | keyOnly |
| 1 | fireball|heal|dash |
| 2 | fireball |
{ "1": { "skill-set": { "fireball": true, "heal": true, "dash": true } }, "2": { "skill-set": { "fireball": true } }}Related Types
Section titled “Related Types”>>object
Section titled “>>object”A compact object stores a record with named fields within a single spreadsheet cell.
| Desc | - | - |
| Name | stats | reward |
| Type | >>object|Hp int|Mp int|Name string | >>object|Id int|Qty(q) int={} |
| 1 | Hp:100|Mp:50|Name:warrior | Id:101|q:3 |
| 2 | Hp=>120|Name=>mage |
Type Definition Syntax
Section titled “Type Definition Syntax”>>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) intValue Syntax
Section titled “Value Syntax”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:battleMageHp=>100|Name=>warriorField Shorthand
Section titled “Field Shorthand”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).
Default Export Value
Section titled “Default Export Value”>>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.
Export Format
Section titled “Export Format”On data export, Archmage emits all declared fields; missing fields take their zero values.
Related Types
Section titled “Related Types”>>minmax
Section titled “>>minmax”A compact minmax stores a min-max pair within a single spreadsheet cell.
| Desc | - | - |
| Name | hpRange | dmgRange |
| Type | >>minmax|int | >>minmax|float=/ |
| 1 | 10|20 | 1.5|3.0 |
| 2 | 5|5 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>minmax|TT must be an integer type, a floating-point type, or duration.
>>minmax|int>>minmax|float32>>minmax|int64>>minmax|durationValue Syntax
Section titled “Value Syntax”Exactly two values — min and max — are required, separated by |.
10|201.5|3.01s|2hDefault Export Value
Section titled “Default Export Value”>>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.
Export Format
Section titled “Export Format”On data export, a minmax becomes an object with min and max fields.
Related Types
Section titled “Related Types”>>wtpool
Section titled “>>wtpool”A compact weighted pool encodes a sequence of item-weight pairs within a single spreadsheet cell.
| Desc | - | - | - |
| Name | dropPool | lootPool | pet-pool |
| Type | >>wtpool|string | >>wtpool|int=/ | >>wtpool|ref@pet={} |
| 1 | gold:50|gem:10|nothing:40 | 101=>5|102=>3 | slime:10|dog:5|cat:5|snake:1 |
| 2 | gold:100 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>wtpool|TT 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@petThe weight cannot have any options.
Value Syntax
Section titled “Value Syntax”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:40101=>5|102=>3slime:10|dog:5|cat:5Default Export Value
Section titled “Default Export Value”>>wtpool|int → no default export value>>wtpool|int=/ → null>>wtpool|int={} → empty pool {items: [], weights: []}See Default Export Value for more information.
Export Format
Section titled “Export Format”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.
Related Types
Section titled “Related Types”>>vector
Section titled “>>vector”A compact vector stores a geometric vector within a single spreadsheet cell.
| Desc | - | - | - |
| Name | pos | scale | color |
| Type | >>vector|2|int | >>vector|3|float32=/ | >>vector|4|int32={} |
| 1 | 10|20 | 1.0|1.0|1.0 | 255|0|0|255 |
| 2 | 5|8 |
Type Definition Syntax
Section titled “Type Definition Syntax”>>vector|Dim|TDim must be 2, 3, or 4; T must be an integer or a floating-point type.
>>vector|2|int>>vector|3|float32>>vector|4|int32Value Syntax
Section titled “Value Syntax”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|21|2|31|2|3|4Default Export Value
Section titled “Default Export Value”>>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.
Export Format
Section titled “Export Format”On data export, a vector becomes an object with x and y fields, extended with z and w according to Dim.
Related Types
Section titled “Related Types”>>tuple
Section titled “>>tuple”A compact tuple stores a positional struct within a single spreadsheet cell.
| Desc | - | - |
| Name | entry | pair |
| Type | >>tuple|int|string|bool | >>tuple|int|int=/ |
| 1 | 100|warrior|true | 3|7 |
| 2 | 100||true |
Type Definition Syntax
Section titled “Type Definition Syntax”>>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|durationValue Syntax
Section titled “Value Syntax”Field values are positional, separated by |. Zero-value fields can be omitted, so long as the | separators remain.
100|warrior|true100||trueDefault Export Value
Section titled “Default Export Value”>>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.
Export Format
Section titled “Export Format”On data export, Archmage represents tuples as objects. Keys follow the pattern item0, item1, item2, and so on.