Skip to main content

Code frameworks

Project layout and manifest

Where each file goes, how files are named, and what the manifest must declare.

Folders

FolderHoldsNotes
manifest/project.jsonExactly one manifest.
schemas/One JSON file per FrameworkThe Framework id is the file's id field.
rules/TypeScript rule filesOne exported function per constructor or action file.
layouts/FramesEach Frame is a JSON file that a Framework lists.
scenarios/TestsOne scenario object per file.

Use lowercase relative paths with no .. parts. Framework, action and function ids start with a lowercase letter, then use lowercase letters, digits, underscores or hyphens, up to 64 characters.

The manifest

manifest/project.json
{
  "formatVersion": "fabled.game-project/v1",
  "projectId": "game-your-game-id",
  "projectKind": "GAME",
  "compilerProfile": "native-game-v1",
  "name": "Lantern Keepers",
  "entryFramework": "keeper",
  "frameworks": ["schemas/keeper.json"],
  "scenarios": ["scenarios/new-keeper.json", "scenarios/heal.json"]
}
  1. Line 3 Keep the projectId the editor made. It must match the id of the project.
  2. Lines 8-9 Paths start at the project root.
FieldRequiredMeaning
formatVersionYesAlways fabled.game-project/v1.
projectIdYesThe id the editor created for your game. Keep it as it is. It must match the id of the whole project, or saving fails.
projectKindYesGAME for a full game with a character, or ADD_ON for extra content.
compilerProfileYesAlways native-game-v1.
nameYesThe project name.
descriptionNoUp to 2000 characters. Use it for a licence or credit line.
entryFrameworkYesThe Framework players create first. For a GAME, a playable character.
frameworksYesPaths of the Framework files, 1 to 64.
scenariosYesPaths of the scenario files, 1 to 512.

The manifest accepts only these fields, plus optional tables and rights. An unknown field is an error.

If the id in the manifest and the id of the project differ, the check stops with:

manifest projectId does not match source tree projectId

Every file must be listed

The manifest lists the Framework and scenario files. Each Framework file lists its own rules and Frames. A file that nothing refers to is an error, so remove it or list it.

export function extra(): void {}

Adding this file without referring to it fails with:

Project contains undeclared source files: rules/extra.ts.

A path that is listed but missing fails too. Here the manifest points at a scenario file that does not exist.

{
  "formatVersion": "fabled.game-project/v1",
  "projectId": "game-your-game-id",
  "projectKind": "GAME",
  "compilerProfile": "native-game-v1",
  "name": "Lantern Keepers",
  "entryFramework": "keeper",
  "frameworks": ["schemas/keeper.json"],
  "scenarios": ["scenarios/new-keeper.json", "scenarios/nope.json"]
}
Missing or misplaced project source.

Size limits

A project can hold up to 8 MiB of source, 1000 files, 64 Frameworks and 512 scenarios. Fabled also compiles your source into one game. That compiled game must stay under 16 MiB before it can be prepared.