Builder's Manual · Chapter 1

File Types & Schema Design

This project is built on a set of file types — structured data schemas that define what kinds of content exist and how they relate to each other. Understanding the file types is essential if you want to extend, modify, or build on this system.

The STA File Types

File TypePurposeDesignation
CharacterPlayer characters and key NPCscharacter
SpeciesSpecies definitions with bonuses and abilitieslore
StarshipVessels with systems, departments, shields, hulllocation
EquipmentWeapons, gear, devices, consumablesitem
LocationPlanets, starbases, stations, ship interiorslocation
MissionAdventures, scenes, objectives, rewardsevent

Schema Structure

Each file type has a schema — a JSON Schema definition that specifies which fields exist, their types, constraints, and relationships. The schema enforces data integrity: you can't write a number into a string field, and required fields must be present.

Built-In Fields

Every file type automatically includes these fields (do NOT add them to your schema):

  • name (required) — The display name. Always present.
  • description (optional) — Short blurb shown in cards.
  • image (optional) — Cover image with focal point metadata.

Field Types

TypeUse For
stringText, names, descriptions
numberNumeric values (attributes, scores, costs)
booleanTrue/false flags
enumFixed set of choices (use "enum" on string fields)
objectNested structures (attributes, systems)
arrayLists of items (talents, inventory, scenes)
imageImage fields with picker support

Reference Fields

When a field points at another file, annotate it with referencedFileTypeSlug:

{
  "species": {
    "type": "string",
    "referencedFileTypeSlug": "species"
  }
}

When writing content, use the target file's slug as the value. The platform resolves slugs to durable reference IDs automatically.

Computed Fields

Values that can be derived from other fields should use expressions rather than being stored:

{
  "stressMax": {
    "type": "number",
    "expression": "8 + ($self.attributes?.fitness ?? 7)"
  }
}

Computed fields are read-only — they appear in reads but are rejected on writes. Change the inputs or the expression to affect the computed value.

File Type Design Principles

  1. Store only what can't be derived. If a value can be calculated from other fields or referenced files, it should be a computed expression, not stored data.

  2. Use collections, not numbered fields. talents: [] with maxItems: 8, never talent1, talent2, etc.

  3. Reference, don't copy. If a Character has a Species, reference the Species file — don't duplicate species bonuses into the Character.

  4. Define once, use everywhere. Reusable rules (skill definitions, talent effects, species traits) live on the type that owns them. Characters reference them; they don't copy them.

  5. Stable keys, not display names. Use slug-based keys for maps and lookups. Display names are editable content, not identifiers.

Manual updated Aug 24, 2026.