# Create a cinematic

> A short scene played when a world opens, around a quest or when an item arrives; the player can always skip it and read its recap.

You write a short scene: the trailer of a world, the start or the end of a quest, the end of every daily quest, or the arrival of a store item. The player can always skip it; skipping shows its recap in text, so they still know what just happened. A scene already seen does not play again by itself.

**Before you begin (15 minutes)**

- The `alta` command (see [Install the CLI](https://docs.altasystem.ai/start/install)).
- A quest to attach a scene to: one of the game, or one of your [quest pack](https://docs.altasystem.ai/quickstart).

### Create the file

`alta new cinematics` writes a file of scenes that already passes `alta lint`: a trailer, a scene at the end of a quest, and one at the end of every daily quest.

```sh [Terminal]
alta new cinematics my-scenes
```

```text [Output]
created my-scenes/cinematics.json (cinematics, id my-scenes)
next: edit the texts, then `alta lint my-scenes`, then `alta dev my-scenes`
```

### Write a scene

A scene has a `title` and a `recap`, the lines read when it is skipped. It then plays, by preference, its `video`, else its `page`, else its `shots`, else the recap as a narrated card. Shots are played by the game itself, each with a duration `dur` of 0 to 30 seconds, 120 seconds at most for a scene:

| `kind` | What it does |
|---|---|
| `card` | a title card (`title`, `text`) |
| `pan` | moves the camera `to` a thing of the map, `centre`, `edge` or `wide`, with a `zoom` |
| `line` | a line said by an agent (`who`, `text`) |
| `fx` | an effect: `burst`, `flash`, `rings`, `letterbox` |
| `reveal` | a thing of the map appears (`entity`) |

```json [my-scenes/cinematics.json]
{
  "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."
      }
    }
  ]
}
```

### Attach it to a quest

Under `quests`, give the `uid` of a quest and the scene that opens it (`intro`), closes it (`outro`), or both. The quest must exist: in the game, or in a file of the same folder. The two quests named here come from the quest pack examples: save [`core.fragment.json`](https://github.com/altasystem-ai/alta/blob/main/examples/quest-pack/core.fragment.json) and [`focus.game.json`](https://github.com/altasystem-ai/alta/blob/main/examples/quest-pack/focus.game.json) in `my-scenes` too, or put the `uid` of a quest of your own.

```json [my-scenes/cinematics.json]
{
  "core.tidy-downloads": { "intro": "tidy-intro", "outro": "tidy-outro" },
  "focus.quiet-hours": { "outro": "quiet-outro" }
}
```

### Play it for a type of quest or an item

`types` gives the closing scene of every quest of one type (`repair`, `daily`…), used when the quest has no `outro` of its own. `items` gives the scene played when a store item appears, by the item's id. `trailer` names the scene that opens the world.

```json [my-scenes/cinematics.json]
{ "repair": "fixed", "daily": "day-done" }
```

```json [my-scenes/cinematics.json]
{
  "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" }
  ]
}
```

### Check it

`alta lint` makes sure every name points at a scene, every `uid` at a quest it knows, every type at a type of quest, and that every scene has its recap.

```sh [Terminal]
alta lint my-scenes
```

```text [Output]
ok   my-scenes/cinematics.json (cinematics)
ok   my-scenes/core.fragment.json (quests)
ok   my-scenes/focus.game.json (game)
3 checked, 0 errors, 0 warnings
```

**Try it:**

```sh
alta dev my-scenes
```

Open the address it prints: your trailer plays when the world opens, in every world. Skip it to read its recap.

## Pitfalls

| Do | Avoid |
|---|---|
| A recap that says what happened, in one or two lines | A recap that repeats the title |
| A `uid` of a quest of the game or of the same folder | A quest the check cannot see: refused |
| A video on a path the game serves, or `https://` | Any other address: refused |
| Short shots: a scene the player watches to the end | A scene over 120 seconds: refused |

Known limits, said plainly: a `pan` towards a thing that does not exist on the map is not seen by the check. A store item can name its scene in two places (the item and the scenes of a universe): keep it in one.

## Go further

- [Cinematics](https://docs.altasystem.ai/reference/standards/cinematics): every field of a scene and a shot.
- [Universes](https://docs.altasystem.ai/concepts/universes): a universe brings its own scenes.
- [Errors](https://docs.altasystem.ai/reference/errors#standard-cinematics): each rule of `alta lint` for scenes.

**Next:**

- [Send an agent on a mission](https://docs.altasystem.ai/guides/missions/send-agent)
- [Create a universe](https://docs.altasystem.ai/guides/universes/create)
- [Cinematics](https://docs.altasystem.ai/reference/standards/cinematics)
