diff --git a/index.html b/index.html index 4604f9f..c331f6e 100644 --- a/index.html +++ b/index.html @@ -6,6 +6,7 @@ SessionZero +
@@ -15,7 +16,6 @@ SessionZero Logo
SessionZero
-
@@ -25,7 +25,8 @@

SessionZero

A TTRPG companion that gets out of your way

- Work in progress—View the source code + Open SessionZero +

⚠️ SessionZero is still in development, but you can still access it while it's being developed! ⚠️

@@ -48,7 +49,7 @@ diff --git a/styles.css b/styles.css index c44e331..0e210a7 100644 --- a/styles.css +++ b/styles.css @@ -167,6 +167,17 @@ footer { margin-top: auto; } +a { + color: var(--accent-color); + text-decoration: none; + transition: color 0.2s ease; +} + +a:hover { + color: var(--text-color); + transition: color 0.2s ease; +} + /* Responsive design */ @media (max-width: 768px) { .hero { diff --git a/szf-docs.html b/szf-docs.html new file mode 100644 index 0000000..984bd62 --- /dev/null +++ b/szf-docs.html @@ -0,0 +1,689 @@ + + + + + + Session Zero Format (.szf) Documentation + + + + + +
+
+ +
+ +
+ + +
+

Session Zero Format (.szf) Specification

+ +
+

Overview

+

The Session Zero Format (.szf) is a structured, human-readable data format for defining and storing tabletop RPG data, including characters, templates, and game assets. It is designed to be simple to write by hand, easy to parse, and flexible enough to support a wide variety of game systems.

+ +

Core Principles

+
    +
  • Human-Readable: The format uses plain text and a clear, indented structure that is easy to read and edit.
  • +
  • Structured & Typed: Data is organized into logical sections with explicitly declared field types defined in templates.
  • +
  • Extensible: The format can be extended with new fields and sections without breaking existing parsers.
  • +
  • Portable: .szf files are self-contained and can be easily shared and used across different platforms.
  • +
+
+ +
+

File Structure

+

Every .szf file consists of three main parts: a Header, a Metadata Section, and one or more Content Sections.

+ + +

The header is mandatory and must be the first two lines of the file. It declares the file type and the schema version.

+ +
!type: [file_type]
+!schema: [schema_version]
+ +
    +
  • !type: Defines the purpose of the file. Valid types are: +
      +
    • dataset: A collection of related game elements (e.g., items, spells).
    • +
    • character_template: A blueprint defining the structure of a character sheet.
    • +
    • character: An instance of a character created from a template.
    • +
    • session: Data related to a specific game session (future use).
    • +
    +
  • +
  • !schema: The version of the .szf specification the file adheres to (e.g., 1.1.0).
  • +
+ +

Sections

+

Data is organized into named sections. Sections create a hierarchical structure for organizing related fields.

+

Syntax: [SectionName]

+

SectionName must be a single word, is case-sensitive, and must use PascalCase (e.g., AbilityScores, CharacterInfo).

+ +

Nested Sections

+

Sections can be nested to create a logical hierarchy. The dot (.) notation is used to define a parent-child relationship.

+

Syntax: [ParentSection.ChildSection]

+ +
[AbilityScores]
+Strength (number) = 10
+
+[AbilityScores.Modifiers]
+StrengthMod (calculated) = (AbilityScores.Strength - 10) / 2
+ +

Fields

+

Fields represent individual pieces of data within a section. Each field has a name, a type, and a value.

+

Syntax: FieldName (type) = value

+ +
    +
  • FieldName: The name of the field. Must be a single word, is case-sensitive, and must use PascalCase.
  • +
  • (type): The data type of the field, enclosed in parentheses.
  • +
  • =: The assignment operator.
  • +
  • value: The data assigned to the field.
  • +
+ +

Comments

+

Comments are denoted by a hash symbol (#) at the beginning of a line. Parsers should ignore comments.

+ +
# This is a full-line comment.
+FieldName (text) = Some Value
+
+ +
+

Field Types

+

The .szf format supports a variety of field types to handle different kinds of data:

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
TypeDescriptionExample Value
textA single line of text.Elara the Brave
text-fieldA multi-line block of text.A long sword forged by...\nIt glows faintly.
numberAn integer or floating-point number.16 or 3.5
boolA boolean value.true or false
calculatedA value derived from a formula.(Strength - 10) / 2
systemA special field that controls application behavior.
entry-referenceA reference to a single entry from a dataset.ClassData or ItemData.Longsword
entry-reference-listA comma-separated list of references to entries from a dataset.CoreFeats.PowerAttack, CoreFeats.Cleave
+
+ +
+

File Type Specifications

+ +

Dataset (!type: dataset)

+

A dataset file is a collection of structured entries.

+ +

Structure:

+
    +
  • [Metadata] Section: Contains information about the dataset. +
      +
    • Name (text): The human-readable name of the dataset.
    • +
    • Type (text): The category of the dataset (e.g., items, spells, classes).
    • +
    • Guid (text): A globally unique identifier. Optional.
    • +
    • Version (text): The semantic version of the dataset.
    • +
    +
  • +
  • [EntryName] Section: Each entry represents a specific item, spell, or other game element.
  • +
+ +

Example: CoreItems.szf

+
!type: dataset
+!schema: 1.1.0
+
+[Metadata]
+Name (text) = Core Fantasy Items
+Type (text) = items
+Guid (text) = c3d4e5f6-g7h8-9012-cdef-123456789012
+Version (text) = 1.0.0
+Author (text) = Fantasy Creator
+Description (text-field) = A collection of basic items for any fantasy campaign.
+
+[Longsword]
+Name (text) = Longsword
+Description (text-field) = A standard sword with a long blade and crossguard.
+Category (text) = Weapon
+
+[Longsword.Stats]
+Damage (text) = 1d8 slashing
+Weight (number) = 3
+Cost (number) = 15
+IsMartial (bool) = true
+ +

Character Template (!type: character_template)

+

A character_template defines the structure, fields, and rules for a character sheet.

+ +

Structure:

+
    +
  • [Metadata] Section: Contains information about the template.
  • +
  • [RequiredDatasets] Section: Lists all datasets required by this template.
  • +
  • [SectionName]: Defines sections on the character sheet with fields, types, and default values.
  • +
  • System Fields: Special fields that modify section behavior.
  • +
+ +

Example: FantasyTemplate.szf

+
!type: character_template
+!schema: 1.1.0
+
+[Metadata]
+Name (text) = Standard Fantasy Character
+Guid (text) = f9e8d7c6-b5a4-3210-9876-543210fedcba
+Version (text) = 2.1.0
+Author (text) = Template Master
+
+[RequiredDatasets]
+ClassData (text) = Core Classes|aaa-bbb-ccc|1.5.0
+ItemData (text) = Core Fantasy Items|c3d4e5f6-g7h8-9012-cdef-123456789012|1.0.0
+WeaponData (text) = Core Weapons|12345678-90ab-cdef-1234567890ab|1.0.0
+
+[Info]
+CharacterName (text) =
+Class (entry-reference) = ClassData
+
+[AbilityScores]
+Strength (number) = 10
+Dexterity (number) = 10
+
+[AbilityScores.Modifiers]
+StrengthMod (calculated) = (AbilityScores.Strength - 10) / 2
+DexterityMod (calculated) = (AbilityScores.Dexterity - 10) / 2
+
+[Equipment]
+DatasetReference (system) = WeaponData
+
+[Inventory]
+DatasetType (system) = items
+AllowQuantity (system) = true
+ +

Character (!type: character)

+

A character file is an instance of a character_template filled with specific data. It only contains values, as the structure and types are defined by the template.

+ +

Example: Elara.szf

+
!type: character
+!schema: 1.1.0
+
+[Metadata]
+Name = Aela the Huntress
+Guid = a1b2c3d4-e5f6-7890-abcd-ef1234567890
+Version = 1.0.0
+TemplateRef = Standard Fantasy Character|f9e8d7c6-b5a4-3210-9876-543210fedcba|2.1.0
+
+[Info]
+CharacterName = Aela the Huntress
+Class = Ranger
+
+[AbilityScores]
+Strength = 16
+Dexterity = 14
+
+[Equipment]
+PrimaryWeapon = ItemData.Longsword
+PrimaryWeapon.Quantity = 1
+
+[Inventory]
+HealingPotion = ItemData.HealingPotion
+HealingPotion.Quantity = 5
+HempRope = ItemData.HempRope
+HempRope.Quantity = 2
+
+ +
+

Advanced Features

+ +

System Properties

+

System properties are special fields within a character_template that modify the behavior of a section:

+
    +
  • DatasetType (system) = type: Restricts a section to holding references from datasets of a specific type.
  • +
  • DatasetReference (system) = alias: Restricts a section to holding references from a specific dataset.
  • +
  • AllowQuantity (system) = true: Allows entry-reference fields to have associated quantity fields.
  • +
+ +

Quantity Fields

+

If a template section has AllowQuantity (system) = true, a character file can specify quantities using:

+

Syntax: ReferenceFieldName.Quantity = value

+ +

Calculated Fields

+

Fields of type calculated contain formulas that are evaluated by the application. They support:

+
    +
  • Basic arithmetic operations (+, -, *, /)
  • +
  • Parentheses for grouping
  • +
  • Dot notation to reference other fields
  • +
+ +

Wildcard Calculations

+

For sections with AllowQuantity enabled, use wildcard syntax for aggregate calculations:

+

SectionName.*.FieldName: Refers to the FieldName property of all items in SectionName.

+ +
[Inventory]
+DatasetType (system) = items
+AllowQuantity (system) = true
+TotalWeight (calculated) = Inventory.*.Weight * Inventory.*.Quantity
+
+ +
+

Best Practices

+
    +
  1. GUIDs: Leave this blank, and the system will generate a GUID for you. This ensures uniqueness across datasets and templates.
  2. +
  3. Versioning: Use semantic versioning for your files to manage updates and breaking changes.
  4. +
  5. Naming Convention: Strictly use PascalCase for all SectionNames and FieldNames.
  6. +
  7. Nested sections: Use dot notation to create logical hierarchies but avoid excessive nesting.
  8. +
  9. Dependencies: Explicitly list all required datasets in templates.
  10. +
  11. Validation: Before use, validate that a file's structure is correct and all references are valid.
  12. +
+
+
+
+ + ↑ Top +
+ + + + \ No newline at end of file