# Cinématiques

> Le standard des cinématiques : la bande-annonce et les scènes d'un monde, et quand elles passent ; chaque champ, chaque règle, chaque version.

Un fichier de cinématiques contient la bande-annonce et les scènes d'un monde, et dit quand elles passent : quand une quête commence ou se termine, après chaque quête d'un type, ou quand un article du store est ajouté. Une scène passe sa vidéo si elle peut, sinon sa page, sinon ses plans, et a toujours un résumé pour le joueur qui la passe.

| | |
|---|---|
| **Standard** | `alta.cinematics/0.1` |
| **Fichier** | `cinematics.json` (dans un dossier d'univers) |
| **Le créer** | `alta new cinematics my-scenes` |
| **Le vérifier** | `alta lint my-scenes` |
| **Schéma JSON** | [alta.cinematics.schema.json](https://github.com/altasystem-ai/alta/blob/main/docs/standards/schemas/alta.cinematics.schema.json) |

## Exemple minimal

Une bande-annonce de deux plans : un carton titre, puis la caméra va au centre de la carte.

```json [cinematics.json]
{
  "schema": "alta.cinematics/0.1",
  "trailer": "trailer",
  "scenes": {
    "trailer": {
      "title": {
        "en": "Your machine, as a world",
        "fr": "Ta machine, comme un monde"
      },
      "recap": [
        {
          "en": "What you see is what really runs on your machine.",
          "fr": "Ce que tu vois est ce qui tourne vraiment sur ta machine."
        }
      ],
      "shots": [
        {
          "kind": "card",
          "dur": 3,
          "title": {
            "en": "Your machine, as a world",
            "fr": "Ta machine, comme un monde"
          }
        },
        {
          "kind": "pan",
          "dur": 2,
          "to": "centre",
          "zoom": 1.4
        }
      ]
    }
  }
}
```

## Champs

*Référence en anglais : les descriptions des champs sont celles du schéma JSON, que ton éditeur affiche aussi.*

### Cinématiques

Le fichier lui-même.

| Field | Type | Required | Description |
|---|---|---|---|
| `schema` | "alta.cinematics/0.1" | yes | The standard: `alta.cinematics/0.1`. |
| `trailer` | string | no | The scene played as the world's trailer, by id. |
| `quests` | map of object | no | Scenes for given quests, by quest uid. |
| `quests.<id>.intro` | string | no | The scene played when the quest starts. |
| `quests.<id>.outro` | string | no | The scene played when it is done. |
| `types` | map of string | no | The outro of every quest of a type, by quest type. |
| `items` | map of string | no | The scene played when a chart is added, by chart id. |
| `scenes` | map of scene | yes | The scenes, by id. |

### Scène

Une scène dure 120 secondes au plus. « Passer » montre toujours son résumé, et une scène déjà vue ne repasse jamais d'elle-même.

| Field | Type | Required | Description |
|---|---|---|---|
| `title` | text | yes | The scene's title. |
| `recap` | text[] | yes | The scene in a few lines: shown when it is skipped, and when nothing else can play. |
| `video` | string | no | A video: a path served by the game (`/…`) or an `https://` address. |
| `page` | string | no | A page of the game to show in a frame, by path (`/…`). |
| `shots` | shot[] | no | The shots, played in order. |

### Plan

`kind` dit ce qu'est le plan ; chaque sorte a ses propres champs.

| Field | Type | Required | Description |
|---|---|---|---|
| `kind` | enum | yes | What the shot is; each kind has its own fields. |
| `dur` | number | yes | How long it lasts, in seconds (at most 30). |
| `title` | text | no | A card's title. |
| `text` | text | no | A card's text, or what an agent says (`line`). |
| `to` | string | yes | Where a `pan` goes: an entity id, `centre`, `edge` or `wide`. |
| `zoom` | number | no | The zoom of a pan, from 0.3 to 3. |
| `who` | enum | no | The agent who speaks a `line`, by role. |
| `name` | enum | yes | The effect: `burst`, `flash`, `rings` or `letterbox`. |
| `entity` | string | yes | The entity a `reveal` shows, by id. |

## Règles et erreurs

Chaque règle que `alta lint` applique aux cinématiques, avec sa section sur la [page des erreurs](https://docs.altasystem.ai/fr/reference/errors#standard-cinematics).

## Exemple complet

<details class="alta-full-example">
<summary>Une bande-annonce, l'intro et la fin d'une quête, la fin d'un type et la scène d'un article</summary>

```json [cinematics.json]
{
  "schema": "alta.cinematics/0.1",
  "trailer": "trailer",
  "quests": {
    "core.tidy-downloads": {
      "intro": "tidy-intro",
      "outro": "tidy-outro"
    },
    "focus.quiet-hours": { "outro": "quiet-outro" }
  },
  "types": { "repair": "fixed", "daily": "day-done" },
  "items": { "evening-pack": "pack-arrives" },
  "scenes": {
    "trailer": {
      "title": {
        "en": "Your machine, as a world",
        "fr": "Ta machine, comme un monde"
      },
      "recap": [
        {
          "en": "What you see is what really runs on your machine.",
          "fr": "Ce que tu vois est ce qui tourne vraiment sur ta machine."
        },
        {
          "en": "Quests move the real setup forward.",
          "fr": "Les quêtes font avancer la vraie configuration."
        }
      ],
      "video": "/media/trailer/neutral.mp4"
    },
    "tidy-intro": {
      "title": {
        "en": "Too many downloads",
        "fr": "Trop de téléchargements"
      },
      "recap": [
        {
          "en": "The guardian proposes a rule for old downloads.",
          "fr": "Le gardien propose une règle pour les vieux téléchargements."
        }
      ],
      "shots": [
        {
          "kind": "pan",
          "dur": 2,
          "to": "agent:guardian",
          "zoom": 1.6
        },
        {
          "kind": "line",
          "dur": 4,
          "who": "guardian",
          "text": {
            "en": "Your downloads pile up. Let's choose a rule.",
            "fr": "Tes téléchargements s'entassent. Choisissons une règle."
          }
        }
      ]
    },
    "tidy-outro": {
      "title": {
        "en": "A tidy machine",
        "fr": "Une machine rangée"
      },
      "recap": [
        {
          "en": "Each week, old downloads follow your rule.",
          "fr": "Chaque semaine, les vieux téléchargements suivent ta règle."
        }
      ],
      "page": "/film/neutral/tidy.html"
    },
    "quiet-outro": {
      "title": {
        "en": "Quiet hours",
        "fr": "Heures calmes"
      },
      "recap": [
        {
          "en": "Nothing disturbs you during your quiet hours.",
          "fr": "Rien ne te dérange pendant tes heures calmes."
        }
      ],
      "shots": [
        {
          "kind": "fx",
          "dur": 1,
          "name": "flash"
        },
        {
          "kind": "card",
          "dur": 3,
          "title": {
            "en": "Quiet hours on",
            "fr": "Heures calmes activées"
          },
          "text": {
            "en": "The operator holds the door.",
            "fr": "L'opérateur tient la porte."
          }
        }
      ]
    },
    "fixed": {
      "title": { "en": "Fixed", "fr": "Réparé" },
      "recap": [
        {
          "en": "What had stopped runs again.",
          "fr": "Ce qui s'était arrêté tourne à nouveau."
        }
      ]
    },
    "day-done": {
      "title": {
        "en": "Done for today",
        "fr": "Fait pour aujourd'hui"
      },
      "recap": [
        {
          "en": "This quest comes back tomorrow.",
          "fr": "Cette quête revient demain."
        }
      ]
    },
    "pack-arrives": {
      "title": {
        "en": "A new place appears",
        "fr": "Un nouveau lieu apparaît"
      },
      "recap": [
        {
          "en": "The evening pack adds its own quests.",
          "fr": "Le pack du soir ajoute ses propres quêtes."
        }
      ],
      "shots": [
        {
          "kind": "pan",
          "dur": 2,
          "to": "edge"
        },
        {
          "kind": "reveal",
          "dur": 2,
          "entity": "module:evening-pack"
        },
        {
          "kind": "fx",
          "dur": 1,
          "name": "rings"
        }
      ]
    }
  }
}
```

</details>

## Versions

| Version | Ce qu'elle ajoute | Lue par le jeu |
|---|---|---|
| `alta.cinematics/0.1` | Bande-annonce, scènes, plans, et quand ils passent | actuelle |

## Guides qui l'utilisent

- [Créer une cinématique](https://docs.altasystem.ai/fr/guides/cinematics/scene)
- [Créer un univers](https://docs.altasystem.ai/fr/guides/universes/create)
